Quizrr is a project that leverages Go, Prisma, PostgreSQL, and Next.js to create a quiz platform. This README will guide you through the setup and installation process for both the backend and frontend.
git clone https://github.com/palveVaishnav/newQuizrr.git
cd newQuizrr
PostgreSQL database using Docker:
docker run --name quizrr \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=password \
-e POSTGRES_DB=quizrr-new \
-p 5432:5432 \
-d postgres
DB URL:
docker exec -it quizrr psql -U postgres -d quizrr-new
Whenever you make changes to the Prisma schema, you need to migrate your database and re-generate the Prisma Go client.
-
Set the
.env
file for the backend:DATABASE_URL="postgresql://postgres:password@localhost:5432/quizrr-new"
-
Prisma Commands:
- To re-generate the Go client:
go run github.com/steebchen/prisma-client-go generate
- To sync the database with your schema for development:
go run github.com/steebchen/prisma-client-go db push
- To create a Prisma schema from your existing database:
go run github.com/steebchen/prisma-client-go db pull
- For production, create a migration:
go run github.com/steebchen/prisma-client-go migrate dev
- To sync your production database with your migrations:
go run github.com/steebchen/prisma-client-go migrate deploy
- To re-generate the Go client:
-
Navigate to the backend directory:
cd backend
-
Install dependencies and tidy up modules:
go mod tidy
-
Start the backend server:
cd cmd air # or go run main.go
To seed the database, send a GET
request to the /seed
route:
http://127.0.0.1:8080/seed
-
Navigate to the frontend directory:
cd frontend
-
Install dependencies:
npm install
-
Run the development server:
npm run dev
Create a .env
file in the frontend
directory with the following content:
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=password_nextauth
GOOGLE_CLIENT_ID=""
GOOGLE_CLIENT_SECRET=""
NEXT_PUBLIC_API="http://127.0.0.1:8080"
- Home page: Placeholder page, not functional.
- Packs and Results: Fully working.
- Tests: Pixel-perfect design with functional testing and result viewing.
- Timer: works,
- No Payment Gateway: Not implemented yet.