This project is a Quiz Application built with Next.js, React, and TypeScript. It allows users to create quizzes, take quizzes with a countdown timer, and view their results.
- Create quizzes with multiple-choice questions.
- Take quizzes with a countdown timer.
- Submit quizzes and view results.
- Responsive design with Tailwind CSS.
- Next.js
- React
- TypeScript
- postgreSQL
- Prisma
- Tailwind CSS for styling
- Axios for API requests
Ensure you have the following installed on your machine:
- Node.js (>=14.x)
- npm or yarn
- A PostgreSQL database (or another Prisma-supported database)
-
Clone the repository:
git clone https://github.com/yourusername/quiz-app.git cd quiz-app
Installation:
- Open your terminal in the project directory.
- Run
npm install
(oryarn install
) to install dependencies.
Environment Variables:
Create a file named .env.local
in your project root and add the following variables, replacing the placeholders with your actual values:
NEXTAUTH_URL=http://localhost:3000 NEXTAUTH_SECRET=your-nextauth-secret GOOGLE_ID=your-google-id GOOGLE_SECRET=your-google-secret
-
Open your terminal in the project directory.
-
Run
npm install
(oryarn install
) to install dependencies. -
Open your terminal in the project directory.
-
Run
npm install
(oryarn install
) to install dependencies.
Development Server:
Start the development server with:
npm run dev
(oryarn dev
)
The application will be available at http://localhost:3000.
Features:
- Create Quiz: Define quiz details and questions.
- Take Quiz: Answer questions within a timer limit.
- Timer: Tracks remaining time during the quiz.
- Results: View your score and correct answers after submission.
API Routes:
POST /api/Createquiz
: Create quiz and store in postgreSQL Database.POST /api/Seeparticularquiz
: Retrieve quiz details by ID.POST /api/submitQuiz
: Submit answers and receive score & correct answers.
Additional features:
Timer
: Manages the quiz countdown.
Pages:
Page.tsx
: Home page.Creatquiz
: Page for creating a quiz.Seequiz
: Page for taking a quiz.results
: Page for viewing quiz results.
Styling:
Tailwind CSS is used for styling the components.
Contributing:
- Fork the repository.
- Create a new branch for your changes.
- Make your contributions and commit them with descriptive messages.
- Push your branch to the remote repository.
- Submit a pull request for review and merging.
Acknowledgements:
- Next.js
- Tailwind CSS
- Axios
- TypeScript