A course enrollment platform I built with Flask and SQLite. Students can sign up, browse courses, and enroll, while admins get a dashboard that shows enrollment stats and forecasts what enrollments might look like over the next 30 days using polynomial regression.
- Users can register, log in, and enroll in courses
- Admins get a separate dashboard with:
- Total users, courses, and enrollments at a glance
- Recent enrollment activity
- A 30-day enrollment forecast chart (built with scikit-learn)
- There's also a small API endpoint (
/api/forecast_data) that returns the forecast as JSON
- Flask (Python)
- SQLite
- pandas + NumPy for data handling
- scikit-learn for the forecasting model
- Werkzeug for password hashing
git clone https://github.com/Chandana3026/Forecasting-Online-Course-Enrollments.git
cd Forecasting-Online-Course-Enrollments
pip install flask pandas numpy scikit-learn werkzeug
python app.pyThe first time you run it, it sets up the database automatically — creates an admin account, adds a few sample courses, and generates a year's worth of sample enrollment data so the forecast has something to work with.
- Username:
admin - Password:
admin123
(Obviously don't leave this as-is if you ever deploy it somewhere real.)
It groups enrollments by date, fits a degree-2 polynomial regression to the data to catch any trends or seasonal patterns, then projects that forward 30 days. Predictions are capped at zero so it doesn't forecast negative enrollments.
| Route | What it does |
|---|---|
/ |
Home page |
/register, /login, /logout |
Auth |
/user_dashboard |
Browse and enroll in courses |
/admin_dashboard |
Admin stats + forecast |
/enroll/<course_id> |
Enroll in a course |
/api/forecast_data |
Forecast data as JSON (admin only) |
This was built as a learning project, so a few things aren't production-ready — like the hardcoded secret key in app.py. If you were deploying this for real, you'd want to move that to an environment variable and not commit the database file.