0% found this document useful (0 votes)
33 views15 pages

AMS Backend

The document describes an API for an academic management system with the following key points: 1. It outlines the main features and purpose of streamlining student and course management processes. 2. It discusses the main libraries and modules used including Flask, SQLAlchemy, JWT, and Flask-Migrate. 3. It provides examples of database models like Student, Teacher, Grade, and Course that are used to structure the database.

Uploaded by

Sahil Verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views15 pages

AMS Backend

The document describes an API for an academic management system with the following key points: 1. It outlines the main features and purpose of streamlining student and course management processes. 2. It discusses the main libraries and modules used including Flask, SQLAlchemy, JWT, and Flask-Migrate. 3. It provides examples of database models like Student, Teacher, Grade, and Course that are used to structure the database.

Uploaded by

Sahil Verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

AMS BACKEND

- SAHIL VERMA
- RAGHVENDRA SINGH
Overview

Key features: Authentication,


Purpose: Streamlining
student information, course
student and course
information, I-Card and
management processes
scholarship management
Key Libraries & Modules

SQLAlchemy:
JWT (JSON Web
Flask: Micro web Object Relational
Tokens): Handling
framework for Mapper (ORM) for
user authentication
creating the API database
and authorization
management

Database models:
Flask-Migrate:
Defining the
Handling database
structure of the
migrations
database
Database Models
Student: Contains student information (e.g., ID, name,
department, batch)

Teacher: Contains teacher information (e.g., ID, name,


department)

Grade: Contains student grades for courses

Course: Contains course information (e.g., ID, name,


description, credits)

Classroom: Associates students with courses and


semesters

ICard: Stores ICard information (e.g., student ID,


sign, image)

ScholarshipDB: Stores scholarship information for


students

CoursesOffered: Stores information about the courses


offered by department and semester
Sample Model
Foreign Key Mapping Advantages
Referential integrity: Foreign keys ensure that the data in one table refers to valid
data in another table. When you try to insert data into a child table that does not have
a corresponding record in the parent table, the database will reject the operation,
preventing invalid data from being inserted.

Improved data consistency: Foreign keys help maintain data consistency across multiple
tables in a database. By ensuring that data in one table corresponds to valid data in
another table, foreign keys help prevent data inconsistencies and ensure that data is
reliable.

Improved database performance: Foreign keys can also help improve the performance of
queries that involve multiple tables. By enforcing referential integrity, foreign keys
can help the database optimizer generate more efficient execution plans for queries.

Easier database maintenance: By using foreign keys, you can simplify database
maintenance tasks such as updating or deleting records. When you update or delete a
record in a parent table, the corresponding records in child tables can be automatically
updated or deleted as well, ensuring that the data remains consistent.
Data Migration with Flask-Migrate

01 02 03
Introduction to Flask- Benefits of using Flask- Integration into the
Migrate: A tool for Migrate for data existing application:
handling database migration: Simplifies Adding Flask-Migrate to
schema changes schema updates, the application and
version control, and using it to manage
reduces the risk of data database migrations
loss
• Login endpoint: /login
• User sends their student ID and
password
• Server checks the credentials
JWT Based and generates an access token
• Access token is returned to the
Authentication user
• User includes the access token
in the request headers for
protected endpoints
API Endpoints
Student Information Endpoints

/viewProfile /viewGrades /userDetails


Returns user profile Fetches user grades by semester, Retrieves limited user
information, excluding login including course details and details, excluding login
password elective types password, department, and
batch
Input: Input:
 Method: GET  Method: GET Input:
 Header: Authorization:  Header:  Method: GET
Bearer {access_token} Authorization: Bearer  Header: Authorization:
{access_token} Bearer {access_token}
Output:
 Success (HTTP status 200): Output: Output:
{ "user": { user_info } }  Success (HTTP status 200):  Success (HTTP status 200):
{"user": {user_info}, { "user": { user_info } }
"grades": {semesters_data}}
Course Information Endpoints

/relevantCourses /otherCourses
Displays courses relevant to the user based Shows all available courses, regardless of the
on their batch and department user's batch and department

Input: Input:
 Method: GET  Method: GET
 Header: Authorization: Bearer  Header:
{access_token} Authorization: Bearer {access_token}

Output: Output:
 Success (HTTP status 200):  Success (HTTP status 200): { "otherCourses": [ {
{ "relevantCoureses": course_info }, ... ] }
[ { course_info }, ... ] }
I-Card and Scholarship Endpoints

/icardSubmit /submitScholarship /viewScholarship

Allows users to submit ICard Enables users to submit scholarship Retrieves scholarship information
requests with their sign and image requests with details about ongoing for the user, if available
and applied scholarships, bank
Input: information, and family income Input:
 Method: POST information  Method: GET
 Header: Authorization: Bearer  Header: Authorization: Bearer
{access_token} Input: {access_token}
 JSON body: { "sign": "signature",  Method: GET
"image": "image_data" }  Header: Output:
Authorization: Bearer •Success (HTTP status 200):
Output: {access_token} { "scholarship":
•Success (HTTP status 200):  JSON body: { scholarship_data } { scholarship_info } }
{ "message": "I-card submitted •Not Found (HTTP status 404):
successfully" } Output: { "message": "No scholarship
•Failure (HTTP status 500): •Success (HTTP status 200): found" }
{ "message": "error_message" } { "message": "Scholarship submitted •Failure (HTTP status 500):
successfully" } { "message": "error_message" }
•Failure (HTTP status 500):
{ "message": "Something went wrong" }
Learning From This Project

Understanding Flask and Authentication and Database interaction and Data migration and Error handling and
RESTful API design: security: models: versioning: debugging:
Learned how to design and Learned how to implement JWT- Learned how to design and use Utilized Flask-Migrate for Improved debugging skills by
implement RESTful APIs with based authentication for secure efficient data models to handling database schema identifying and fixing issues
clear, standardized routes. access to resources. represent real-world entities. changes and versioning. during development.
Conclusion

The Academic Management System API is a flexible and extensible solution

Built using Flask, SQLAlchemy, JWT, and Flask-Migrate

Streamlines student and course management processes

Simplifies data migration and schema updates


Thank You

You might also like