Click here to see live demo, or here to see how the whole flow looks on my end 🌦️
A NestJS application that allows users to subscribe to regular weather updates for their chosen cities. Users can select daily or hourly updates and receive emails with current temperature, humidity, and weather descriptions.
-
Framework: NestJS, TypeScript
-
Database: PostgreSQL, TypeORM
-
Email: Nodemailer, mailtrap
-
Scheduling: @nestjs/schedule
-
Container: Docker, Docker Compose
-
Weather Data: WeatherAPI
-
Frontend: HTML, CSS, JavaScript
-
Deployment Render
Endpoint | Method | Description | Errors |
---|---|---|---|
/api/weather?city={city} |
GET | Get current weather for a city | 400 - Missing city parameter404 - City not found500 - API error |
/api/subscribe |
POST | Subscribe to weather updates | 400 - Invalid input409 - Already subscribed500 - Server error |
/api/confirm/{token} |
GET | Confirm subscription | 404 - Invalid/expired token500 - Server error |
/api/unsubscribe/{token} |
GET | Unsubscribe from updates | 404 - Invalid token500 - Server error |
- Clone the repository
git clone https://github.com/ksalpern/weather-subscription-api.git
cd weather-subscription-api/weather-api
- Create .env file and edit it with your values
cp .env.example .env
- Start the app using Docker (recommended)
docker compose -f docker-compose.yml up
- Start the app without Docker
# Install dependencies first
pnpm install
# Run database migrations
pnpm run migration:run
# Start in development mode
pnpm run start:dev
-
3D weather visualization: Implement Three.js for interactive 3D weather elements
-
Beautiful email templates: as now emails are quite ugly 😁
-
Custom confirmation pages: Styled confirmation and unsubscribe success pages
-
Weather alerts: Special notifications for extreme weather conditions
-
Real-time updates: WebSocket support for live weather changes
-
Multiple weather providers: Fallback options if primary API fails
-
Analytics: Track subscription patterns and popular cities