FastTrack

February 14, 2025 ยท View on GitHub

This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, create a .env.local file in the root of the project by copying .env.example.

Then, run the development database:

docker compose up

Lastly, run the development server:

npm run next:dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.

This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.

Database

When you run docker compose up, a PostgreSQL database is created for local development and testing. When making changes to the schema, you will need to do the following.

  1. Update the schema in prisma/schema.prisma

  2. Set the DATABASE_URL environment variable

    export DB_HOST=localhost
    export DB_URL=postgresql://postgres:postgres@$DB_HOST:5432/postgres
    
  3. Update the local database

    npm run prisma:push
    
  4. Update the Prisma client

    npx prisma generate
    
  5. View the database in a GUI and add seed data

    npx prisma studio
    
  6. Once your changes are ready for a PR, make sure to generate the migration.

    npm run prisma:migrate
    

Auth

Enable authentication using the GitHub authentication provider.

  1. Click New GitHub App from your GitHub apps page.
  2. For Hompage URL, use http://localhost:3000.
  3. Add the following callback URLs: http://localhost:3000/api/auth/callback/github, http://localhost:3000/.
  4. Click Create GitHub App.
  5. Add the App ID from the GitHub App to the .env.local file as GITHUB_APP_ID.
  6. Add the Client ID from the GitHub App to the .env.local file as GITHUB_APP_CLIENT_ID.
  7. Add the Client Secret from the GitHub App to the .env.local file as GITHUB_APP_CLIENT_SECRET.
  8. Generate a private key and set the contents of the private key to the .env.local file as GITHUB_APP_PRIVATE_KEY.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!