This is a system that manages the population of states or community
list of libraries, tools, and technologies used.
- express.js - Fast, unopinionated, minimalist web framework for Node.js
- Node.js - A JavaScript runtime environment
- MongoDB - For database services
- A package manager - [NPM
- clone the repo -
https://github.com/DinmaOtutu/population-management-system.git
- Navigate to the project directory and open on any editor, VS Code preferably.
- Install the project dependencies by running
npm Install
- After installation, run
npm test
- To start the server run
npm start
#production - To start the server run
npm run dev
#dev
The project structure follows the MVC (Model-View-Controller) pattern. You can think of the JSON representation of data returned by the API as the 'view'.
├── src/
├── controllers
├── LocationController.js
├── helpers
├── totalPopulation.js
├── middlewares
├── checkLocationExist.js
├── errorHandler.js
├── verifyInputs.js
├── models
├── Location.js
├── repositories
├── BaseRepository.js
├── routers
├── index.js
├── location.js
├── tests
├── location.js
├── utils
├── logger.js
├── app.js
├── README.md
You should now be able to access the API via http://localhost:6666/api/
NOTE: Create a .env
file configuration following the .env.example
.
HTTP VERB | ENDPOINTS | DESCRIPTION |
---|---|---|
POST | /api/location | Creates a new location |
GET | /api/location | Returns available locations |
PUT | /api/location/:id | Updates a location |
DELETE | /api/location/:id | Deletes a location |
https://documenter.getpostman.com/view/4552812/S1Lr5rYz
- Yours truly DinmaOtutu