Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jrs296/ffcs-typescript-api
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.
https://github.com/jrs296/ffcs-typescript-api
api api-rest docker docker-image typescript
Last synced: 4 days ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/jrs296/ffcs-typescript-api
- Owner: JRS296
- License: mit
- Created: 2023-06-28T18:53:05.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-09-29T19:23:58.000Z (over 1 year ago)
- Last Synced: 2024-11-10T03:36:23.616Z (2 months ago)
- Topics: api, api-rest, docker, docker-image, typescript
- Language: TypeScript
- Homepage: https://hub.docker.com/repository/docker/jrs296/ffcs_api_image/general
- Size: 79.1 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
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
About The Project
Getting Started
- Class Diagram
- Testing Results
- Contributing
- License
- Contact
- 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 themselvesImportant:
* Bearer Token for Admin: admin
* Bearer Token for students: {student_id} (Eg: 20BCT0332, 20BCT0306)### Built With
Built with the following tech stack:
* Typescript - https://www.typescriptlang.org/
* Node Js - https://nodejs.org/en/
* Express Js - https://expressjs.com/
* MySQL - https://www.mysql.com/## 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:
```sh
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:
```sh
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
```sh
https://github.com/JRS296/FFCS-TypeScript-API.git
```
2. Install NPM packages
```sh
npm install
```
3. Configure CORS as required to establish connection with frontend as required by CORS policy.
```js
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.
```js
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)## Class Diagram
![image](https://user-images.githubusercontent.com/70965472/222976404-5775b5a2-08ea-4ccc-9b21-f792d034a2b6.png)
## Testing Results
Results of Python Environment Based Testing: (Link: https://github.com/dyte-submissions/vit-hiring-2023-phase1-test)
![image](https://user-images.githubusercontent.com/70965472/222976933-bb4eef45-bef3-4ee1-8df2-069144128acf.png)
![image](https://user-images.githubusercontent.com/70965472/222976965-2bef5c08-1937-478d-9829-f0fa67c4fc80.png)
![image](https://user-images.githubusercontent.com/70965472/222976975-fb475aae-3ab6-45e4-bf98-4d86e0dcbeb5.png)
Testing: SUCCESSFULLResults of Jest Unit API Testing: (Link: https://jestjs.io/docs/getting-started)
![image](https://user-images.githubusercontent.com/70965472/222977794-83376ecb-f115-4f63-9419-17fc7b8c03b0.png)
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.## 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## License
Distributed under the MIT License. See `LICENSE.txt` for more information.
## Contact
Jonathan Rufus Samuel - [email protected]
Project Link: [https://github.com/dyte-submissions/vit-hiring-2023-phase-1-JRS296](https://github.com/dyte-submissions/vit-hiring-2023-phase-1-JRS296)
## 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. :)
[contributors-shield]: https://img.shields.io/github/contributors/othneildrew/Best-README-Template.svg?style=for-the-badge
[contributors-url]: https://github.com/othneildrew/Best-README-Template/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/othneildrew/Best-README-Template.svg?style=for-the-badge
[forks-url]: https://github.com/othneildrew/Best-README-Template/network/members
[stars-shield]: https://img.shields.io/github/stars/othneildrew/Best-README-Template.svg?style=for-the-badge
[stars-url]: https://github.com/othneildrew/Best-README-Template/stargazers
[issues-shield]: https://img.shields.io/github/issues/othneildrew/Best-README-Template.svg?style=for-the-badge
[issues-url]: https://github.com/othneildrew/Best-README-Template/issues
[license-shield]: https://img.shields.io/github/license/othneildrew/Best-README-Template.svg?style=for-the-badge
[license-url]: https://github.com/othneildrew/Best-README-Template/blob/master/LICENSE.txt
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
[linkedin-url]: https://linkedin.com/in/othneildrew
[product-screenshot]: images/screenshot.png
[Next.js]: https://img.shields.io/badge/next.js-000000?style=for-the-badge&logo=nextdotjs&logoColor=white
[Next-url]: https://nextjs.org/
[React.js]: https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB
[React-url]: https://reactjs.org/
[Vue.js]: https://img.shields.io/badge/Vue.js-35495E?style=for-the-badge&logo=vuedotjs&logoColor=4FC08D
[Vue-url]: https://vuejs.org/
[Angular.io]: https://img.shields.io/badge/Angular-DD0031?style=for-the-badge&logo=angular&logoColor=white
[Angular-url]: https://angular.io/
[Svelte.dev]: https://img.shields.io/badge/Svelte-4A4A55?style=for-the-badge&logo=svelte&logoColor=FF3E00
[Svelte-url]: https://svelte.dev/
[Laravel.com]: https://img.shields.io/badge/Laravel-FF2D20?style=for-the-badge&logo=laravel&logoColor=white
[Laravel-url]: https://laravel.com
[Bootstrap.com]: https://img.shields.io/badge/Bootstrap-563D7C?style=for-the-badge&logo=bootstrap&logoColor=white
[Bootstrap-url]: https://getbootstrap.com
[JQuery.com]: https://img.shields.io/badge/jQuery-0769AD?style=for-the-badge&logo=jquery&logoColor=white
[JQuery-url]: https://jquery.com