All commands are run from the root of the project, from a terminal:
| Command | Action |
|---|---|
npm install |
Installs dependencies |
npm run dev |
Starts local dev server at localhost:3000 |
npm run build |
Build the project |
npm run stripe:listen |
Start listening for Stripe events and forward them to http://localhost:3000/api/payment/stripe-hooks |
npm run type-check |
Run TypeScript type checking using tsc --noEmit |
npm run lint |
Run Lint |
npm run lint --fix |
Run Lint and autofix issues` |
npm run db:generate |
Generate database migrations |
npm run db:migrate |
Run database migrations |
npm run db:seed |
Seed database |
npm run db:reset |
Reset database |
The project is organized around the "feature-first" approach, where each feature of the application resides in its own directory within the features folder. This structure promotes modularity and scalability, making it easier to manage and develop the application as it grows.
Within each feature directory, you will find the following subdirectories and files:
services/: Contains the business logic and data fetching mechanisms. Services are responsible for communicating with external APIs or databases.components/: Holds the React components specific to this feature.api/: Contains api calls (for ex: react-query calls)- Other files: Depending on the feature's needs, you might find additional files and directories here, such as utilities, hooks, or context providers.
- Copy
.env.sampleinto.env - Go to Supabase and create a new project.
- From
Project Settings -> APIget yourSUPABASE_URLandSUPABASE_ANON_KEY. - From
Project Settings -> Databaseget yourConnection stringand set it asDATABASE_URL.- It should be something like this:
postgres://postgres.[ID]:[YOUR-PASSWORD]@aws-0-eu-central-1.pooler.supabase.com:6543/postgres.
- It should be something like this:
- Visit the Stripe website and create an account. After that, login to the
Dashboard, navigate to theDeveloperssection. Click on theAPI KEYStab and get thesecret keyand store it insideSTRIPE_SECRET_KEYvariable. - Install the Stripe cli. After you login, run
npm run stripe:listen. You will get a messageYour webhook signing secret is whsec_8be0f03b.... Store that signing secret asSTRIPE_SIGNING_SECRET. - The last step is to go to
Supabase -> Authentication -> Providersand configureGithubandGoogleauth. Now you're good to go!
Enjoy!