0% found this document useful (0 votes)
30 views53 pages

Academy Nexus Report

The document describes an educational institution management system called Academy Nexus. It discusses the system's objectives like user authentication, student information management, attendance tracking and notifications. It also outlines the technologies used to develop the system including languages, frameworks and databases.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views53 pages

Academy Nexus Report

The document describes an educational institution management system called Academy Nexus. It discusses the system's objectives like user authentication, student information management, attendance tracking and notifications. It also outlines the technologies used to develop the system including languages, frameworks and databases.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 53

1.

INTRODUCTION

1.1 About Academy Nexus:

Overview:
Academy Nexus is a web-based application developed to streamline the
administrative tasks associated with managing student information in educational
institutions. It serves as a comprehensive platform for storing, organizing, and
accessing student-related data, facilitating efficient communication, and automating
routine administrative processes.

Purpose:
The primary purpose of Academy Nexus is to address the challenges faced by
educational institutions in managing student information effectively. By providing a
centralized repository for student data and implementing features such as attendance
tracking, event management, and communication tools, the system aims to enhance
operational efficiency, improve data accuracy, and foster collaboration among
stakeholders.

1.2 Objectives

• User Authentication and Authorization: Implementing user authentication


mechanisms to ensure secure access to the system. Different levels of access are
provided based on user roles, such as administrators and regular users.
• Student Information Management: Facilitating the storage and management of
student details, including personal information, contact details, academic records, and
demographic information.
• Attendance Management: Automating the process of recording student attendance
and generating reports to track attendance trends. This feature helps educators monitor
student attendance efficiently.
• Triggers and Notifications: Implementing triggers to capture specific events or
actions within the system, such as student registration or event creation. Notifications
are sent to relevant stakeholders to keep them informed.
• User Management: Administrators can manage user accounts, assign roles, and revoke
access if necessary. This feature ensures proper administration of the system.

[1]
• Email Integration: Integrating email functionality to send notifications, reminders,
and updates to users. Email serves as an effective communication channel within the
system.

1.3 Software Requirements Specification

1.3.1 Hardware Requirements:


This section gives the details and specification of the hardware on which the
system is expected to work.

❖ PROCESSOR : 1.1 GHz or faster Processor(Intel Celeron N4500)


❖ RAM : Minimum 2GB of RAM or More
❖ MONITOR : 1366 × 768 or higher-resolution display
❖ HARD DISK : 80 GB
❖ KEYBOARD : Standard 102-Key Keyboard
❖ MOUSE : LOGI TECH (3 Buttons)

1.3.2 Software Requirements:


This section gives the details of the software that are used for the development.

❖ OPERATING SYSTEM : Windows 10


❖ ENVIRONMENT : Visual Studio Code
❖ FRONT END : HTML,CSS,JS
❖ VS CODE FRAMEWORK : Version 1.87
❖ LANGUAGE : Python
❖ BACK END : XAMPP (MySQL)
❖ INTERNET : Yes (Normal Speed)

[2]
2. TECHNOLOGIES USED

2.1 Development Stack:


Academy Nexus is developed using a combination of front-end and back-end
technologies, chosen for their versatility, compatibility, and robust feature sets.

2.2 Front-end Technologies:

• HTML (Hypertext Mark-up Language):


HTML forms the backbone of the project's front-end structure, providing the
foundation for creating web pages and organizing content.

• CSS (Cascading Style Sheets):


CSS is utilized for styling and formatting HTML elements, ensuring a visually
appealing and cohesive user interface across the application.

• JavaScript (JS):
JavaScript is employed to add interactivity and dynamic behaviour to web pages,
enhancing user experience through features such as form validation and event handling.

• jQuery:
jQuery, a fast and concise JavaScript library, is leveraged for simplifying DOM
manipulation, handling events, and executing AJAX requests, thereby streamlining front-
end development.

• Bootstrap 5:
Bootstrap 5, a popular front-end framework, is integrated into the project to
expedite the development process and ensure responsiveness and consistency in design. It
provides a plethora of pre-designed components, layouts, and utilities for building modern
web applications.

[3]
2.3 Back-end Technologies:

• Python:
Python serves as the primary programming language for developing the back-end
logic of Academy Nexus. Its simplicity, readability, and extensive ecosystem make it well-
suited for web development.

• Flask:
Flask, a lightweight and flexible Python web framework, is employed for building
the back-end infrastructure of the application. It facilitates rapid development, URL
routing, request handling, and integration with various third-party libraries.

• Flask_SQLAlchemy:
Flask_SQLAlchemy is utilized for database management, providing an intuitive
interface for interacting with relational databases within the Flask application. It simplifies
database operations such as querying, data manipulation, and ORM (Object-Relational
Mapping) implementation.

• Flask_Login:
Flask_Login is employed for user authentication and session management within
the application. It offers features for user login, logout, authentication checks, and access
control, ensuring secure access to protected routes.

