https://github.com/amytho/shull-weather
Webserver for handling weather data
https://github.com/amytho/shull-weather
Last synced: 29 days ago
JSON representation
Webserver for handling weather data
- Host: GitHub
- URL: https://github.com/amytho/shull-weather
- Owner: aMytho
- Created: 2021-10-19T01:13:23.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-12-21T17:15:08.000Z (over 4 years ago)
- Last Synced: 2025-11-12T05:34:27.236Z (8 months ago)
- Language: TypeScript
- Size: 926 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
[circleci-url]: https://circleci.com/gh/nestjs/nest
## Description
A webserver for managing weather data. Provides and API and a few basic pages. Built with NestJS.
## Installation
```bash
$ npm install
```
## Database Connection
Create `ormconfig.json` in the root directory. Enter the below data to connect to the server. Make sure to replace your credentials with the ones shown.
```json
{
"type": "mysql",
"host": "IP Address",
"port": 3306,
"username": "username",
"password": "password",
"database": "SkyWeather",
"entities": ["dist/weather/entity/weather.entity.js"],
"synchronize": false
}
```
If you are using docker the default username and password are both root. Copy all other fields from the example ormconfig file.
## Config Options
Create `.env` in the root directory. Enter the below data replacing the values with your own key and zip code.
```env
openWeatherKey = OPEN_WEATHER_KEY_HERE
zipCode = 00601
```
## Database Setup
Move into the docker container.
Example: `docker exec -it shull-weather_db_1 bash`
Connect to the databse.
Example: `mysql -u root -h localhost -p SkyWeather`
Enter the password when prompted.
Copy and paste all of the data in `SkyWeather.sql` into the sql prompt.
Exit the sql prompt.
Example: `exit`
Exit the docker container
Example: `exit`
## Running the app
```bash
# normal start
$ npm run start
# development
$ npm run start:dev
# production mode
$ npm run start:prod
```
## Generate Fake Data
While the server is running head to /weather/api/mock. This will generate one entry for each request.