SYS.ID: THEORIONGD
INNOVATE. BUILD. IMPACT.
BACK TO MASTER CATALOG
SPEC-ID: ZORYNTH-RADARDOM: [APPLIED DATA & DOMAIN INTELLIGENCE]DEPLOYED

WeatherScope (Zorynth Radar)

Meteorological Intelligence Console & Weather Operations Alerting System.

TECHNICAL SPECIFICATION SHEETREVISION: 2024
SYSTEM NAME:WeatherScope (Zorynth Radar)
VERIFIED MATURITY:DEPLOYED
DEPLOYMENT CLASSIFICATION:PRODUCTION (Netlify)
DEVELOPMENT YEAR:2024
DOMAIN CATEGORY:Applied Data & Domain Intelligence
SYSTEM PERFORMANCE PARAMETERS:
Data Source:OpenWeather API + Local Hypertables
Exporter:Serverless PDF Report Engine
TECH STACK:ReactNode.jsExpressMongoDBOpenWeather APIPDFKit
SYSTEM ARCHITECTURE & TECHNICAL OVERVIEW

ARCHITECTURAL SPECIFICATION

Operations dashboard retrieving live OpenWeather metrics, AQI indices, and 5-day forecasts. Logs historical snapshots into MongoDB and runs automated alert thresholds with custom PDF report generation.

ORIGINAL REPOSITORY DOCUMENTATION (README)
README DOCUMENT

šŸŒ¦ļø 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.

GitHub License Node.js Version Express Version


šŸ“‹ Table of Contents


✨ 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: bash
git clone https://github.com/TheOrionGD/Zorynth-Radar.git
cd Zorynth-Radar

2. Install Dependencies

LANG: bash
npm 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: bash
cp .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

  1. Local MongoDB: Ensure MongoDB is running locally
  2. MongoDB Atlas: Use your connection string from Atlas dashboard
  3. Database Seeding: Run dump-db.js to seed initial data (if available)
LANG: bash
node 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 - Temperature
  • humidity - Humidity percentage
  • wind_speed - Wind speed
  • aqi - Air Quality Index

Supported Conditions:

  • greater_than - Alert when value exceeds threshold
  • less_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: bash
npm run dev

Production Mode:

LANG: bash
npm start

The application will be accessible at http://localhost:3000

Typical User Workflow

  1. Sign Up/Login: Create account or authenticate
  2. Search Cities: Search for weather in different cities
  3. Save Locations: Bookmark favorite locations for quick access
  4. View Weather: Check current conditions and forecasts
  5. Configure Alerts: Set up notifications for weather changes
  6. Export Data: Generate PDF reports of weather data
  7. 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: bash
npm 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

  1. Create route file in src/routes/
  2. Define endpoints with proper HTTP methods
  3. Add authentication middleware where needed
  4. 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: javascript
import 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 string
  • WEATHER_API_KEY - API key for weather data
  • JWT_SECRET - Secure JWT signing key
  • NODE_ENV=production

Docker Deployment

Create a Dockerfile:

LANG: dockerfile
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
EXPOSE 3000
CMD ["npm", "start"]

Build and run:

LANG: bash
docker build -t weatherscope .
docker run -p 3000:3000 --env-file .env weatherscope

šŸ¤ Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'Add AmazingFeature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. 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: bash
DEBUG=* npm run dev

Check MongoDB connection:

LANG: bash
node -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:


šŸ™ 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