Skip to content

This API is built out with Typescript, Node Js, Express and MySQL, with its primary functionality in being able to handle API calls pertaining to VIT's FFCS System for handling course registration amongst its students.

License

Notifications You must be signed in to change notification settings

JRS296/FFCS-TypeScript-API

Repository files navigation


FFSC Backend using Typescript, Node Js, Express and MySQL

By: Jonathan Rufus Samuel - 20BCT0332
Solution for Problem Statements for VIT (2023 Batch) - Dyte

Table of Contents
  1. About The Project
  2. Getting Started
  3. Class Diagram
  4. Testing Results
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

This Project pertains to the 1st round of Dyte's on Campus Recruitments for VIT Vellore, for the year 2023. In short, this project is a backend with Typescript, Node Js, Express and MySQL, with its primary functionality in being able to handle API calls pertaining to VIT's FFCS System for handling course registration amongst its students.

Cloud General Access Link: (Please edit CORS as required to use) Unable to Deploy due to private nature of GitHub repo on 3rd part cloud service providers like Heroku and Render. Will update later on status of General Access Link as required

Key Features:

  • Can be accessed as both admin as well as student.
  • Full Admin functionality for creation of courses and slots, registration of students and teachers and more.
  • Can individually track Registered Courses of all students. Provides security by means of Bearer Token Authentication. (Login not handled via explicit route, handled via Bearer Authentication Token.)
  • Logic implemented to handle clashing of registered courses (returns error with status code: 400)
  • Follows API specification as mentioned by this webpage: https://dyte-hiring-docs.pages.dev/#/
  • Security within routes, students can see data only relevant to themselves

Important:

  • Bearer Token for Admin: admin
  • Bearer Token for students: {student_id} (Eg: 20BCT0332, 20BCT0306)

(back to top)

Built With

Built with the following tech stack:

(back to top)

Getting Started

We recommend using our Docker image to build out the API's backend. You can do so via building out the image from the given link:

   https://hub.docker.com/repository/docker/jrs296/ffcs_api_image/general

To get a local copy up and running via GitHub, follow these simple example steps:

Prerequisites

Install npm using the following command:

npm install npm@latest -g

Installation

Below is an example of how you can instruct your audience on installing and setting up your app. This template doesn't rely on any external dependencies or services.

  1. Clone the repo

    https://github.com/JRS296/FFCS-TypeScript-API.git
  2. Install NPM packages

    npm install
  3. Configure CORS as required to establish connection with frontend as required by CORS policy.

    app.use(cors({ origin: "https://dyte-hiring-docs.pages.dev" })); //Cors origin ID
  4. Configure MySQL on local machine. Go to ./MySQL/config.ts and configure data as required. Here is an example from the config.ts file that comes by default with this repository.

    const connection = new Sequelize({ dialect: "mysql", host: "localhost", username: "root", password: "123456", database: "ffcs", port: 3307,
     logging: false, models: [Faculty, Student, Course, RegCourses, Timings, StudentTimetable], });
  5. Set up Postman, or any other API testing tool to interact with the Backend. You can also interact with the API directly through this link:

  6. And Remember,

  • Bearer Token for Admin: admin
  • Bearer Token for students: {student_id} (Eg: 20BCT0332, 20BCT0306)

(back to top)

Class Diagram

image

(back to top)

Testing Results

Results of Python Environment Based Testing: (Link: https://github.com/dyte-submissions/vit-hiring-2023-phase1-test)

image image image Testing: SUCCESSFULL

Results of Jest Unit API Testing: (Link: https://jestjs.io/docs/getting-started)

image Testing: Unsuccessful - Was unable to properly configure Jest for typescript environment, along with lack of time to modularize modules for UNIT tests. Can implement it in due time if required.

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Jonathan Rufus Samuel - [email protected]

Project Link: https://github.com/dyte-submissions/vit-hiring-2023-phase-1-JRS296

(back to top)

Acknowledgments

I'd like to take some time out to thank Dyte for the opportunity to attempt this test, had an amazing time brainstorming and figuring out a solution to the problem at hand. :)

(back to top)

About

This API is built out with Typescript, Node Js, Express and MySQL, with its primary functionality in being able to handle API calls pertaining to VIT's FFCS System for handling course registration amongst its students.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published