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.
-
Update the schema in
prisma/schema.prisma -
Set the
DATABASE_URLenvironment variableexport DB_HOST=localhost export DB_URL=postgresql://postgres:postgres@$DB_HOST:5432/postgres -
Update the local database
npm run prisma:push -
Update the Prisma client
npx prisma generate -
View the database in a GUI and add seed data
npx prisma studio -
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.
- Click
New GitHub Appfrom your GitHub apps page. - For Hompage URL, use
http://localhost:3000. - Add the following callback URLs:
http://localhost:3000/api/auth/callback/github,http://localhost:3000/. - Click
Create GitHub App. - Add the App ID from the GitHub App to the
.env.localfile asGITHUB_APP_ID. - Add the Client ID from the GitHub App to the
.env.localfile asGITHUB_APP_CLIENT_ID. - Add the Client Secret from the GitHub App to the
.env.localfile asGITHUB_APP_CLIENT_SECRET. Generate a private keyand set the contents of the private key to the.env.localfile asGITHUB_APP_PRIVATE_KEY.
Learn More
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!