Click the link below to verify your email
[ Server ] Verify email [ Server ] ``` -------------------------------- ### Send Email using Wasp's Email Module Source: https://context7_llms Demonstrates sending an email using the `send` function from Wasp's `email` module. This example shows sending a notification email to a customer upon subscription cancellation. ```typescript //... if (subscription.cancel_at_period_end) { await emailSender.send({ to: customer.email, subject: 'We hate to see you go :(', text: 'We hate to see you go. Here is a sweet offer...', html: 'We hate to see you go. Here is a sweet offer...', }); } ``` -------------------------------- ### Configure App Name and Title in main.wasp Source: https://context7_llms This snippet shows how to set the application's name and title within the `main.wasp` configuration file. Changing the app name will trigger a database reset, requiring `wasp db start` and `wasp db migrate-dev` to be rerun. ```wasp app YourAppName { wasp: { version: "^0.13.2" }, title: "Your App Name", ``` -------------------------------- ### Start Stripe CLI Webhook Forwarding Source: https://context7_llms Initiates Stripe CLI webhook forwarding to your local Node.js server running on port 3001. This command is essential for testing webhook functionality by relaying events from Stripe to your development environment. Ensure your server is configured to listen on the specified path. ```sh stripe listen --forward-to localhost:3001/payments-webhook ``` -------------------------------- ### Deploy Blog to Netlify (Production) Source: https://context7_llms Deploys the Astro Starlight blog to Netlify production. This command should be run after staging and confirming the deployment. ```sh netlify deploy --prod ``` -------------------------------- ### Deploy Blog to Netlify (Staging) Source: https://context7_llms Deploys the Astro Starlight blog to Netlify for staging. It prompts the user to select the 'dist' directory as the deploy path. ```sh netlify deploy ``` -------------------------------- ### Build and Deploy Astro Starlight Blog to Netlify Source: https://docs.opensaas.sh/guides/deploying Build your Astro Starlight blog for deployment and deploy it to Netlify. This involves running `npm run build` in the blog directory, followed by `netlify deploy` to select the distribution directory and `netlify deploy --prod` for production deployment. ```bash npm run build netlify deploy netlify deploy --prod ``` -------------------------------- ### Create New Open SaaS Project Source: https://context7_llms Initializes a new Wasp project and selects the 'saas' template. This command is run from the directory where you want to create your project. ```shell wasp new ``` -------------------------------- ### Build Blog for Netlify Deployment Source: https://context7_llms Builds the Astro Starlight blog for deployment. This command generates the static site in the 'blog/dist' directory, ready for Netlify deployment. ```sh npm run build ``` -------------------------------- ### Configure Dummy Email Provider (Local Dev) Source: https://context7_llms Sets up the 'Dummy' email provider for local development. No emails are actually sent; verification tokens are found in server logs. This provider prevents app builds and must be replaced for production. ```tsx app SaaSTemplate { // ... emailSender: { provider: Dummy, defaultFrom: { name: "Open SaaS App", email: "me@example.com" }, }, ``` -------------------------------- ### Install Specific Stripe NPM Package Version (Bash) Source: https://docs.opensaas.sh/guides/deploying This command demonstrates how to install a specific version of the Stripe NPM package. This is useful when your Stripe account's default API version does not match the latest available Stripe API version, and you need to align your client with an older version. ```bash npm install stripe@x.x.x // e.g. npm install stripe@13.11.0 ``` -------------------------------- ### Build Frontend for Manual Deployment Source: https://docs.opensaas.sh/guides/deploying Build your frontend application for manual deployment by running the build command, ensuring any necessary client-side environment variables are passed. ```bash REACT_APP_CLIENT_ENV_VAR_1=<...> npm run build ``` -------------------------------- ### Stripe CLI Login Command Source: https://context7_llms Command to log in to the Stripe CLI. Ensure you have the Stripe CLI installed and follow the on-screen prompts to authenticate your account. ```shell stripe login ``` -------------------------------- ### Create Wasp Database Migration Source: https://context7_llms Generates the initial database schema migration for a Wasp project. This command installs necessary dependencies and applies schema changes. It should be run whenever the Prisma schema (Entities) is modified. ```shell wasp db migrate-dev ``` -------------------------------- ### App Folder Structure Overview (Shell) Source: https://context7_llms This snippet provides a detailed view of the 'app' folder's structure within the Open SaaS project. It lists key files and subdirectories, including the Wasp config file ('main.wasp'), public assets directory, source code ('src') organized by feature (admin, auth, client, etc.), server-specific code, shared utilities, and environment/configuration files. ```shell . main.wasp # Wasp Config file. You define your app structure here. .wasp/ # Output dir for Wasp. DON'T MODIFY THESE FILES! public/ # Public assets dir, e.g. www.yourdomain.com/public-banner.webp src/ # Your code goes here. admin/ # Admin dashboard related pages and components. analytics/ # Logic and background jobs for processing analytics. auth/ # All auth-related pages/components and logic. client/ # Shared components, hooks, landing page, and other client code (React). demo-ai-app/ # Logic for the example AI-powered demo app. file-upload/ # Logic for uploading files to S3. landing-page # Landing page related code messages # Logic for app user messages. payment/ # Logic for handling payments and webhooks. server/ # Scripts, shared server utils, and other server-specific code (NodeJS). shared/ # Shared constants and util functions. user/ # Logic related to users and their accounts. .env.server # Dev environment variables for your server code. .env.client # Dev environment variables for your client code. .prettierrc # Prettier configuration. tailwind.config.js # TailwindCSS configuration. package.json package-lock.json .wasproot ``` -------------------------------- ### Deploy App with Wasp CLI to Fly.io Source: https://context7_llms Deploys a full-stack application (DB, server, client) to Fly.io using the Wasp CLI. This command handles setting up essential server-side environment variables. ```sh REACT_APP_CLIENT_ENV_VAR_1=<...> REACT_APP_CLIENT_ENV_VAR_2=<...> wasp deploy ``` -------------------------------- ### Implement User-Specific Authorization Logic (TypeScript) Source: https://context7_llms Grant or deny access to page content based on user properties like subscription status. This example demonstrates how to conditionally render content using the `User` object passed to the component. ```typescript export default function Example({ user }: { user: User }) { if (user.subscriptionStatus === 'past_due') { return (Your subscription is past due. Please update your payment information.) } if (user.subscriptionStatus === 'cancel_at_period_end') { return (Your susbscription will end on 01.01.2024) } if (user.subscriptionStatus === 'active') { return (Thanks so much for your support!) } } ``` -------------------------------- ### AWS S3 CORS Configuration Example Source: https://docs.opensaas.sh/guides/file-uploading Define the Cross-Origin Resource Sharing (CORS) configuration for your S3 bucket to allow file uploads from your application. Ensure 'AllowedOrigins' includes your development and production domains. ```json [ { "AllowedHeaders": [ "*" ], "AllowedMethods": [ "POST", "GET" ], "AllowedOrigins": [ "http://localhost:3000", "https://