š¦ļø WeatherScope - Zorynth Radar
Meteorological Insights & Weather Operations Console
A comprehensive, feature-rich weather application that provides real-time meteorological data, personalized alerts, and advanced weather intelligence for users worldwide. Built with a modern tech stack combining Express.js backend with an interactive frontend interface.
š Table of Contents
- Features
- Technology Stack
- Prerequisites
- Installation
- Configuration
- Project Structure
- API Documentation
- Database Models
- Usage
- Key Features
- Development
- Deployment
- Contributing
- Troubleshooting
- License
⨠Features
Core Weather Functionality
- Real-time Weather Data: Access current weather conditions, temperature, humidity, wind speed, and more
- 5-Day Forecast: Detailed 5-day weather forecasts for any location
- Air Quality Index (AQI): Monitor air pollution levels and environmental quality
- Meteorological Precision: Advanced atmospheric analysis and weather intelligence
- UV Index Monitoring: Track UV radiation levels for health and safety
User Features
- User Authentication: Secure login and signup with bcryptjs password hashing
- Saved Locations: Bookmark and manage multiple weather locations
- Smart Alerts: Configure custom weather alerts based on:
- Temperature thresholds
- Humidity levels
- Wind speed conditions
- Air Quality Index (AQI)
- Data Export: Export weather data and reports in PDF format
Advanced Intelligence
- Weather Intelligence Dashboard: Atmospheric intelligence analysis
- Meteorological Precision Insights: Deep weather pattern analysis
- Cyclone/Storm Tracking: Monitor severe weather events
- Precipitation Analytics: Detailed rainfall and precipitation forecasts
UI/UX
- Responsive Design: Mobile-first design for all device sizes
- Dark/Light Mode: Seamless theme switching
- Intuitive Dashboard: Centralized weather operations console
- Immersive Landing Page: WebGL 3D visualization with Three.js
- Material Design Symbols: Modern icon system with Google Material Symbols
š ļø Technology Stack
Backend
- Runtime: Node.js (ES Modules)
- Framework: Express.js 4.19.2
- Database: MongoDB with Mongoose 8.3.1
- Authentication: JWT (jsonwebtoken) + bcryptjs
- PDF Generation: PDFKit
- Environment: dotenv for configuration
Frontend
- HTML5 with semantic markup
- CSS Framework: Tailwind CSS with plugins (forms, container queries)
- JavaScript: Vanilla ES6+ with modular components
- UI Components: Custom layouts and reusable components
- 3D Graphics: Three.js for immersive visualizations
- PDF Rendering: jsPDF library (local to prevent tracking prevention issues)
- Fonts: Plus Jakarta Sans, Inter, Sora, Geist
- Icons: Google Material Symbols
Utilities
- Logging: Custom logger middleware for request tracking
- Cookie Management: cookie-parser for session handling
- Development: Nodemon for hot reloading
External APIs
- Weather Data: Third-party Weather API (configured via environment variables)
- Air Quality: AQI data integration
š¦ Prerequisites
Before installation, ensure you have:
- Node.js v14.0.0 or higher
- npm or yarn package manager
- MongoDB instance (local or cloud-based like MongoDB Atlas)
- Weather API Key (from your chosen weather service provider)
- Git for version control
š Installation
1. Clone the Repository
LANG: bashgit clone https://github.com/TheOrionGD/Zorynth-Radar.git cd Zorynth-Radar
2. Install Dependencies
LANG: bashnpm install
This will install all required packages:
- Express and middleware
- Mongoose for database operations
- Authentication libraries
- Development tools (nodemon)
3. Create Environment File
Create a .env file in the root directory:
LANG: bashcp .env.example .env
āļø Configuration
Environment Variables
Set up your .env file with the following variables:
LANG: env# Server Configuration PORT=3000 VITE_PORT=3000 # MongoDB Connection MONGODB_URI=mongodb://localhost:27017/weatherscope # OR for MongoDB Atlas: # MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/weatherscope # Weather API WEATHER_API_KEY=your_weather_api_key_here VITE_WEATHER_API_KEY=your_weather_api_key_here # JWT Configuration JWT_SECRET=your_jwt_secret_key_here JWT_EXPIRE=7d # Node Environment NODE_ENV=development
Database Setup
- Local MongoDB: Ensure MongoDB is running locally
- MongoDB Atlas: Use your connection string from Atlas dashboard
- Database Seeding: Run
dump-db.jsto seed initial data (if available)
LANG: bashnode dump-db.js
š Project Structure
WeatherScope-Web/ āāā public/ # Static frontend files ā āāā index.html # Main HTML entry point ā āāā LOGO.png # Application favicon ā āāā js/ ā āāā api.js # API client utilities ā āāā app.js # Main application logic ā āāā router.js # Frontend routing ā āāā jspdf.umd.min.js # PDF generation ā āāā components/ ā ā āāā layouts.js # Reusable layout components ā āāā views/ # Page components ā āāā dashboard.js # Main dashboard ā āāā city.js # City detail view ā āāā forecast.js # Forecast view ā āāā alerts.js # Alerts management ā āāā locations.js # Saved locations ā āāā search.js # Location search ā āāā export.js # Data export interface ā āāā intelligence.js # Weather intelligence ā āāā cyclone.js # Storm tracking ā āāā wind.js # Wind analysis ā āāā precipitation.js # Rainfall data ā āāā uv.js # UV index ā āāā vault.js # Data vault ā āāā settings.js # User settings ā āāā login.js # Authentication ā āāā signup.js # User registration ā āāā landing.js # Landing page ā āāā splash.js # Splash screen ā āāā support.js # Help & support ā āāā src/ # Backend source code ā āāā middleware/ ā ā āāā auth.js # JWT authentication middleware ā āāā models/ # Mongoose schemas ā ā āāā User.js # User model ā ā āāā Alert.js # Weather alerts model ā ā āāā SavedLocation.js # Bookmarked locations ā ā āāā WeatherSnapshot.js # Historical weather data ā āāā routes/ # API endpoints ā ā āāā auth.js # Authentication routes ā ā āāā user.js # User profile routes ā ā āāā weather.js # Weather data routes ā ā āāā locations.js # Location management routes ā ā āāā alerts.js # Alert configuration routes ā ā āāā export.js # Data export routes ā āāā utils/ ā āāā logger.js # Logging utility ā āāā system ui and code/ # UI designs and prototypes ā āāā LANDING/ # Landing page designs ā āāā dashboard_desktop/ # Desktop dashboard UI ā āāā account_settings/ # Settings UI designs ā āāā alerts_desktop/ # Alerts UI ā āāā forecast_enhanced/ # Enhanced forecast designs ā āāā [other UI components] # Various UI mockups ā āāā server.js # Express server entry point āāā dump-db.js # Database seeding script āāā package.json # Project dependencies āāā package-lock.json # Locked dependency versions āāā netlify.toml # Netlify deployment config āāā .env # Environment variables āāā .gitignore # Git ignore rules āāā README.md # This file
š” API Documentation
Base URL
http://localhost:3000/api
Authentication Endpoints
POST /auth/signup
Register a new user account.
Request Body:
LANG: json{ "email": "user@example.com", "password": "securePassword123", "name": "John Doe" }
Response:
LANG: json{ "success": true, "token": "jwt_token_here", "user": { "_id": "userId", "email": "user@example.com", "name": "John Doe" } }
POST /auth/login
Authenticate user and receive JWT token.
Request Body:
LANG: json{ "email": "user@example.com", "password": "securePassword123" }
POST /auth/logout
Logout user and invalidate session.
Weather Endpoints
GET /weather/:city
Get current weather for a specific city.
Parameters: city (string) - City name
Response:
LANG: json{ "success": true, "data": { "city": "London", "temperature": 15.5, "humidity": 72, "windSpeed": 12, "condition": "Partly Cloudy", "aqi": 45 } }
GET /weather/:city/forecast
Get 5-day weather forecast.
Parameters: city (string) - City name
GET /weather/:city/aqi
Get Air Quality Index data.
Location Endpoints
GET /locations
Get all saved locations (requires authentication).
POST /locations
Add a new saved location.
Request Body:
LANG: json{ "name": "My Home", "latitude": 51.5074, "longitude": -0.1278, "city": "London" }
DELETE /locations/:id
Remove a saved location.
Alert Endpoints
GET /alerts
Get all configured alerts for the user.
POST /alerts
Create a new weather alert.
Request Body:
LANG: json{ "cityName": "London", "metric": "temp", "condition": "greater_than", "threshold": 30, "isActive": true }
Supported Metrics:
temp- Temperaturehumidity- Humidity percentagewind_speed- Wind speedaqi- Air Quality Index
Supported Conditions:
greater_than- Alert when value exceeds thresholdless_than- Alert when value falls below threshold
DELETE /alerts/:id
Deactivate or delete an alert.
Export Endpoints
POST /export/pdf
Generate and download weather data as PDF.
Request Body:
LANG: json{ "city": "London", "format": "detailed", "includeAlerts": true, "includeForecast": true }
User Endpoints
GET /user/profile
Get current user profile (requires authentication).
PUT /user/profile
Update user profile information.
Request Body:
LANG: json{ "name": "John Doe", "email": "newemail@example.com", "preferences": { "tempUnit": "celsius", "theme": "dark" } }
šļø Database Models
User Model
LANG: javascript{ _id: ObjectId, name: String, email: String (unique), password: String (hashed with bcryptjs), preferences: { tempUnit: "celsius" | "fahrenheit", speedUnit: "kmh" | "mph", theme: "light" | "dark" }, createdAt: Date, updatedAt: Date }
SavedLocation Model
LANG: javascript{ _id: ObjectId, userId: ObjectId (reference to User), name: String, city: String, latitude: Number, longitude: Number, isPrimary: Boolean, createdAt: Date, updatedAt: Date }
Alert Model
LANG: javascript{ _id: ObjectId, userId: ObjectId (reference to User), cityName: String, metric: "temp" | "humidity" | "wind_speed" | "aqi", condition: "greater_than" | "less_than", threshold: Number, isActive: Boolean, triggeredCount: Number, lastTriggeredAt: Date, createdAt: Date, updatedAt: Date }
WeatherSnapshot Model
LANG: javascript{ _id: ObjectId, userId: ObjectId (reference to User), city: String, latitude: Number, longitude: Number, temperature: Number, humidity: Number, windSpeed: Number, condition: String, aqi: Number, uvIndex: Number, timestamp: Date, createdAt: Date }
š» Usage
Starting the Application
Development Mode (with hot reload):
LANG: bashnpm run dev
Production Mode:
LANG: bashnpm start
The application will be accessible at http://localhost:3000
Typical User Workflow
- Sign Up/Login: Create account or authenticate
- Search Cities: Search for weather in different cities
- Save Locations: Bookmark favorite locations for quick access
- View Weather: Check current conditions and forecasts
- Configure Alerts: Set up notifications for weather changes
- Export Data: Generate PDF reports of weather data
- Check Intelligence: View advanced weather analysis
šÆ Key Features Explained
1. Meteorological Precision
Provides detailed atmospheric analysis with advanced weather modeling for precise forecasting.
2. Weather Intelligence
AI-powered insights into weather patterns, including trend analysis and predictive intelligence.
3. Smart Alerts System
Multi-threshold alert system that monitors:
- Temperature fluctuations
- Humidity changes
- Wind speed variations
- Air quality degradation
4. Cyclone Tracking
Real-time monitoring of severe weather events and storm systems with trajectory prediction.
5. Data Vault
Secure storage of historical weather data with archival and retrieval capabilities.
6. PDF Export
Generate formatted PDF reports of weather data for documentation and sharing.
š ļø Development
Running in Development Mode
LANG: bashnpm run dev
This starts the server with Nodemon, which automatically restarts on file changes.
Available Scripts
LANG: bash# Start production server npm start # Start development server with auto-reload npm run dev # Seed database with sample data node dump-db.js
Code Style
- Backend: ES6+ with modular structure
- Frontend: Vanilla JavaScript with component-based architecture
- Naming: camelCase for variables and functions, PascalCase for classes/models
- Comments: JSDoc for complex functions
Adding New Routes
- Create route file in
src/routes/ - Define endpoints with proper HTTP methods
- Add authentication middleware where needed
- Register route in
server.js
Example:
LANG: javascript// src/routes/newfeature.js import express from "express"; import { protect } from "../middleware/auth.js"; const router = express.Router(); router.get("/", protect, async (req, res) => { // Your logic here }); export default router;
Then in server.js:
LANG: javascriptimport newFeatureRoutes from "./src/routes/newfeature.js"; app.use("/api/newfeature", newFeatureRoutes);
š Deployment
Netlify Deployment
Configuration is provided in netlify.toml. Deploy using:
LANG: bash# Build and deploy npm run build netlify deploy # OR deploy from Git # Connect repository to Netlify dashboard
Environment Variables in Production
Set the following environment variables in your deployment platform:
MONGODB_URI- Production MongoDB connection stringWEATHER_API_KEY- API key for weather dataJWT_SECRET- Secure JWT signing keyNODE_ENV=production
Docker Deployment
Create a Dockerfile:
LANG: dockerfileFROM node:18-alpine WORKDIR /app COPY package*.json ./ RUN npm ci --only=production COPY . . EXPOSE 3000 CMD ["npm", "start"]
Build and run:
LANG: bashdocker build -t weatherscope . docker run -p 3000:3000 --env-file .env weatherscope
š¤ Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Code Standards
- Write descriptive commit messages
- Include comments for complex logic
- Test functionality before submitting PR
- Update documentation as needed
š Troubleshooting
Common Issues
MongoDB Connection Error
Error: connect ECONNREFUSED 127.0.0.1:27017
Solution: Ensure MongoDB is running
LANG: bash# For local MongoDB mongod # OR use MongoDB Atlas connection string in .env
Missing API Key
Error: WEATHER_API_KEY is not defined
Solution: Add WEATHER_API_KEY to .env file
Port Already in Use
Error: listen EADDRINUSE: address already in use :::3000
Solution: Change port in .env or kill existing process
LANG: bash# Find and kill process on port 3000 lsof -i :3000 kill -9 <PID>
JWT Authentication Failures
Solution: Ensure JWT_SECRET is set in .env and tokens haven't expired
Debugging
Enable verbose logging:
LANG: bashDEBUG=* npm run dev
Check MongoDB connection:
LANG: bashnode -e "import mongoose from 'mongoose'; mongoose.connect(process.env.MONGODB_URI).then(() => console.log('Connected')).catch(err => console.error(err))"
š License
This project is licensed under the MIT License - see LICENSE file for details.
š Support
For issues, questions, or suggestions:
- GitHub Issues: Open an issue
- Discussions: Start a discussion
- Email: Support through GitHub profile
š Acknowledgments
- Three.js for 3D visualization capabilities
- Tailwind CSS for modern styling framework
- MongoDB for robust database solution
- Express.js for lightweight backend framework
- Weather API providers for real-time data
Made with ā¤ļø by TheOrionGD
Last Updated: June 2026
š Quick Links
Topics: weather, meteorological, dashboard, nodejs, express, weather-app