Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

English Center Management System

A full-stack web application for managing an English language center. The system provides course browsing, student registration, online payment, email confirmation, and user account management through a clean Flask-based architecture.


Overview

The English Center Management System is designed to simplify course enrollment and administration for an English training center.

The application allows visitors to browse available courses, create accounts, enroll in classes, complete online payments through PayOS, and receive confirmation emails after successful registration.

The project follows a modular architecture based on Flask, making it easy to maintain and extend.


Main Features

Student

  • Register an account
  • Login / Logout
  • View profile
  • Browse available courses
  • View course details
  • Register for courses
  • Online payment using PayOS
  • Receive registration confirmation emails

Administration

  • Manage courses
  • Manage student information
  • Manage enrollments
  • View payment information
  • Monitor system activities

Technology Stack

Component Technology
Backend Python, Flask
ORM SQLAlchemy
Database MySQL
Authentication Flask-Login
Email Service Flask-Mail
Payment Gateway PayOS
Frontend HTML5, CSS3, JavaScript
Template Engine Jinja2

System Architecture

The application follows a lightweight MVC-style architecture.

Client Browser
       │
       ▼
Flask Routes
       │
       ▼
Business Logic
       │
       ▼
Database Access
       │
       ▼
MySQL Database

Project layers:

  • Presentation Layer
  • Business Logic Layer
  • Data Access Layer

Project Structure

English-Center
│
├── app/
│   ├── __init__.py
│   ├── dao.py
│   ├── index.py
│   ├── models.py
│   │
│   ├── routes/
│   │     └── routes.py
│   │
│   ├── services/
│   │     ├── email_service.py
│   │     └── payos_service.py
│   │
│   ├── static/
│   │     ├── css/
│   │     └── javascript/
│   │
│   └── templates/
│         ├── email/
│         └── layout/
│
├── engdb.sql
├── requirements.txt
├── LICENSE
└── README.md

Folder Description

app/

Contains the entire application source code.


app/init.py

Initializes the Flask application.

Responsibilities include:

  • Flask application configuration
  • Database connection
  • SQLAlchemy initialization
  • Login Manager configuration
  • Flask-Mail configuration
  • Loading application modules

app/models.py

Defines all database models.

Responsibilities include:

  • User model
  • Course model
  • Enrollment model
  • Relationship mapping
  • Database constraints

app/dao.py

Implements the Data Access Layer.

Responsibilities include:

  • Database queries
  • CRUD operations
  • Business data retrieval
  • SQLAlchemy interaction

Separating database operations into DAO improves maintainability and keeps routing logic clean.


app/routes/

Contains all HTTP routes.

Responsibilities include:

  • URL mapping
  • Form handling
  • User authentication
  • Course registration
  • Payment requests
  • Rendering templates

app/services/

Contains external business services.

email_service.py

Handles email functionality.

Features include:

  • Sending registration confirmation emails
  • Email template rendering
  • SMTP integration

payos_service.py

Handles communication with the PayOS payment gateway.

Responsibilities include:

  • Payment request creation
  • QR payment generation
  • Payment verification
  • Callback processing

app/static/

Contains static resources.

css/

Website stylesheets.

javascript/

Client-side JavaScript functionality.


app/templates/

Contains all Jinja2 templates.

layout/

Main web pages:

  • Home
  • Login
  • Register
  • Profile
  • Course Detail
  • Payment
  • Invoice
  • Header
  • Footer
  • Base Layout

email/

Email templates used for automated notifications.


Database

The project includes a MySQL database script:

engdb.sql

The script creates all required tables together with sample data.


Authentication

User authentication is implemented using Flask-Login.

Supported features include:

  • User Login
  • User Logout
  • Session Management
  • Protected Pages

Payment Integration

The application integrates with PayOS.

Payment workflow:

  1. User selects a course.
  2. System creates a payment request.
  3. PayOS generates a QR Code.
  4. User completes payment.
  5. Callback verifies payment.
  6. Enrollment is confirmed.

Email Notification

After successful registration or payment, the system automatically sends a confirmation email using Flask-Mail.

Email templates are located in:

app/templates/email/

Frontend

The frontend is built using:

  • HTML5
  • CSS3
  • JavaScript
  • Jinja2 Templates

Pages include:

  • Home
  • Login
  • Register
  • Profile
  • Course Detail
  • Payment
  • Invoice

Installation

Requirements

  • Python 3.x
  • MySQL
  • Git

Clone Repository

git clone <repository-url>

cd English-Center

Install Dependencies

pip install -r requirements.txt

Import Database

Create a MySQL database and import:

engdb.sql

Configure Database

Modify the database configuration inside:

app/__init__.py

Example:

SQLALCHEMY_DATABASE_URI =
mysql+pymysql://username:password@localhost/engdb

Run Application

python app/index.py

or

flask run

Application Modules

  • User Authentication
  • Course Management
  • Student Enrollment
  • Payment Processing
  • Email Notification
  • User Profile Management

Project Highlights

  • Modular Flask architecture
  • SQLAlchemy ORM
  • MVC-inspired design
  • PayOS payment integration
  • Email automation
  • Responsive HTML templates
  • MySQL relational database
  • Clean folder organization

Future Improvements

  • Admin Dashboard
  • Teacher Management
  • Attendance Tracking
  • Course Scheduling
  • JWT Authentication
  • RESTful API
  • Docker Deployment
  • CI/CD Pipeline
  • Unit Testing
  • Selenium End-to-End Testing

License

This project is licensed under the MIT License.


Author

Developed as an academic project for learning Flask web development and modern web application architecture.

About

Python Website App using Flask..

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages