This is a Next.js project bootstrapped with create-next-app.
First, get a database running. You will need Docker installed on your machine.
docker-compose upThen, make sure all your node modules are installs
npm installNext, make sure you modify the .env file to have the correct information for database connection.
Make sure the database is migrated.
npx prisma migrate devFinally, run the development server:
npm run devOpen http://localhost:3000 with your browser to see the result.
To add a teacher and a class to the database, run the following curl commands to add data
curl --location 'http://localhost:3000/api/users/newteacher' \
--header 'Content-Type: application/json' \
--data-raw '{
"email" : "teacher@gmail.com",
"password" : "password"
}'curl --location 'http://localhost:3000/api/classes' \
--header 'Content-Type: application/json' \
--data '{
"name" : "CSC 307",
"password" : "password",
"description" : "Software Development",
"teacherId" : 4
}'This adds a class, called CSC 307, which has an ID of 1 and a password of 'password'
npx prisma studio