Home schooling project
- Main engine: Next.js by Vercel
- Database toolkit: Prisma
- GraphQL server and client handlers: Apollo GraphQL
- Code first GraphQL schemas: GraphQL Nexus
- Passwordless Auth: NextAuth.js
- ofc
React,TypeScript, etc
Make sure you have all dependencies
yarn installcp .env.copy .envFill in environment variables in .env.
prisma connects to the PostgreSQL database, so make sure you have it running, available through DATABASE_URL in .env.
To use database via Docker)
Start
docker-compose up --detachYou can start the development just by running simple script included in the repo:
./start.shIt will load environment variables from .env file (for prisma and next-auth), run migrations to database and start two parallel processes: prisma generate --watch and next dev. Former is used if you intend to make changes to prisma/schema.prisma file, it will automatically regenerate the @prisma/client. Later spins up Next.js dev server.
If you make changes to prisma/schema.prisma file, make sure your database has those updates. Use yarn prisma:migrate for prisma to create a migration for your database.
If you don't need to work with schema.prisma, just comment out a line in start.sh with npx npm-run-all and add yarn run dev below. Make sure you don't commit these changes.