A full-stack course management web application built with Flask, PostgreSQL, and SQLAlchemy.
The project provides separate functionality for students, teachers, and administrators, including authentication, course management, enrollment, and an admin dashboard.
- User registration
- Secure password hashing
- User login/logout
- Session-based authentication
- Browse available courses
- Enroll in courses
- View enrolled courses
- Access course pages
- Create new courses
- Edit owned courses
- Delete owned courses
- Upload course thumbnails
- Access admin dashboard
- Manage all courses regardless of ownership
- Python 3
- Flask
- SQLAlchemy ORM
- PostgreSQL
- Jinja2
- HTML5
- CSS3
- Werkzeug Security
- Alembic (Database Migrations)
FlaskProject/
│
├── app.py
├── database.py
├── models.py
├── requirements.txt
│
├── templates/
│ ├── login.html
│ ├── register.html
│ ├── courses.html
│ ├── add_course.html
│ ├── edit_course.html
│ └── admin.html
│
├── static/
│ ├── images/
│ ├── courses.css
│ ├── login.css
│ ├── register.css
│ ├── add_course.css
│ └── edit_course.css
Clone the repository:
git clone https://github.com/AsilbekKha/course_platformflask.git
cd course_platformflaskCreate a virtual environment:
python -m venv .venvActivate it.
Linux/macOS:
source .venv/bin/activateWindows:
.venv\Scripts\activateBefore running the application, make sure you have:
Python 3.12 or newer PostgreSQL 15 or newer Git Database Setup
Create a PostgreSQL database:
CREATE DATABASE course_management;
Alternatively, from the terminal:
createdb course_management
Configure your database connection in a .env file:
DATABASE_URL=postgresql://username:password@localhost/course_management SECRET_KEY=your_secret_key Install Dependencies pip install -r requirements.txt Run the Application flask run
The application will automatically create the required database tables on first launch.
User Roles
Newly registered users are assigned the Student role by default.
To test teacher or administrator functionality, promote an account manually using PostgreSQL.
Make a user a teacher:
UPDATE users SET role = 'teacher' WHERE username = 'your_username';
Make a user an administrator:
UPDATE users SET role = 'admin' WHERE username = 'your_username';
- User authentication
- Session management
- Teacher-only course creation
- Teacher-only course editing
- Teacher-only course deletion
- Student enrollment
- Course thumbnails
- Administrator panel
- PostgreSQL database integration
- Course materials and file uploads
- Search functionality
- Categories and tags
- Teacher qualification requests
- Student progress tracking
- Responsive mobile interface
- Profile management
This project was created as a personal educational and portfolio project.