How bcstudentsoftwaredevteam/celts works
Based on our analysis, CELTS is a Flask-based web application designed to manage programs (primarily CELTS programs) using an MVC-like structure. The project organizes its code into controllers, business logic, data models, templates, and static assets. It also utilizes a MySQL database and includes a robust testing suite with continuous integration via GitHub Actions, along with development support using VSCode devcontainers.
Main Components
• Web Server & Application Layer:
• Flask application – include the WSGI entry point (app.wsgi and run.py).
• “app” directory that further divides into:
▪ Controllers: With subdirectories for admin, events, main, minor, and serviceLearning. These handle HTTP requests and routing.
▪ Business Logic: The “app/logic” directory encapsulates business rules such as login management, event processing, file handling, and email management.
▪ Data Models: The “app/models” directory contains all ORM models for interfacing with the MySQL database and supporting migrations.
▪ Templates & Static Assets: Show the “app/templates” and “app/static” folders that serve the user interface (HTML, CSS, JavaScript, images, and files).
• Database:
• The MySQL database is central to persisting application data. Include migration and reset scripts from the “database” directory (with Peewee migrations in mind).
• Development/Dev Container:
• Development environment provided by the .devcontainer folder, including Dockerfiles and docker-compose, which help standardize the development setup.
• Testing and CI/CD:
• Testing framework (pytest) along with the “tests” directory (unit tests, UI tests, and test data).
• Integrate a block for GitHub Actions (from .github/workflows) that automatically runs tests on pushes and pull requests.
Relationships and Interactions
• Incoming HTTP requests hit the Flask application's controllers.
• Controllers invoke the business logic (in app/logic) to process requests.
• Business logic interacts with the data models to perform CRUD operations on the MySQL database.
• The templating engine (Jinja2) renders views using files from “app/templates” and static content from “app/static”.
• An external dependency such as the email handler (using Gmail or slack) that the business logic communicates with for notifications.
Architectural Patterns and Technologies
• MVC-Like Pattern: Clearly separate Controllers, Models, and Views.
• Use of Peewee Migrations: Note how the project updates its database schema.
• Database connectivity details – for example, MySQL configuration sourced from YAML files in “app/config”.