• Flask_Mail:
Flask_Mail is integrated into the project for email functionality, enabling the
application to send notifications, alerts, and user communications via email. It streamlines
communication channels and enhances user engagement.

[4]
• Matplotlib:
Matplotlib is utilized for data visualization and generating plots within the backend
of the application. It enables the creation of various types of plots and charts to visualize
data trends and insights.

• MySQL:
MySQL is utilized as the relational database management system (RDBMS) for
storing and managing data within Academy Nexus. It offers robust features for efficient
data storage, retrieval, and manipulation, ensuring scalability and reliability for the
application's backend.

[5]
3. SYSTEM ARCHITECTURE

3.1 Overview:
The system architecture of our Flask application defines the arrangement of
components, interactions, and data flow within the application. It encompasses both the
frontend and backend components, detailing how they work together to fulfil the application's
functionality.

3.2 High-Level Architecture Diagram:

[6]
3.3 Interactions:
In this section, we'll explore the interactions within our Flask application, focusing on
how different components communicate and collaborate to fulfill user requests and process
data.

Frontend-Backend Interaction:

HTTP Requests Handling:


The frontend of our application communicates with the backend using
HTTP requests. These requests are initiated by users interacting with the user
interface, such as submitting forms or clicking on links. In Flask, we define
routes (URL endpoints) to handle different types of requests.

Form Submission:
When a user submits a form on the frontend, the data is sent to the
backend as part of an HTTP request. In Flask, we use route decorators to specify
functions that handle these requests. These functions extract form data from the
request object and perform necessary actions, such as validating inputs,
processing data, and generating responses.

AJAX Requests:
To enhance user experience and make the application more dynamic, we
utilize AJAX (Asynchronous JavaScript and XML) for making asynchronous
requests to the server without reloading the entire page. AJAX requests are
commonly used for fetching data from the server, submitting form data in the
background, or updating parts of the page dynamically. In Flask, we handle
AJAX requests similarly to regular HTTP requests but may return JSON
responses for better compatibility with JavaScript on the frontend.

[7]
Database Interaction:

CRUD Operations:
Our Flask application interacts with the database to perform CRUD (Create,
Read, Update, and Delete) operations on data. These operations allow users to create
new records, retrieve existing data, update records, and delete records when necessary.
We use Flask-SQLAlchemy, an Object-Relational Mapping (ORM) library, to abstract
away the complexities of SQL queries and interact with the database using Python
objects.

Querying Data:
When handling user requests that require data from the database, such as
displaying student details or calculating attendance, we use SQLAlchemy queries to
retrieve the relevant data. These queries are constructed based on user inputs or
application logic and executed against the database to fetch the required information.

3.4 Data Flow:

Request Flow:

1. User Interaction:
• User initiates an interaction with the application by accessing the
frontend interface via a web browser.
2. HTTP Request:
• When a user performs an action (e.g., submitting a form, clicking a
button), an HTTP request is generated and sent to the Flask server.
3. Flask Route Handling:
• The Flask application receives the HTTP request and routes it to the
appropriate endpoint (route) based on the URL and request method
(GET, POST, etc.).
• Flask routes are defined in the application code, specifying the URL
endpoint and the corresponding function to handle the request.

[8]
4. Request Processing:
• The Flask route function processes the incoming request, extracting any
relevant data submitted by the user (e.g., form data, query parameters).
• Depending on the nature of the request, the route function may perform
various operations such as querying the database, updating records, or
generating a response.
5. Business Logic Execution:
• If necessary, the route function executes business logic to perform
additional operations on the data or apply specific rules and constraints.
6. Response Generation:
• Once the request has been processed and any necessary operations have
been performed, the route function generates an HTTP response.
• The response typically includes data to be displayed to the user (e.g.,
HTML content, JSON data) and may also include status codes, headers,
and cookies.
7. HTTP Response:
• The generated HTTP response is sent back to the user's web browser, where
it is rendered and displayed as a web page or processed by the client-side
JavaScript code.

Database Interaction Flow:

1. Data Retrieval:
• When the application needs to retrieve data from the database (e.g., fetching
student records, querying attendance data), it sends a SQL query to the database
server.

2. Database Query Execution:


• The database server executes the SQL query against the database tables,
retrieving the requested data based on the specified criteria.

3. Data Processing:
• The retrieved data is processed by the Flask application, which may involve
formatting, filtering, or aggregating the data as needed.

[9]
4. Response Generation:
• The processed data is incorporated into the HTTP response generated by the
Flask route function, which may include rendering HTML templates or
serializing data into JSON format for AJAX requests.

5. HTTP Response:
• The HTTP response containing the processed data is sent back to the user's web
browser, where it is displayed or processed further as required.

Error Handling:

1. Exception Handling:
• Throughout the data flow process, the Flask application includes mechanisms
for handling errors and exceptions that may occur.
• Exception handling ensures that the application gracefully handles unexpected
errors, preventing crashes and providing informative error messages to users.

