Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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 .

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 install

3. 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 start

6. Navigate to the Link in your Browser