https://github.com/ansinitro/weather_website_2
https://github.com/ansinitro/weather_website_2
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ansinitro/weather_website_2
- Owner: ansinitro
- Created: 2024-02-12T17:49:50.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-29T09:44:06.000Z (about 1 year ago)
- Last Synced: 2025-01-23T21:19:31.481Z (4 months ago)
- Language: EJS
- Size: 9.12 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Weather App
This Weather App provides current weather, 3-hour forecast, 14-day extended forecast and city-related information for cities around the world.
The app defaults to displaying weather information for 'Almaty' on the first visit. Users can then input their preferred city.### Prerequisites
Before you begin, ensure you have the following installed:
- Node.js
- npm (Node Package Manager)### Run Website
```bash
git clone https://github.com/AnsiLucky/Weather_Website_2
cd Weather_Website_2
npm install
node server.js
```by default server will start at `http://localhost:3000`
## For Admin Status
`localhost:3000/admin` - by default
- login : `[email protected]`
- password : `admin_123`## APIs Used
1. **OpenWeatherMap API**
- Endpoint: `http://api.openweathermap.org/data/2.5/forecast`
- Usage: Weahter Info
2. **Visual Crossing**
- Endpoint: `https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/`
- Usage: Weahter Info
3. **City Info API Dev Me**
- Endpoint: `https://dev.me/api/module-app/v1-get-city-details?name=${city}`
- Usage: City Info
4. **Source Unsplash API**
- Endpoint: `https://source.unsplash.com/1600x900`
- Usage: Random Photos from city## File Structure
The project has the following folder structure:
- `config` : Stores configuration.
- `utils` : Utilits which help retrive the information.
- `models` : Models of MongoDB.
- `public` : Contains static files (CSS, images, js).
- `routers` : Routes for sertain endpoints.
- `views` : HTML templates for rendering pages.## Dependencies
- `bcrypt` : encryption the password
- `cors` : zhai na vsyaki
- `ejs` : rendering the templates
- `express` : server
- `express-flash` : flash the messages
- `express-session` : session-cookies
- `mongoose` : mongoDB
- `pdfkit` : PDF creater
- `dotenv` : environment variables