An application that contains a list of locations and the total number of residents in each location broken down by gender.
The project structure follows the MVC (Model-View-Controller) pattern.
├── src
│ ├──tests
│ │ ├── __mockData__
│ │ │ └── index.js
│ │ └── index.test.js
│ ├── config
│ │ └── config.js
│ ├── controllers
│ │ └── PopulationController
│ │ │ └── PopulationController.js
│ ├── helpers
│ │ └── errorHandler.js
│ ├── middlewares
│ │ └── PopulationValidator.js
│ │ migrations
│ │ └── 20190822001741-create-population-management.js
│ │ seeders
│ │ models
│ │ └── index.js
│ │ └── populationmanagement.js
│ └── routes
│ ├── index.js
│ └── locationRoutes.js
│ └── app.js
- Node.js
- npm
- PostgresDB
- Sequelize
$ git clone https://github.com/uchemukolo/populationManagementSystemAPI.git
$ cd populationManagementSystemAPI
$ npm install
$ npm start # For development purpose
You should now be able to access the API via http://localhost:port/api/v1/
NOTE: Create a .env
file configuration following the .env.sample
.
locations:
- create population for a location
- get population for a location
- update a location
- delete a location
HTTP VERB | ENDPOINTS | DESCRIPTION | QUERY |
---|---|---|---|
GET | /api/v1/locations | Gets a location | |
POST | /api/v1/locations | Creates locations | |
PUT | /api/v1/locations/:locationId | Updates a location | |
DELETE | /api/v1/locations/:locationId | Deletes a location |