Skip to content

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 .

License

Notifications You must be signed in to change notification settings

Navaneeth-21/Educase_Assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

    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

    npm run start
    
  6. Navigate to the Link in your Browser

About

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 .

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published