Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/akashshnkr/academix


https://github.com/akashshnkr/academix

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

### Overview of the Project

The provided code is for a web application named "Academix," a Student Management System built using Flask, a micro web framework for Python. This application allows administrators to manage student records, create departments, track attendance, and perform CRUD (Create, Read, Update, Delete) operations. The technologies used include Python, Flask, MySQL, JavaScript, Jinja2, HTML5, and Bootstrap.

### Key Components and Their Functions

1. **Flask Setup:**
- The Flask application is initialized, and a secret key is set for session management.
- `SQLAlchemy` is used as the ORM (Object-Relational Mapper) to interact with the MySQL database.
- `Flask-Login` is used for user session management, including login, logout, and user access control.

2. **Database Models:**
- `Test`, `Department`, `Attendance`, `Trig`, `User`, and `Student` are the main database models representing tables in the MySQL database.
- Each model class defines the table structure and the fields within the table.

3. **Routes:**
- `index`: The home page of the application.
- `studentdetails`: Displays all student records.
- `triggers`: Displays all trigger logs.
- `department`: Allows creating and managing departments.
- `addattendance`: Allows adding attendance records for students.
- `search`: Enables searching for student records by roll number.
- `delete`: Deletes a student record (requires login).
- `edit`: Edits a student record (requires login).
- `signup`: User registration page.
- `login`: User login page.
- `logout`: Logs out the user (requires login).
- `addstudent`: Adds a new student record (requires login).
- `test`: A test route to check database connectivity.

### How It Works

1. **User Management:**
- Users can sign up and log in using the `signup` and `login` routes.
- User passwords are hashed using `werkzeug.security` for security.
- User sessions are managed using `Flask-Login`.

2. **Database Operations:**
- CRUD operations are performed using SQLAlchemy. For example, adding a student, deleting a student, and updating student details.
- The `Department`, `Attendance`, `Trig`, `User`, and `Student` models represent different aspects of the system.

3. **Templates:**
- Jinja2 templates are used to render HTML pages dynamically.
- Templates include forms for user input, such as adding students, updating records, and managing departments.

4. **Routes and Views:**
- Each route in the Flask application corresponds to a specific URL and serves a particular function.
- For example, the `/studentdetails` route retrieves all student records from the database and renders them in the `studentdetails.html` template.

5. **Session and Access Control:**
- The `@login_required` decorator ensures that certain routes can only be accessed by logged-in users.
- This helps protect sensitive operations like adding, editing, or deleting student records.

6. **Flash Messages:**
- Flash messages provide feedback to users about the success or failure of operations, such as login success, invalid credentials, or successful record updates.

### Brief Usage Explanation

- **Running the Application:**
1. Set up the virtual environment and install dependencies.
2. Configure the MySQL database and update the `SQLALCHEMY_DATABASE_URI`.
3. Run the Flask application using `flask run`.

- **Navigating the Application:**
1. Visit the home page to access different functionalities.
2. Use the signup and login routes to create an account and log in.
3. Manage student records, departments, and attendance through the respective routes.
4. Search for student records using the search functionality.
5. Perform administrative tasks like adding, editing, and deleting records.

This setup provides a comprehensive Student Management System with robust features for efficient administration.