How swagatika60/digital-placement-ecosystem works
Purpose and Runtime
Digital-Placement-Ecosystem is a server-rendered Flask 3 placement-preparation portal for students. It provides MCQ practice, attempt tracking, study resources, and role-restricted administration. The runnable entry point is run.py; application setup is centered in app/__init__.py and configuration in config.py.
Application Composition
The Flask app is organized as route-focused feature modules, likely registered as blueprints by the app factory:
• Public/student-facing main pages: app/main/routes.py
• Authentication and registration: app/auth/routes.py, app/auth/forms.py
• Quiz delivery and results: app/quiz/routes.py
• Administrative management: app/admin/routes.py
Responses are Jinja-rendered HTML, with shared layout and presentation assets in app/templates/base.html, app/static/css/style.css, and feature-specific template directories.
Identity and Authorization Boundary
Authentication uses Flask-Login with form validation through Flask-WTF/WTForms. The auth module establishes student accounts and login/logout behavior; subsequent student routes require an authenticated user. The admin module is a separate authorization boundary for users carrying an admin role, enabling privileged management of data and users.
Key paths: app/auth/routes.py, app/auth/forms.py, app/admin/routes.py.
Persistence Model
SQLAlchemy maps the SQLite-backed domain: users, quiz categories, multiple-choice questions, quiz results, resources, and student activity. app/models.py is the central persistence contract shared by all feature modules. The checked-in database is app/placement.db; seed_data.py initializes the default admin and sample content. Runtime configuration supports swapping SQLite for PostgreSQL through config.py.
Quiz Execution Flow
A logged-in student selects a category, starts a quiz, receives randomized questions, submits answers, and is shown a persisted result. Result and history views read the user’s attempts to provide progress tracking. This flow is implemented in app/quiz/routes.py and rendered through app/templates/quiz/categories.html, app/templates/quiz/take.html, and app/templates/quiz/result.html.
Content and Progress Flow
Main routes expose the landing page, student dashboard, and placement resources. The dashboard aggregates persisted student activity and quiz results; resources are presented as database-managed materials and may point to bundled PDFs. Relevant boundaries are app/main/routes.py, app/templates/dashboard.html, app/templates/resources.html, and app/static/pdfs/.
Administrative Content Lifecycle
Administrators manage the content that powers student experiences: categories organize quizzes, questions populate them, and resources populate study material views. Admin views also expose student/user oversight. Admin templates form the operational UI for these CRUD workflows, including app/templates/admin/dashboard.html, app/templates/admin/questions.html, and app/templates/admin/resources.html.
Deployment Surface
The primary runtime is Python 3.10+ with Flask, SQLAlchemy, Flask-Login, and Flask-WTF dependencies declared in requirements.txt. SQLite is the default local datastore; PostgreSQL is an intended production alternative. vercel.json supplies a deployment-specific integration surface, while application secrets and database URI are controlled by config.py.
Main entry points: __init__.py Flask app factory · models.py Domain models · main/routes.py Dashboard & resources · auth/routes.py Authentication
Components 17
Runtime
- Application entry
run.py - Flask app factory · Registers feature blueprints and application extensions.
app/__init__.py - Runtime configuration · Selects SQLite by default or PostgreSQL by URI.
config.py - Shared page layout
app/templates/base.html - Vercel integration
vercel.json
Student Experience
- Authentication · Registration, login/logout, and authenticated-user access.
app/auth/routes.py - Auth forms
app/auth/forms.py - Dashboard & resources · Serves public pages, student dashboard, and resource views.
app/main/routes.py - Quiz delivery · Randomizes questions, records submissions, and shows results/history.
app/quiz/routes.py - Student templates
app/templates/dashboard.html - Quiz templates · Category selection, quiz-taking, and result pages.
app/templates/quiz/take.html
Administration
- Admin management · Role-restricted CRUD and user oversight.
app/admin/routes.py - Admin templates · Operational dashboards and content-management screens.
app/templates/admin/dashboard.html
Data & Content
- Domain models · Defines users, categories, questions, results, resources, and activity.
app/models.py - Placement database · SQLite is checked in locally; PostgreSQL is supported for production.
app/placement.db - Seed content · Creates the default admin and sample content.
seed_data.py - Bundled study PDFs
Connections 22
- Application entry → Flask app factory: starts
- Flask app factory → Runtime configuration: loads
- Flask app factory → Authentication: registers
- Flask app factory → Dashboard & resources: registers
- Flask app factory → Quiz delivery: registers
- Flask app factory → Admin management: registers
- Authentication → Auth forms: validates with
- Authentication → Domain models: creates and authenticates users
- Dashboard & resources → Domain models: reads progress and resources
- Quiz delivery → Domain models: reads questions and persists attempts
- Admin management → Domain models: manages users and content
- Domain models → Placement database: maps to
- Runtime configuration → Placement database: configures connection
- Seed content → Domain models: initializes
- Dashboard & resources → Student templates: renders
- Quiz delivery → Quiz templates: renders
- Admin management → Admin templates: renders
- Student templates → Shared page layout: extends
- Quiz templates → Shared page layout: extends
- Admin templates → Shared page layout: extends
- Dashboard & resources → Bundled study PDFs: exposes linked materials
- Vercel integration → Application entry: deploys