- Node.js (16.x)
- NPM
- TypeScript, Express.js
- Git
- Docker - Install Docker community edition optional.
🎁 If you are a big fan of docker, just don't wait and pull the docker image by following the commands:
docker pull sazal/ts-geofeatures-bbox-backend:1.0.0.RELEASE
Let's clone the repository on your machine.
The application includes the following files and folders.
src
- code for the application written in TypeScript, Express.js.cli
- node cli script which can be performed from terminal.__tests__
- to test all the features..env.example
- a sample of .env which can be helpful for configuration.
# architecture
# deep drive in src directory
src/
├── controllers/
│ └── geo.controller.ts
├── routes/
│ └── geo.ts
├── services/
│ ├── geo.ts
│ └── openstreetmap.ts
├── dto/
│ └── geo.dto.ts
├── types/
│ └── index.ts
├── lib/
│ └── helpers.ts
├── app.ts
└── index.ts
Let's move to the cloned directory with your terminal.
To install, build, and start the application for the first time, run the following commands in your shell using makefile
(only for macOS and Linux):
make install
Let's rename from .env.example
to .env
and make sure all the necessary information is correct:
PORT=3000
Already done? Cool! You are almost ready to enjoy the app. ⛳️
make build
make start
GET /geo/features?bbox=6.883,51.4243,6.8933,51.4326
# try the api with postman
# port 3000
http://localhost:3000/geo/features?bbox=6.883,51.4243,6.8933,51.4326
Oh! You wanna trigger unit testing for the application from terminal
make test
make test-unit
make lint
make lintfix
To learn more, you can use the following commands:
make help
npm i
npm run build
npm run start
npm run test
- Author - Sazal Ahamed