2. Error Responses:
• When an error occurs during request processing or database interaction, the
Flask application generates an appropriate error response, which may include
an error status code (e.g., 404 for not found, 500 for internal server error) and a
message describing the error.
3. Logging:
• The application logs error messages and exceptions to facilitate debugging and
troubleshooting. Logged information includes details such as the timestamp, the
nature of the error, and the context in which it occurred.

Security Considerations:

1. Input Validation:
• To prevent security vulnerabilities such as SQL injection and cross-site
scripting (XSS), the Flask application implements input validation mechanisms
to sanitize user input before processing it.

[10]
2. Output Encoding:
• Output encoding techniques are employed to sanitize data before rendering it in
HTML templates or generating JSON responses, mitigating the risk of XSS
attacks.

3. Secure Authentication:
• User authentication mechanisms are implemented using Flask-Login to securely
authenticate users and manage session state, preventing unauthorized access to
sensitive data and functionalities.

4. Secure Password Storage:


• Passwords are securely hashed using the Werkzeug library's hashing functions
before being stored in the database, ensuring that plaintext passwords are never
stored and protecting user credentials from unauthorized access.

Data Flow Diagram:

Diagram for Normal Users:

[11]
Diagram for Admin Users:

[12]
4. DATABASE DESIGN
4.1 Schema Overview:
The database schema for the Academy Nexus project defines the structure of the
database, including tables, columns, constraints, and relationships. The schema provides a
blueprint for organizing and storing data related to students, departments, attendance,
triggers, users, and tests.

4.2 Description of Tables and Relationships:

Students Table:
Stores information about students, including their roll number, name, date of
birth, gender, branch, contact details, and address.

[13]
Departments Table:

Represents various departments or branches within the institution.

Attendance Table:

Tracks the attendance of students, recording their roll number and attendance
percentage.

[14]
Triggers Table:

Logs triggers or events related to student activities, such as logins, edits, or deletions.

Users Table:

Stores user accounts for authentication and authorization purposes. Includes fields for
username, email, hashed password, and admin privileges.

[15]
4.3 Entity-Relationship Diagram (ERD):
The Entity-Relationship Diagram (ERD) for the Academy Nexus project depicts the
structure of the database and the relationships between different entities. It provides a clear
overview of how data is organized and connected within the system.
The ERD includes entities representing key components of the educational institution,
such as students, departments, attendance records, triggers, users, and tests. These entities are
interconnected through various relationships, defining how data flows and interacts within the
application.

[16]
4.4 Justification for Design Decisions:

Normalization:
The database schema follows normalization principles to minimize redundancy
and maintain data integrity. Tables are organized to eliminate data duplication and
ensure efficient storage and retrieval.

Relationships:
Relationships between tables are established using foreign keys to enforce
referential integrity and maintain consistency across related entities. For example, the
rollno column in the Attendance table references the rollno column in the Students table
to establish a one-to-many relationship.

[17]
5. SOFTWARE TESTING AND DEBUGGING
Software testing is a critical process in software development aimed at evaluating the
functionality of a software application and identifying defects to ensure the delivery of a high-
quality product. In addition to testing, effective debugging practices are essential for
identifying and resolving issues during development. This section provides an overview of
software testing methodologies, objectives, and debugging processes.

5.1 Definition:
According to ANSI/IEEE 1059 standard, software testing is defined as a process of
analysing a software item to detect differences between existing and required conditions
(defects) and to evaluate the features of the software item

5.2 Testing Methodologies:

5.2.1 White Box Testing:


White box testing involves the execution of every path in the program, focusing
on internal logic and code structure.

5.2.2 Black Box Testing:


Black box testing requires exhaustive input testing to find all errors, focusing
on the behaviour of the software without considering its internal implementation.
5.2.3 Unit Testing:
Unit testing, also known as Module Testing, focuses on verifying individual
modules or components of the software. It is performed at the programming stage and
involves testing the smallest units of software design.

5.2.4 Functional Testing:


Functional testing involves exercising the code with normal input values and
boundary values to validate its functionality against specified requirements.

5.3 Objective:
The objective of software testing is to ensure that the developed software meets
specified requirements, functions as expected, and is free from defects.

5.4 Debugging Process and Tools Used:

[18]
Debugging Process:
The debugging process involves identifying, analyzing, and resolving software
defects or anomalies. It typically includes the following steps:
• Reproducing the Issue
• Isolating the Problem
• Fixing the Issue
• Testing the Fix

Tools Used:
• Integrated Development Environment (IDE) Debuggers
• Logging Tools
• Error Tracking and Monitoring Platforms

5.5 Integration Testing:


Integration testing is a systematic technique for constructing the program structure
while conducting tests to uncover errors associated with interfaces between modules.

5.6 Validation Testing:


Validation testing ensures that the software functions in a manner expected by the
client, confirming compliance with requirements through black box testing.
5.7 System Testing:
System testing involves testing the entire system against its original objectives, current
specifications, and documentation to find discrepancies.

