Install all npm packages:
npm installTo get *.env file, contact [email protected]. Do not leak, share or spam any of these api keys, because it is charged money.
Run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devNote that this ngrok server is free, so that it can only be run by 1 person.
If you want to create any new schemas for the database, create it in src/db/schema.ts
Remember, after create or modify a schema, must generate a migration script and push it to the database to update
Generate migration script:
npm run generatePush migration script:
npm run pushRun Drizzle Studio to view the database:
npm run studioFor more commands, take a look in package.json file and in the drizzle-orm documentation pages.
For unit tests, we use jest. Put all your unit tests code into the folder: /tests
git clone https://github.com/Louis2602/tfcmYour code needs to be in a Git repository on GitHub, GitLab, or Bitbucket.
-
Initialize a Git repository (if you haven’t already).
git init
-
Add your files to the repository.
git add . -
Commit your changes.
git commit -m "Initial commit" -
Add the remote repository.
git remote add origin <your-repository-url>
-
Push your code to the repository.
git push -u origin main
-
Login to Vercel: Go to Vercel and log in with your account.
-
Import Project:
- Click on the “New Project” button on your dashboard.
- Select the Git provider where your repository is hosted (GitHub, GitLab, or Bitbucket).
- Authorize Vercel to access your repositories if prompted.
-
Select Repository: Choose the repository containing your Next.js app.
-
Configure Project:
- Ensure the project name and root directory are correct.
- Vercel will automatically detect it’s a Next.js project and apply the appropriate settings.
-
Environment Variables: If your application requires environment variables, add them in the "Environment Variables" section.
NODE_ENV=development
# OpenAI
OPENAI_API_KEY=sk-proj-example
# App URL
APP_URL="http://localhost:3000"
NEXT_PUBLIC_APP_URL="http://localhost:3000"
POSTGRES_URL=example
# Stripe
STRIPE_API_KEY=example
STRIPE_WEBHOOK_SECRET=example
STRIPE_PLAN_100=example
STRIPE_PLAN_200=example
STRIPE_PLAN_350=example
STRIPE_PLAN_500=example
BLOB_READ_WRITE_TOKEN="vercel_blob_example"
GOOGLE_TRENDS_REALTIME_URL="https://serpapi.com/search.json"
GOOGLE_TRENDS_API_KEY=example- Deploy: Click on the “Deploy” button. Vercel will start the deployment process.
- Monitor Deployment: You can monitor the build logs to see the progress of your deployment.
- Access Your App: Once the deployment is complete, Vercel will provide you with a URL to access your deployed application.
If you have a custom domain, you can configure it in Vercel:
-
Add Domain:
- Go to the “Domains” tab in your project settings.
- Click on “Add Domain” and enter your custom domain.
-
Update DNS Settings:
- Update your domain's DNS settings to point to Vercel. This usually involves adding an A record or CNAME record as instructed by Vercel.
-
Verify Domain: Once DNS settings are updated, click on “Verify” in Vercel to confirm the domain setup.
For continuous deployment, you can configure Vercel to automatically deploy your app whenever you push changes to the main branch.
-
Branch Settings:
- Go to the “Git” tab in your project settings.
- Ensure the main branch is selected for automatic deployments.
-
Deploy Hooks (Optional):
- You can set up deploy hooks to trigger deployments from other sources or scripts.