https://cleanairtracker.kro.kr/
Clean Air Tracker is a website that utilizes the AirKorea OpenAPI from the Korea Environment Corporation to provide real-time air quality information, including particulate matter, fine particulate matter, and ozone. The website is developed using Express, TypeScript, Svelte, PostgreSQL, and TypeORM. Through this site, users can easily check the current air quality status of various regions across the country.
This section details the prerequisites and installation steps needed to get the project running locally.
Clone the project:
git clone https://github.com/krkarma777/CleanAirTracker.git
cd [Cloned Directory Name]
Install necessary packages:
npm install
Create an environment configuration file (.env):
# .env
API_KEY=[Your API key]
Configure the database connection:
Add the ormconfig.js
file to the root of your project directory with the following content:
module.exports = {
type: "postgres",
host: "localhost",
port: 5432,
username: "CleanAirTracker",
password: "root",
database: "CleanAirTracker",
synchronize: true, // Note: set this to false in production to avoid unintended data loss
logging: false,
entities: [
"dist/**/*.entity.js" // Ensure this path matches your compiled files
]
}
This configuration sets up the database connection for your PostgreSQL database. Adjust the settings as necessary to match your environment.
Setting Up HTTPS:
For secure communication, you need to set up HTTPS by obtaining SSL/TLS certificates. Place the following files in your project directory under src/config
:
private.key
: Your private key file.certificate.crt
: Your SSL/TLS certificate.ca_bundle.crt
: Certificate authority bundle.Start the application: To run the server locally, use the following command:
cd svelte-app
npm run build
cd ..
npm run build
npm start
After starting the server, navigate to https://localhost:443
in your web browser to view the Clean Air Tracker site. You can interact with the real-time data and explore different regions' air quality metrics.
Contributions to Clean Air Tracker are welcome. Please consider the following steps:
git checkout -b feature-branch
).git commit -am 'Add some feature'
).git push origin feature-branch
).