ProjectGenius is a comprehensive AI-powered education platform that provides structured learning through courses, interactive quizzes, assignments, and achievement systems. Built to support UN Sustainable Development Goal 4: Quality Education, ProjectGenius makes quality education accessible, engaging, and effective for learners worldwide.
- Comprehensive Course System: Structured courses with modules, lessons, and progress tracking
- Interactive Quizzes: Auto-graded quizzes with multiple question types and instant feedback
- Assignment Management: File uploads, group assignments, and instructor grading system
- Achievement System: Gamified learning with badges and progress rewards
- Real-time Progress Tracking: Detailed analytics and learning insights
- Secure Authentication: Password-based authentication with bcrypt hashing
- Role-based Access: Student and instructor roles with appropriate permissions
- User Profiles: Customizable profiles with learning history and achievements
- Dashboard: Personalized learning dashboard with activity tracking
- Course Reviews & Ratings: Student feedback and course recommendation system
- Group Learning: Collaborative assignments and study groups
- Announcements: Course-specific announcements and notifications
- Analytics Dashboard: Comprehensive learning analytics for students and instructors
- RESTful API: Complete API for mobile app integration and third-party services
- Flask - Modern Python web framework with application factory pattern
- SQLAlchemy - Advanced ORM with relationship mapping and migrations
- Flask-Migrate - Database version control and schema management
- PostgreSQL/SQLite - Robust database support for development and production
- Bcrypt - Secure password hashing and authentication
- Flask-WTF - Form handling with CSRF protection
- Jinja2 Templates - Dynamic HTML generation with template inheritance
- Bootstrap 5 - Responsive UI framework with modern design
- JavaScript (Vanilla) - Interactive functionality and AJAX requests
- Font Awesome - Comprehensive icon library
- Chart.js - Data visualization for analytics dashboards
- Click - Command-line interface for database management
- Python-dotenv - Environment variable management
- Gunicorn - Production WSGI HTTP server
- Redis - Caching and session storage (optional)
ProjectGenius/
โโโ projectgenius/ # Main application package
โ โโโ __init__.py # Application factory
โ โโโ models.py # Database models
โ โโโ utils.py # Utility functions
โ โ
โ โโโ auth/ # Authentication module
โ โ โโโ __init__.py
โ โ โโโ routes.py # Auth routes (login, register, logout)
โ โ โโโ forms.py # Authentication forms
โ โ โโโ templates/ # Auth-specific templates
โ โ
โ โโโ core/ # Core application routes
โ โ โโโ __init__.py
โ โ โโโ routes.py # Main routes (home, dashboard, courses)
โ โ โโโ cli.py # CLI commands
โ โ โโโ errors.py # Error handlers
โ โ โโโ config/ # Configuration management
โ โ
โ โโโ api/ # RESTful API endpoints
โ โ โโโ __init__.py
โ โ โโโ courses.py # Course API
โ โ โโโ quizzes.py # Quiz API
โ โ โโโ assignments.py # Assignment API
โ โ โโโ users.py # User API
โ โ
โ โโโ courses/ # Course-related models
โ โ โโโ models.py # Course, Module, Lesson models
โ โ โโโ __init__.py
โ โ
โ โโโ quizzes/ # Quiz system models
โ โ โโโ models.py # Quiz, Question, Attempt models
โ โ โโโ __init__.py
โ โ
โ โโโ assignments/ # Assignment system models
โ โ โโโ models.py # Assignment, Submission models
โ โ โโโ __init__.py
โ โ
โ โโโ templates/ # HTML templates
โ โโโ base.html # Base template
โ โโโ index.html # Home page
โ โโโ auth/ # Authentication templates
โ โโโ dashboard/ # Dashboard templates
โ โโโ courses/ # Course templates
โ โโโ errors/ # Error page templates
โ
โโโ static/ # Static assets
โ โโโ css/ # Stylesheets
โ โโโ js/ # JavaScript files
โ โโโ images/ # Images and media
โ
โโโ tests/ # Test suite
โ โโโ __init__.py
โ โโโ conftest.py # Test configuration
โ โโโ test_auth.py # Authentication tests
โ โโโ test_courses.py # Course functionality tests
โ โโโ test_api.py # API endpoint tests
โ
โโโ migrations/ # Database migrations
โโโ instance/ # Instance-specific files
โโโ logs/ # Application logs
โ
โโโ main.py # Application entry point
โโโ wsgi.py # Production WSGI entry point
โโโ requirements.txt # Python dependencies
โโโ .env.example # Environment variables template
โโโ .gitignore # Git ignore rules
โโโ README.md # Project documentation
- Python 3.11 or higher
- PostgreSQL 13+ (or SQLite for development)
- Redis (optional, for caching and sessions)
- Modern web browser
-
Clone the Repository
git clone https://github.com/yourusername/projectgenius.git cd ProjectGenius -
Create Virtual Environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Dependencies
pip install -r requirements.txt
-
Environment Setup
cp .env.example .env # Edit .env file with your configuration -
Database Setup
# Initialize database flask init-db # Create database migrations flask db init flask db migrate -m "Initial migration" flask db upgrade
-
Create Admin User
flask create-admin # Follow the prompts to create an admin account -
Seed Demo Data (Optional)
flask seed-data --demo
-
Run the Application
# Development server python main.py # Or using Flask CLI flask run --host=0.0.0.0 --port=5000
-
Access the Application Open your browser and navigate to
http://localhost:5000
Create a .env file in the root directory with the following variables:
# Basic Configuration
FLASK_ENV=development
SECRET_KEY=your-super-secret-key-here
DATABASE_URL=sqlite:///projectgenius.db
# For PostgreSQL
# DATABASE_URL=postgresql://username:password@localhost/projectgenius
# Security
JWT_SECRET_KEY=your-jwt-secret-key
BCRYPT_LOG_ROUNDS=12
# File Uploads
UPLOAD_FOLDER=instance/uploads
MAX_CONTENT_LENGTH=16777216
# Optional: Redis for caching
REDIS_URL=redis://localhost:6379/0
# Email Configuration (for notifications)
MAIL_SERVER=smtp.gmail.com
MAIL_PORT=587
MAIL_USE_TLS=True
MAIL_USERNAME=your-email@gmail.com
MAIL_PASSWORD=your-app-passwordThe application supports both SQLite (for development) and PostgreSQL (for production):
SQLite (Development):
DATABASE_URL=sqlite:///projectgenius.dbPostgreSQL (Production):
DATABASE_URL=postgresql://user:password@localhost/projectgeniusThe application provides a comprehensive RESTful API for all major operations:
POST /auth/login- User loginPOST /auth/register- User registrationPOST /auth/logout- User logoutGET /auth/check- Check authentication status
GET /api/v1/courses- List all coursesGET /api/v1/courses/{id}- Get course detailsPOST /api/v1/courses- Create new course (instructor only)PUT /api/v1/courses/{id}- Update course (instructor only)POST /api/v1/courses/{id}/enroll- Enroll in course
GET /api/v1/quizzes- List available quizzesPOST /api/v1/quizzes/{id}/start- Start quiz attemptPOST /api/v1/quizzes/attempts/{id}/submit- Submit quiz answersGET /api/v1/quizzes/attempts/{id}/results- Get quiz results
GET /api/v1/assignments- List assignmentsPOST /api/v1/assignments/{id}/submit- Submit assignmentPOST /api/v1/assignments/submissions/{id}/grade- Grade submission (instructor only)
import requests
# Login first
login_response = requests.post('/auth/login', json={
'username': 'instructor',
'password': 'password'
})
# Create course
course_data = {
'title': 'Introduction to Python',
'description': 'Learn Python programming from basics',
'level': 'Beginner',
'category': 'Programming',
'duration_weeks': 8,
'price': 0.0
}
response = requests.post('/api/v1/courses', json=course_data)# Enroll in course
response = requests.post(f'/api/v1/courses/{course_id}/enroll')# Start quiz attempt
start_response = requests.post(f'/api/v1/quizzes/{quiz_id}/start')
attempt_id = start_response.json()['attempt_id']
# Submit answers
answers = {
'responses': [
{'question_id': 1, 'answer': 'A programming language'},
{'question_id': 2, 'answer': 'True'}
]
}
submit_response = requests.post(f'/api/v1/quizzes/attempts/{attempt_id}/submit', json=answers)Run the test suite:
# Run all tests
pytest
# Run with coverage
pytest --cov=projectgenius
# Run specific test file
pytest tests/test_auth.py
# Run with verbose output
pytest -v- Unit Tests: Test individual functions and methods
- Integration Tests: Test component interactions
- API Tests: Test RESTful API endpoints
- Database Tests: Test database operations and models
# Install Gunicorn
pip install gunicorn
# Run with Gunicorn
gunicorn -w 4 -b 0.0.0.0:8000 wsgi:app
# With configuration file
gunicorn -c gunicorn.conf.py wsgi:appFor production, ensure these environment variables are set:
FLASK_ENV=production
DEBUG=False
SQLALCHEMY_ECHO=False
SECRET_KEY=your-production-secret-key
DATABASE_URL=postgresql://user:pass@host/db# Apply migrations
flask db upgrade
# Create admin user
flask create-admin
# Set up monitoring
flask statsThe application includes comprehensive monitoring and analytics:
- User Analytics: Track user engagement, course completion rates
- Course Analytics: Monitor course performance, student feedback
- System Health: Database performance, API response times
- Learning Analytics: Progress tracking, achievement statistics
Access analytics through:
- Admin Dashboard:
/admin/analytics - API Endpoints:
/api/v1/analytics/* - CLI Commands:
flask stats
We welcome contributions! Please follow these steps:
- Fork the Repository
- Create Feature Branch:
git checkout -b feature/amazing-feature - Make Changes: Implement your feature or fix
- Add Tests: Ensure your changes are tested
- Run Tests:
pytest - Commit Changes:
git commit -m 'Add amazing feature' - Push to Branch:
git push origin feature/amazing-feature - Open Pull Request
- Code Style: Follow PEP 8 standards
- Testing: Maintain >90% test coverage
- Documentation: Update docs for new features
- Security: Follow security best practices
- Performance: Consider performance implications
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: https://projectgenius.dev/docs
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: support@projectgenius.dev
- UN SDG 4: Inspired by the goal of Quality Education for all
- Flask Community: For the excellent web framework
- Bootstrap Team: For the responsive UI framework
- Font Awesome: For the comprehensive icon library
- Contributors: All developers who have contributed to this project
- Mobile application (React Native)
- Video lessons and live streaming
- Advanced AI features for personalized learning
- Blockchain certificates and credentials
- Multi-language support
- Social learning features
- Marketplace for course creators
- Advanced analytics and reporting
- Integration with external LMS systems
ProjectGenius - Empowering education through technology ๐โจ
Built with โค๏ธ for learners worldwide