5.8 Structure Testing:


Structure testing focuses on exercising the internal logic of a program and traversing
specific execution paths to uncover errors.

5.9 Output Testing:


Output testing compares the output of test cases with expected results, ensuring that the
output format meets user requirements.

[19]
5.10 User Acceptance Testing (UAT):
UAT is the final stage before delivering the software to the customer, where test cases
are executed with actual data to ensure that the implemented software system satisfies user
requirements.

[20]
6. DEPLOYMENT

6.1 Hosting Environment Setup:


The hosting environment for the Academy Nexus Flask project is configured to provide
a stable and secure platform for hosting the web application. This typically involves setting up
a web server, database server, and necessary infrastructure components. Key aspects of the
hosting environment setup include:
• Web Server: Utilizing web server software such as Nginx or Apache to serve the Flask
application to users.
• Database Server: Configuring a database server (e.g., MySQL, PostgreSQL) to store
and manage application data securely.
• Operating System: Choosing an appropriate operating system (e.g., Linux
distribution) for hosting the application, ensuring compatibility with Flask and other
dependencies.
• Security Measures: Implementing security measures such as firewalls, encryption, and
access controls to protect the hosting environment from unauthorized access and
malicious attacks.

6.2 Deployment Process:


The deployment process for the Academy Nexus Flask project involves transferring the
application code from the development environment to the production environment, ensuring
seamless deployment and minimal downtime. The deployment process typically includes the
following steps:
• Version Control: Managing application code using version control systems such as
Git, ensuring traceability and collaboration among team members.
• Continuous Integration/Continuous Deployment (CI/CD): Automating the
deployment process using CI/CD pipelines to build, test, and deploy changes to the
production environment efficiently.
• Deployment Tools: Utilizing deployment tools such as Docker, Kubernetes, or Fabric
to automate deployment tasks and streamline the process.
• Monitoring and Rollback: Implementing monitoring tools to track application
performance and rollback changes in case of deployment failures or issues.

[21]
6.3 Configuration for Production Environment:
Configuring the production environment for the Academy Nexus Flask project involves
optimizing settings and parameters to ensure optimal performance, reliability, and scalability.
Key configurations include:
• Application Settings: Adjusting Flask application settings (e.g., debug mode, logging
level) for production use, ensuring security and efficiency.
• Database Configuration: Optimizing database settings (e.g., connection pooling,
caching) to handle production-level loads and improve performance.
• Web Server Configuration: Configuring web server settings (e.g., request timeouts,
caching strategies) to enhance application responsiveness and scalability.
• Security Configuration: Implementing security measures such as HTTPS, SSL/TLS
certificates, and secure headers to protect user data and prevent security vulnerabilities.

6.4 Considerations for Scalability and Performance:


Scalability and performance considerations are crucial for ensuring the Academy Nexus
Flask project can handle increasing user loads and maintain optimal performance under varying
conditions. Key considerations include:
• Horizontal Scaling: Designing the application architecture to support horizontal
scaling by adding more server instances or utilizing load balancers to distribute
incoming traffic evenly.
• Caching Strategies: Implementing caching mechanisms (e.g., Redis, Memcached) to
cache frequently accessed data and reduce database load, improving application
performance.
• Performance Testing: Conducting performance testing to identify bottlenecks and
optimize application components (e.g., database queries, API endpoints) for better
responsiveness and throughput.
• Resource Monitoring: Monitoring server resources (e.g., CPU usage, memory
consumption, network traffic) to identify performance issues and scale resources as
needed to meet demand.

[22]
7. FUTURE ENHANCEMENTS

7.1 Proposed Features for Future Development:

Enhanced User Authentication and Authorization:


Implementing role-based access control (RBAC) to provide different levels of
access to users based on their roles (e.g., admin, faculty, student). This feature would
enhance security and allow for more granular control over system functionalities.

Advanced Reporting and Analytics:


Introducing comprehensive reporting and analytics functionalities to provide
insights into student performance, attendance trends, and course effectiveness.
Integration with data visualization libraries (e.g., Plotly, Bokeh) would enable users to
generate custom reports and visualizations.

Mobile Application Development:


Developing a mobile application companion for Academy Nexus to enhance
accessibility and convenience for users. The mobile app could offer features such as
push notifications, course enrolment, and assignment submission, extending the
platform's reach to a broader audience.

Real-time Collaboration Tools:


Integrating real-time collaboration tools such as chat, video conferencing, and
collaborative document editing to facilitate communication and collaboration among
students and faculty members. This feature would support synchronous learning
activities and group projects.

7.2 Areas for Improvement:

User Experience (UX) Design:


Improving the overall user experience by enhancing the interface design,
navigation flow, and accessibility of the application. Conducting user research and
usability testing to identify pain points and areas for improvement.

[23]
Performance Optimization:
Optimizing application performance by addressing performance bottlenecks,
optimizing database queries, and implementing caching mechanisms. Performance
testing and monitoring tools can help identify areas for optimization and ensure
responsiveness under varying loads.

