Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/navaneeth-21/educase_assignment
Implementing a set of APIs using Node.js, Express.js framework, and MySQL to manage school data. The Application will allow users to add new schools and retrieve a list of schools sorted by proximity to a user-specified location .
https://github.com/navaneeth-21/educase_assignment
clevercloud expressjs geolib joi-validation mysql-database mysql2 nodejs render-deployment rest-api
Last synced: about 12 hours ago
JSON representation
Implementing a set of APIs using Node.js, Express.js framework, and MySQL to manage school data. The Application will allow users to add new schools and retrieve a list of schools sorted by proximity to a user-specified location .
- Host: GitHub
- URL: https://github.com/navaneeth-21/educase_assignment
- Owner: Navaneeth-21
- License: mit
- Created: 2024-08-25T06:12:27.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-08-26T06:38:42.000Z (4 months ago)
- Last Synced: 2025-01-02T22:46:12.615Z (about 12 hours ago)
- Topics: clevercloud, expressjs, geolib, joi-validation, mysql-database, mysql2, nodejs, render-deployment, rest-api
- Language: JavaScript
- Homepage: https://educase-assignment-lnml.onrender.com
- Size: 32.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NodeJs Assignment
Implementing a set of APIs using Node.js, Express.js framework, and MySQL to manage school data. The Application will allow users to add new schools and retrieve a list of schools sorted by proximity to a user-specified location
- It consists of following endpoints:
- **POST REQUEST** ( '/addschool' ) => Validates the input data and adds a new school to the schools table .
- **GET REQUEST** ('/listschool' ) => Fetches all schools from the database, sorts them based on proximity to the user's location, and returns the sorted list .
- The Application is hosted on render hosting service### Technolgies and Tools :
- NodeJS
- ExpressJS
- MYSQL
- JOI
- Geolib library## Application Setup
1. Clone the repository.
2. Install all the required dependencies
```sh
npm install3. Intially create your database locally on MYSQL workbench or on any cloud provider.
**Database setup**
- Create a schools table in MySQL with the following fields:
- id (Primary Key)
- name (VARCHAR)
- address (VARCHAR)
- latitude (FLOAT)
- longitude (FLOAT)4. Replace the fields in the .env file with your details. which consists of follwing fields :
- DB_HOST
- DB_USER
- DB_PASSWORD
- DB_NAME
5. Run the application
```sh
npm run start6. Navigate to the Link in your Browser