A real-time collaborative platform for remote education, featuring interactive whiteboards, live quizzes, AI-powered question generation, and real-time communication.
- π¨ Interactive Whiteboard: Real-time collaborative drawing and annotation
- π§ AI Quiz Generation: Generate questions using OpenAI GPT models
- π Live Quizzes: Interactive quizzes with instant feedback
- π¬ Real-time Chat: Live messaging during sessions
- π₯ Video Conferencing: WebRTC-based video calls
- π₯ Role-based Access: Separate interfaces for teachers and students
- π JWT Authentication: Secure user authentication
- π± Responsive Design: Works on desktop and mobile devices
- Backend: FastAPI (Python)
- Frontend: React + Vite
- Database: PostgreSQL
- Real-time: WebSocket
- AI: OpenAI GPT-3.5-turbo
- Containerization: Docker & Docker Compose
- Authentication: JWT with bcrypt
- Docker and Docker Compose
- Git
git clone <your-repository-url>
cd codeCrew# Copy the example environment file
cp env.example .env
# Edit the .env file with your values
# You'll need to set at least:
# - POSTGRES_PASSWORD (your database password)
# - SECRET_KEY (generate with: openssl rand -hex 32)
# - OPENAI_API_KEY (optional, for AI features)# Generate a secure secret key for JWT
openssl rand -hex 32
# Copy the output to SECRET_KEY in your .env file# 1. Remove all the previous running instances of docker containers
docker-compose down -v --rmi all
# 2. Build everything fresh
docker-compose build --no-cache
# 3. Start all services
docker-compose up -d
# 4. Check status
docker-compose ps
# 5. View logs
docker-compose logs -f- Frontend: http://localhost:5173
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
The application uses the following environment variables (see env.example for all options):
| Variable | Description | Required | Default |
|---|---|---|---|
POSTGRES_PASSWORD |
Database password | Yes | - |
SECRET_KEY |
JWT secret key | Yes | - |
OPENAI_API_KEY |
OpenAI API key for AI features | No | - |
VITE_API_URL |
Frontend API URL | No | http://localhost:8000 |
DEBUG |
Debug mode | No | false |
.env file to paste inside frontend, backend, and codeCrew folder
table plus: to view database
| Service | Port | Description |
|---|---|---|
| Frontend | 5173 | React development server |
| Backend | 8000 | FastAPI server |
| Database | 5432 | PostgreSQL database |
- Sign Up: Create a teacher account
- Create Classes: Set up your classes
- Add Students: Invite students to your classes
- Start Sessions: Create live, quiz, or whiteboard sessions
- Use AI Features: Generate quiz questions with AI
- Sign Up: Create a student account
- Join Classes: Enter class codes provided by teachers
- Participate: Join live sessions and take quizzes
- Collaborate: Use the whiteboard and chat features
The platform includes AI-powered quiz generation:
- Subjects: Science, Math, English, History, Geography
- Difficulty Levels: Easy, Medium, Hard
- Grade Levels: Primary, Middle, High School
- Custom Topics: Specify topics for targeted questions
To enable AI features:
- Get an OpenAI API key from OpenAI Platform
- Add it to your
.envfile asOPENAI_API_KEY
# Start all services
docker-compose up -d
# Stop all services
docker-compose down
# View logs
docker-compose logs -f
# Rebuild services
docker-compose build
# Reset database (removes all data)
docker-compose down -v
docker-compose up -d-
Port Already in Use
# Check what's using the port lsof -i :5173 # or :8000, :5432 # Change ports in .env file FRONTEND_PORT=3000 BACKEND_PORT=8001
-
Database Connection Issues
# Check if database is running docker-compose ps # View database logs docker-compose logs db
-
AI Features Not Working
- Ensure
OPENAI_API_KEYis set in.env - Check your OpenAI account has credits
- Verify the API key is valid
- Ensure
-
Frontend Can't Connect to Backend
- Check
VITE_API_URLin.env - Ensure backend is running on the correct port
- Check CORS settings
- Check
# Check service status
docker-compose ps
# View specific service logs
docker-compose logs backend
docker-compose logs frontend
docker-compose logs db
# Access database directly
docker-compose exec db psql -U postgres -d codecrew
# Restart a specific service
docker-compose restart backendOnce the application is running, visit:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
- All passwords are hashed using bcrypt
- JWT tokens for authentication
- Environment variables for sensitive data
- CORS protection enabled
- Input validation on all endpoints
- SQL injection protection through SQLAlchemy
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License.
If you encounter any issues:
- Check the troubleshooting section above
- View the logs:
docker-compose logs -f - Check the API documentation: http://localhost:8000/docs
- Create an issue in the repository
Happy Coding! π