Scalability and Reliability:


Enhancing the scalability and reliability of the platform to accommodate growth
in user traffic and ensure high availability. Implementing auto-scaling capabilities,
fault-tolerant architecture, and disaster recovery measures to mitigate downtime and
ensure uninterrupted service.

7.3 Feasibility Analysis of Enhancements:

Technical Feasibility:
Assessing the technical feasibility of proposed enhancements based on the
existing architecture, technology stack, and available resources. Evaluating the
compatibility of new features with the current infrastructure and estimating the
development effort required.

Economic Feasibility:
Analysing the economic feasibility of enhancements by estimating the costs
associated with development, implementation, and maintenance. Conducting a cost-
benefit analysis to determine the potential return on investment (ROI) and prioritize
features based on their impact and cost-effectiveness.

Market Feasibility:
Considering the market feasibility of proposed enhancements by evaluating user
demand, competitor offerings, and industry trends. Gathering feedback from
stakeholders and conducting market research to validate the need for new features and
ensure alignment with market expectations.

[24]
8. UML DIAGRAMS

8.1 Class Diagram:


Class diagrams illustrate the static structure of the Academy Nexus Flask project by
depicting the various classes, their attributes, methods, and relationships. These diagrams
provide insights into the object-oriented design of the system, showcasing the organization of
classes and their interactions.

[25]
8.2 Use Case Diagram:
Use case diagrams illustrate the interactions between users (actors) and the system in
achieving specific goals. In the context of the Academy Nexus Flask project, use case diagrams
depict the various functionalities and user interactions within the e-learning platform

8.3 Sequence Diagram:


Sequence diagrams provide a dynamic representation of the interactions between
objects or components in the Academy Nexus Flask project. They illustrate the flow of
messages and actions over time, depicting how different components collaborate to execute
specific functionalities.

[26]
8.4 Activity Diagrams:
Activity diagrams provide a visual representation of the workflow and business
processes within the Academy Nexus Flask project. They depict the sequence of activities,
decision points, and control flows involved in completing specific tasks or scenarios.

[27]
8.5 Component Diagrams:
Component diagrams illustrate the physical components or modules of the Academy
Nexus Flask project and their interrelationships. They provide insights into the modular
structure of the system and the dependencies between different components.

[28]
8.6 Deployment Diagrams:
Deployment diagrams depict the physical deployment of software components onto
hardware nodes within the Academy Nexus Flask project. They illustrate the configuration of
servers, databases, and other devices, showcasing how the system is deployed in a production
environment.

[29]
9. CONCLUSION
The development and deployment of Academy Nexus represent a significant step
forward in addressing the challenges faced by educational institutions in managing student
information effectively. By providing a comprehensive platform for storing, organizing, and
accessing student-related data, Academy Nexus streamlines administrative tasks and fosters
collaboration among stakeholders. The project's architecture leverages a combination of front-
end and back-end technologies, chosen for their versatility, compatibility, and robust feature
sets.
The front-end stack, including HTML, CSS, JavaScript, jQuery, and Bootstrap 5,
ensures a visually appealing and responsive user interface, while the back-end technologies,
such as Python, Flask, and MySQL, provide a solid foundation for building scalable and
efficient web applications. Integration with Flask extensions like Flask_SQLAlchemy,
Flask_Login, and Flask_Mail enhances security, user authentication, and communication
capabilities.
The database design follows normalization principles to minimize redundancy and
maintain data integrity, with relationships established using foreign keys to enforce referential
integrity. The ERD provides a clear overview of the database structure and relationships
between entities, guiding developers in organizing and managing data effectively.
Software testing and debugging processes are crucial aspects of ensuring the quality
and reliability of the application. By employing various testing methodologies, such as white
box testing, black box testing, unit testing, and integration testing, developers can identify and
resolve defects early in the development lifecycle. Continuous monitoring and performance
optimization further contribute to delivering a high-quality user experience.
The deployment process involves configuring the hosting environment, automating
deployment tasks, and implementing security measures to ensure a stable and secure platform
for hosting the application. Considerations for scalability and performance optimization are
essential for accommodating increasing user loads and maintaining optimal performance under
varying conditions.
Proposed future enhancements, including role-based access control, advanced reporting
and analytics, mobile application development, and real-time collaboration tools, offer
opportunities to enhance the functionality and usability of Academy Nexus further. Feasibility
analysis helps in assessing the technical, economic, and market viability of these
enhancements, guiding decision-making and prioritization.

[30]
10. SOURCES CONSULTED

