Skip to content

Postman-API-Fest-2022/team-34-student-management

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Student Management

Student Database is an API developed to manipulate data of university students. It is created with SpringBoot and tested with Postman.

This is a platform agnostic API, meaning it doesn't require any specific frontend, backend or database to work. It can work with any configuration that uses the REST standard of API. The API is able to perform four operations to the database.

Running the Application

  1. Frontend - node modules install - npm install @angular/cli. To run the web page use command -> ng serve, it will run the web page on localhost:4200

  2. Backend - open the backend file(Student file) on Eclipse IDE.

  3. And your machine need to have MySql workbench installed.

  4. And on MySql you need to create a schema called studentdashboard.

  5. On Eclipse IDE go to student folder -> src/main/java -> com.example.student -> StudentApplication.java. Open it and right click on it, got to -> Run as -> Java Application (This will start the spring boot file).

Sample screenshots of the application

Postman Documentation

Workspace Link - Click here

API Requests

Request Name Requests Description Type Endpoint
Get Student Get information of all students GET /getStudent
Put Student Update information of one student PUT /updateStudent
Post Student Add information of new student POST /registerStudent
Delete Student Delete information of one student DELETE deleteStudent

Before You Start

The further part is detailed documentation about every request that is supported by the API. Terms used in the documentation might defer from what you use in your language / tool. So here's a brief description of terminologies used in the document.

Terminology Description
Request When a server is called from the frontend with some endpoint and optional parameters.
Endpoint The point of interaction between API and other systems.
Payload Information sent along with the request. It could be anything that is useful for API as well as the backend server to process the request.
Response When the request is processed, information sent back to the frontend educating it about the result of the request. It consists of HTTP status code and error and/or data.

Meet the Creators

The API is developed as a project for API Fest organized by Postman in the span of 26th Jan 2022 and 29th Jan 2022.
Here are the developers:

  1. Saptak Chakraborty - [[email protected]] - [ TEAM LEAD ]
  2. Shaon Dhar - [[email protected]] - API Developer [ MEMBER ]
  3. Kaushal Joshi - [[email protected]] - API Documentation Creator [ MEMBER ]
  4. Kaushik Lakhani - [[email protected]] - API Documentation Creator [ MEMBER ]

Mock Application

To demonstrate workings of this API, we created a full stack application. It is built with Angular JS in the front end, Java Springboot in the backend and MySQL as a database. It follows REST standard of APIs.
You can see the GitHub repo of the project here.

GET Student

localhost:9090/getStudents

This request is used to get information of all the students available in the database. The response is usually an array of objects, where each object is information about an individual student.

Request Type Endpoint Payload Response
GET /getStudent NIL JSON Array of objects

Body

Raw JSON

{
  "name": "Shaon Dhar",
  "fathersName": "XYZ",
  "phone": "8556975124",
  "percentage": 98,
  "grade": "A",
  "course": "MCA",
  "address": "Kolkata",
  "email": "[email protected]"
}

POST Student

localhost:9090/registerStudent

This request stores information of new students in the database.

Request Type Endpoint Payload Response
POST /registerStudent Information about new student JSON Object of newly added information

Payload:

This endpoint is used for adding a new entry to the database. Hence we need to provide all the information which is required to store new values in the database.

Here's the list data with its data type that you need to provide in the payload.

Key Data type Example
name String "Kaushal Joshi"
fatherName String "Sharad Joshi"
fatherName String "Sharad Joshi"
phone String "8082498523"
percentage Number 76
grade String "A"
course String "Engineering"
address String "Mumbai"
email String "[email protected]"

Things to Know

ID is supposed to be created by the database itself and it is expected to be a Number data type value.
When the request is successful, ID will be returned along with other newly added information.

Body

Raw JSON

{
  "name": "Shaon Dhar",
  "fathersName": "XYZ",
  "phone": "8556975124",
  "percentage": 98,
  "grade": "A",
  "course": "MCA",
  "address": "Kolkata",
  "email": "[email protected]"
}

PUT Student

localhost:9090/updateStudent

This request modifies existing information in the database. It takes student ID as a payload and forwards it to the database. After a successful updation, API sends

Request Type Endpoint Payload Response
POST /updateStudent ID (Number)
Informationto be updated (Object)
JSON object of updated information

Payload

The autogenerated ID of student along with the information that needs to be updated is expected as a payload. ID must be of a numeric data type whereas new information must be an object.

Body

Raw JSON

{
  "rollNumber": 5,
  "name": "Shaon Dhar",
  "fathersName": "XYZ",
  "phone": "8556975124",
  "percentage": 100,
  "grade": "A",
  "course": "MCA",
  "address": "Kolkata",
  "email": "[email protected]"
}

DELETE Student

localhost:9090/deleteStudent?id=5

This request deletes information of individual student from the database. It takes student ID as a payload and passes it to the database. When a request is successful i.e. student is deleted, we get an empty array in return.

Request Type Endpoint Payload Response
DELETE /deleteStudent ID (Number) Empty Array

Payload

The autogenerated ID of student that needs to be deleted from the database is sent along with the request. It is expected to be of a Number data type.

Parameters

Name Data Type Example
id Number 5

Body

Raw JSON

{
  "name": "Shaon Dhar",
  "fathersName": "XYZ",
  "phone": "8556975124",
  "percentage": 100,
  "grade": "A",
  "course": "MCA",
  "address": "Kolkata",
  "email": "[email protected]"
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published