This documentation provides details on how to use the Air Quality API to retrieve air quality information for a specific location.
Air quality monitoring stations provide owners with air quality data. Stations throughout a city contribute their combined data to provide overall city air quality data.
- 📱 NestJS — latest version
- 🎉 TypeScript - Type checking
- ⚙️ Dotenv - Supports environment variables
- 🏪 TypeORM - Database ORM
- 🏪 PostgreSQL - Open-Source Relational Database
- 🧠 Configuration - Single config for all
- 📃 Swagger - API Documentation
- 🐳 Docker Compose - Container Orchestration
- 🔐 Helmet - secure HTTP headers
- 📏 ESLint — Pluggable JavaScript linter
- 💖 Prettier - Opinionated Code Formatter
- ✨ Commitlint - Lint your conventional commits
- 🕵️♂️ Code Scanning - Code scanning with CodeQL
bash ./setup.sh
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
GET
/?lat=35.98&lon=140.33&key=your_key
(gets the air quality by lat,lon)
name type data type description lat
required string The latitude lon
\ requiredstring the logitude key
\ requiredstring the api key ,gotten from IQAir
http code content-type response 200
application/json
{"status": "success","Result": {"pollution": {"ts": "2023-06-09T05:00:00.000Z","aqius": 3, "mainus": "n2","aqicn": 9,"maincn": "n2"}}}
401
application/json
{"status":"incorrect_api_key","message":"Incorrect API key."}
curl -X GET -H "Content-Type: application/json" http://localhost:3004/api/nearest_city?lat=35.98&lon=140.33&key=your_api_key
- Add more test
- improve documentaion on the bonus endpoint to get the date for the most concentarted time of day
- use bullmq instead of the plain schedule module from nest js
This project is licensed under the MIT License - see the LICENSE.md file for more information.