A web application for generating quizzes from documents using AI.
- Node.js (v18 or higher)
- Python (v3.8 or higher)
- PM2 (for process management)
- PostgreSQL (for database)
Note: All commands should be run from the project root directory (
quiz_app/)
- Clone the repository:
git clone <repository-url>
cd quiz_app- Install Node.js dependencies:
npm install- Set up Python virtual environment and install dependencies:
# Create virtual environment
python3 -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
# Install Python dependencies
pip install -r scripts/requirements.txt
# Deactivate virtual environment when done
deactivate- Set up environment variables:
cp .env.example .envEdit .env with your configuration.
- Set up the database:
npx prisma migrate dev
npx prisma generate
npx prisma db seed- Start the Next.js development server:
npm run dev- Start the Python backend server:
# Activate virtual environment first
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
# Start the server
python backend/server.py
# Deactivate when done
deactivate- Build the Next.js application:
npm run build- Start the application using PM2:
# Start Next.js server
pm2 start npm --name "quiz-app" -- start
# Start Python backend (make sure to use the virtual environment's Python)
pm2 start venv/bin/python --name "quiz-backend" -- backend/server.py
# Monitor the processes
pm2 monit
# View logs
pm2 logs
# Stop the application
pm2 stop all# Reset database and run seed
npx prisma migrate reset --force
# Generate Prisma client
npx prisma generate
# View database
npx prisma studionpm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpm run format- Format code with Prettier
quiz_app/
├── app/ # Next.js app directory
├── components/ # React components
├── lib/ # Utility functions
├── prisma/ # Database schema and migrations
├── public/ # Static files
├── backend/ # Python backend
├── venv/ # Python virtual environment
└── types/ # TypeScript type definitions
Required environment variables:
DATABASE_URL- PostgreSQL connection stringNEXT_PUBLIC_API_URL- API endpoint URLPYTHON_PATH- Path to Python executableSTORAGE_PATH- Path for file storage
- Create a new branch
- Make your changes
- Submit a pull request
MIT