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
- π³ 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
$ 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
## Endpoints
<details>
<summary><code>GET</code> <code><b>/?lat=35.98&lon=140.33&key=your_key</b></code> <code>(gets the air quality by lat,lon)</code></summary>
##### Parameters
> | name | type | data type | description |
> |--------|------------|----------------|------------------------------------------------------|
> | `lat` | required | string | The latitude |
> | `lon` \ required | string | the logitude |
> | `key` \ required | string | the api key ,gotten from IQAir
##### Responses
> | 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."}` |
##### Example cURL
> ```javascript
> curl -X GET -H "Content-Type: application/json" http://localhost:3004/api/nearest_city?lat=35.98&lon=140.33&key=your_api_key
> ```
</details>
## Improvements
- 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
## π License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for more information.