TEXT BOOKS:
• "Learning Flask Framework" by Matt Copperwaite - A comprehensive guide to
learning Flask for web development. Publisher: Packt Publishing.
ISBN: 9781783983360
• "Flask Web Development: Developing Web Applications with Python" by Miguel
Grinberg - A practical guide to building web applications with Flask. Publisher:
O'Reilly Media.
ISBN: 9781491991732
• "JavaScript and JQuery: Interactive Front-End Web Development" by Jon Duckett - A
comprehensive book covering JavaScript and jQuery for front-end web development.
Publisher: Wiley.
ISBN: 9781118531648
• "HTML and CSS: Design and Build Websites" by Jon Duckett - A beginner-friendly
book on HTML and CSS for web design. Publisher: Wiley.
ISBN: 9781118008188

WEB REFERENCES:
• Flask Documentation - Official documentation for the Flask web framework. Available
at: https://flask.palletsprojects.com/
Contact: Flask Team, [email protected]
• Python Documentation - Official documentation for the Python programming language.
Available at: https://docs.python.org/
Contact: Python Software Foundation, [email protected]
• MySQL Documentation - Official documentation for the MySQL relational database
management system. Available at: https://dev.mysql.com/doc/
Contact: Oracle Corporation, [email protected]
• Bootstrap Documentation - Official documentation for the Bootstrap front-end
framework. Available at: https://getbootstrap.com/docs/5.1/
Contact: Bootstrap Team, [email protected]

[31]
APPENDICES

A. SAMPLE CODING:

Web App code (Main.py):


from flask import Flask, render_template, request, session, redirect, url_for,
flash, jsonify
from flask_sqlalchemy import SQLAlchemy
from flask_login import UserMixin, login_user, logout_user, login_manager,
LoginManager, login_required, current_user
from werkzeug.security import generate_password_hash,
check_password_hash
from sqlalchemy.exc import IntegrityError
from flask_mail import Mail, Message
from sqlalchemy import func
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from PIL import Image
app = Flask(__name__)
app.secret_key = 'kusumachandashwini'
# Configuring SQLAlchemy
app.config['SQLALCHEMY_DATABASE_URI'] =
'mysql://root:@localhost/students'
db = SQLAlchemy(app)
# Login Manager setup
login_manager = LoginManager(app)
login_manager.login_view = 'login'
@login_manager.user_loader
def load_user(user_id):
return db.session.query(User).get(int(user_id))

[32]
# Define database models
class Test(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(100))
email = db.Column(db.String(100))
class Department(db.Model):
cid = db.Column(db.Integer, primary_key=True)
branch = db.Column(db.String(100))
class Attendence(db.Model):
aid = db.Column(db.Integer, primary_key=True)
rollno = db.Column(db.String(100))
attendance = db.Column(db.Integer())
class Trig(db.Model):
tid = db.Column(db.Integer, primary_key=True)
rollno = db.Column(db.String(100))
action = db.Column(db.String(100))
timestamp = db.Column(db.String(100))
class User(UserMixin, db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(50))
email = db.Column(db.String(50), unique=True)
password = db.Column(db.String(1000))
is_admin = db.Column(db.Boolean, default=False)
class Student(db.Model):
id = db.Column(db.Integer, primary_key=True)
rollno = db.Column(db.String(50))
sname = db.Column(db.String(50))
dob = db.Column(db.String(50))
gender = db.Column(db.String(50))
branch = db.Column(db.String(50))
email = db.Column(db.String(50))
number = db.Column(db.String(12))
address = db.Column(db.String(100))

[33]
app.config['MAIL_SERVER'] = 'smtp.gmail.com'
app.config['MAIL_PORT'] = 587 # Change the port to 587 for TLS
app.config['MAIL_USE_TLS'] = True # Enable TLS
app.config['MAIL_USE_SSL'] = False # Disable SSL
app.config['MAIL_USERNAME'] = '[email protected]'
app.config['MAIL_PASSWORD'] = 'cqib qlcr sfnm lvew'
app.config['MAIL_DEFAULT_SENDER'] = 'AcademyNexusGASC
<[email protected]>'
mail = Mail(app)
# Routes
@app.route('/')
def index():
return render_template('index.html')
@app.route('/studentdetails')
@login_required
def studentdetails():
if not current_user.is_admin:
flash("You have only view permission", "danger")
return redirect(url_for('index'))
query = Student.query.all()
return render_template('studentdetails.html', query=query)
@app.route('/event')
@login_required
def event():
if not current_user.is_admin:
flash("You have only view permission", "danger")
return redirect(url_for('index'))
return render_template('triggers.html')
@app.route('/triggers', methods=['GET'])
@login_required
def triggers():
if current_user.is_authenticated and current_user.is_admin:
users_data = Trig.query.all()

[34]
users_list = []
for user_data in users_data:
user_dict = {
'tid': user_data.tid,
'rollno': user_data.rollno,
'action': user_data.action,
'timestamp': user_data.timestamp,
}
users_list.append(user_dict)

return jsonify(users_list)
else:
flash("You have only view permission", "danger")
return redirect(url_for('index'))
@app.route('/addattendance', methods=['POST', 'GET'])
@login_required
def addattendance():
if current_user.is_authenticated and current_user.is_admin:
query = Student.query.all()
if request.method == "POST":
rollno = request.form.get('rollno')

