A full-stack Flask web application for course enrollment with user authentication, MongoDB-backed data models, REST APIs with Swagger docs, and a fully containerized Docker Compose setup.
Make sure Docker is installed, then run:
make runThe app will be available at http://localhost:5000. The Swagger API docs are at http://localhost:5000/api/v1/docs.
To tear everything down:
make cleanOther useful commands:
| Command | Description |
|---|---|
make setup |
Generate .env with a random SECRET_KEY (first-time setup) |
make run |
Build and start all containers |
make test |
Run the test suite inside the Flask container |
make seed |
Re-seed the database with course data |
make lint |
Run linters via pre-commit |
make clean |
Tear down containers and volumes |
See CONTRIBUTING.md for environment setup, linting, Postman, and other developer instructions.
This repo includes an automated UI walkthrough test: e2e/ui-walkthrough.spec.js.
Quick run (Docker-only, no local npm install needed):
docker compose up -d --build
docker compose run --rm e2e-testsEquivalent Make command:
make e2e-dockerLocal Playwright run (if you want to run from host machine):
npm install
npx playwright install chromium
docker compose up -d --build
npm run e2e:walkthroughFor full details, see TESTING.md.
- User registration & login — session-based auth with hashed passwords (Werkzeug)
- Course catalog — browse courses pulled from MongoDB, filterable by term
- Course enrollment — enroll in courses with duplicate-enrollment protection, CSRF-protected form
- Enrollment dashboard — view your enrolled courses via MongoDB aggregation
- REST API — authenticated course endpoints at
/api/v1/courseswith Swagger UI docs (flask-restx) - Dockerized stack — Flask, MongoDB, and seed data orchestrated via Docker Compose
- CI/CD — GitHub Actions workflows with pre-commit linting (flake8, markdownlint)
Please see the testing documentation that showcases an end-to-end demo of features supported.
The app runs as three Docker Compose services:
| Service | Description |
|---|---|
| course-enrollment-app | Python/Flask web server on port 5000 |
| mongodb | MongoDB 8.2 database with persistent volume |
| mongo-seed | One-shot container that imports course data on first run |
Browser :5000 ──► course-enrollment-app ──► mongodb :27017
▲
mongo-seed
(imports courses.json)
The Flask app follows a single-module structure under application/.
This project was originally based on the LinkedIn Learning course "Full Stack Web Development with Flask". It has since been extended with Docker containerization, CI/CD pipelines, rebranded course data, and additional tooling.