# Check if attendance for this roll number already exists


existing_attendance = Attendence.query.filter_by(rollno=rollno).first()
if existing_attendance:
flash("Attendance for this roll number already exists", "danger")
return redirect(url_for('addattendance'))

total_days = int(request.form.get('total_days')) # Convert to int


present_dates = int(request.form.get('present_dates')) # Convert to int

if total_days == 0:
flash("Total days cannot be zero", "danger")
return redirect(url_for('addattendance'))
[35]
attend = int((present_dates / total_days) * 100)
atte = Attendence(rollno=rollno, attendance=attend)
try:
db.session.add(atte)
db.session.commit()
flash(f"Attendance added: {attend}%", "warning") # Display the attendance
percentage
except IntegrityError:
db.session.rollback()
flash("Error adding attendance", "danger")
return redirect(url_for('addattendance')) # Redirect to avoid resubmission on refresh
attendance_average_results = db.session.query(Student.branch, Student.gender,
func.avg(Attendence.attendance).label('avg_attendance')) \
.join(Attendence, Student.rollno == Attendence.rollno) \
.group_by(Student.branch, Student.gender) \
.all()
# Prepare data for plotting
branch_data = {}
for result in attendance_average_results:
branch = result[0]
gender = result[1]
attendance = result[2]
if branch not in branch_data:
branch_data[branch] = {'Male': 0, 'Female': 0}
branch_data[branch][gender] = attendance
# Plotting
branches = list(branch_data.keys())
male_attendance = [branch_data[branch]['Male'] for branch in branches]
female_attendance = [branch_data[branch]['Female'] for branch in branches]
bar_width = 0.3
index = range(len(branches))
plt.bar(index, male_attendance, bar_width, label='Male')
plt.bar([i + bar_width for i in index], female_attendance, bar_width, label='Female')
[36]
plt.xlabel('Department')
plt.ylabel('Attendance (%)')
plt.xticks([i + bar_width / 2 for i in index], branches)
plt.yticks(range(0, 101, 10))
plt.legend()
plt.tight_layout()
plt.gcf().canvas.draw()
img = plt.gcf().canvas.tostring_rgb()
plt.close()
img = Image.frombytes("RGB", plt.gcf().canvas.get_width_height(), img)
img.save("static/attendance_chart.png")
return render_template('attendance.html', query=query)
else:
flash("You have only view permission", "danger")
return redirect(url_for('index'))
@app.route('/test')
def test():
try:
Test.query.all()
return 'My database is connected'
except:
return 'My database is not connected'

if __name__ == "__main__":
app.run(debug=True)

[37]
Sample “Html” Code:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">

<title>{% block title %}


{% endblock title %}</title>
<meta content="" name="description">
<meta content="" name="keywords">
{% block style %}
{% endblock style %}
<link
href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,700,70
0i|Raleway:300,400,500,700,800" rel="stylesheet">
<!-- Vendor CSS Files -->
<link href="static/assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="static/assets/vendor/venobox/venobox.css" rel="stylesheet">
<link href="static/assets/vendor/font-awesome/css/font-awesome.min.css"
rel="stylesheet">
<link href="static/assets/vendor/owl.carousel/assets/owl.carousel.min.css"
rel="stylesheet">
<link href="static/assets/vendor/aos/aos.css" rel="stylesheet">
<!-- Template Main CSS File -->
<link href="static/assets/css/style.css" rel="stylesheet">
</head>
<body>
<!-- ======= Header ======= -->
<header id="header">
<div class="container">
<div id="logo" class="pull-left">
<a href="/" class="scrollto">G.A.S.C</a>

[38]
</div>
<nav id="nav-menu-container">
<ul class="nav-menu">
<li class="{% block home %}
{% endblock home %}"><a id="nav" href="/">Home</a></li>
<li><a id="nav" href="/addstudent">Students</a></li>
<li><a id="nav" href="/addattendance">Attendance</a></li>
<li><a id="nav" href="/event">Records</a></li>
<li><a id="nav" href="/studentdetails">Student Details</a></li>
<li><a id="nav" href="/search">Search</a></li>
<li><a id="nav" href="/about">About</a></li>
{% if current_user.is_authenticated %}
<li class="buy-tickets"><a href="">Welcome {{current_user.username}}</a></li>
<li class="buy-tickets"><a href="/logout">Logout</a></li>
{% else %}
<li class="buy-tickets"><a href="/signup">Signin</a></li>
{% endif %}
</ul>
</nav><!-- #nav-menu-container -->
</div>
</header><!-- End Header -->
<!-- ======= Intro Section ======= -->
<section id="intro">
<div class="intro-container" data-aos="zoom-in" data-aos-delay="100">
<h1 class="mb-4 pb-0">Government Art's and science college</span> </h1>
<p class="mb-4 pb-0">Academy Nexus</p>
<a href="" class="about-btn scrollto">View More</a>
</div>
</section><!-- End Intro Section -->
<main id="main">
{% block body %}
{% with messages=get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
[39]
<div class="alert alert-{{category}} alert-dismissible fade show" role="alert">
{{message}}
</div>
{% endfor %}
{% endif %}
{% endwith %}
{% endblock body %}
<!-- ======= Footer ======= -->
{% block footer %}
<footer id="footer">
</div>
<div class="container">
<div class="credits">
<br>
Developed by <a href="https://github.com/Udhayaboopathi" target="_blank">
UDHAYABOOPATHI</a>
</div>
</div>
</footer>
{% endblock footer %}
<!-- End Footer -->
<a href="#" class="back-to-top"><i class="fa fa-angle-up"></i></a>
<!-- Vendor JS Files -->
<script src="static/assets/vendor/jquery/jquery.min.js"></script>
<script src="static/assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="static/assets/vendor/jquery.easing/jquery.easing.min.js"></script>
<script src="static/assets/vendor/php-email-form/validate.js"></script>
<script src="static/assets/vendor/venobox/venobox.min.js"></script>
<script src="static/assets/vendor/owl.carousel/owl.carousel.min.js"></script>
<script src="static/assets/vendor/superfish/superfish.min.js"></script>
<script src="static/assets/vendor/hoverIntent/hoverIntent.js"></script>
<script src="static/assets/vendor/aos/aos.js"></script>
<!-- Template Main JS File -->
<script src="static/assets/js/main.js"></script>
[40]
<script src="https://releases.jquery.com/git/jquery-git.js"></script>
<script src="https://rawgit.com/schmich/instascan-builds/master/instascan.min.js"></script>
{% block Script %}{% endblock Script %}
</body>
</html>

[41]
Sample JavaScript (JS) Code:

jQuery(document).ready(function ($) {
// Back to top button
$(window).scroll(function () {
if ($(this).scrollTop() > 100) {
$(".back-to-top").fadeIn("slow");
} else {
$(".back-to-top").fadeOut("slow");
}
});
$(".back-to-top").click(function () {
$("html, body").animate(
{
scrollTop: 0,
},
1500,
"easeInOutExpo"
);
return false;
});

// Header fixed on scroll


$(window).scroll(function () {
if ($(this).scrollTop() > 100) {
$("#header").addClass("header-scrolled");
} else {
$("#header").removeClass("header-scrolled");
}
});

if ($(window).scrollTop() > 100) {


$("#header").addClass("header-scrolled");
}

[42]
// Initialize Venobox
$(".venobox").venobox({
bgcolor: "",
overlayColor: "rgba(6, 12, 34, 0.85)",
closeBackground: "",
closeColor: "#fff",
share: false,
});

// Initiate superfish on nav menu


$(".nav-menu").superfish({
animation: {
opacity: "show",
},
speed: 400,
});

// Mobile Navigation
if ($("#nav-menu-container").length) {
var $mobile_nav = $("#nav-menu-container").clone().prop({
id: "mobile-nav",
});
$mobile_nav.find("> ul").attr({
class: "",
id: "",
});
$("body").append($mobile_nav);
$("body").prepend(
'<button type="button" id="mobile-nav-toggle"><i class="fa fa-
bars"></i></button>'
);
$("body").append('<div id="mobile-body-overly"></div>');
$("#mobile-nav")
[43]
.find(".menu-has-children")
.prepend('<i class="fa fa-chevron-down"></i>');

$(document).on("click", ".menu-has-children i", function (e) {


$(this).next().toggleClass("menu-item-active");
$(this).nextAll("ul").eq(0).slideToggle();
$(this).toggleClass("fa-chevron-up fa-chevron-down");
});

$(document).on("click", "#mobile-nav-toggle", function (e) {


$("body").toggleClass("mobile-nav-active");
$("#mobile-nav-toggle i").toggleClass("fa-times fa-bars");
$("#mobile-body-overly").toggle();
});

$(document).click(function (e) {
var container = $("#mobile-nav, #mobile-nav-toggle");
if (!container.is(e.target) && container.has(e.target).length === 0) {
if ($("body").hasClass("mobile-nav-active")) {
$("body").removeClass("mobile-nav-active");
$("#mobile-nav-toggle i").toggleClass("fa-times fa-bars");
$("#mobile-body-overly").fadeOut();
}
}
};

[44]
B.TABLE STRUCTURES:
1. TABLE NAME: STUDENTS

ID 1
ROLL NO C21UG154CSC026
SNAME UDHAYABOOPATHI V
DOB 20.08.2003
BRANCH COMPUTER SCIENCE
GENDER MALE
PHONENUMBER +916369255254
EMAIL [email protected]
ADDRESS SALEM

[45]
C.DATA FLOW DIAGRAM:
Diagram for Normal Users:

[46]
Diagram for Admin Users:

[47]
D. SCREEN SHOTS:

WEB PAGE:

[48]
[49]
[50]
[51]
Database:

[52]
[53]

You might also like