Skip to content

pkparthk/Global-Development-Pulse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

47 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Global Development Pulse 🌍

A comprehensive full-stack web application that transforms World Bank development indicators into interactive visualizations. Built with modern technologies including React, TypeScript, Django, and MongoDB, featuring real-time data fetching, user authentication, and responsive design.

πŸ“Έ Screenshots

Dashboard Overview

Dashboard Interactive dashboard with country selection and indicator filters

Signup & Authentication

SignUp Secure user authentication with JWT tokens

Chart Visualizations

Charts Multiple chart types with responsive design

🌟 Key Features

🎯 Core Functionality

  • Interactive Dashboard: Rich visualizations of global development indicators
  • Real-time Data: Direct integration with World Bank Open Data API
  • User Authentication: Secure JWT-based login/registration system
  • Responsive Design: Optimized for desktop, tablet, and mobile devices
  • Data Export: Export charts as PNG and data as CSV/JSON
  • URL State Management: Shareable URLs with persistent filter states

πŸ“Š Advanced Analytics

  • Multiple Chart Types: Line charts for trends, bar charts for comparisons
  • Smart Filtering: Multi-country selection, date ranges, per-capita toggles
  • Scale Options: Linear and logarithmic scale support
  • Interactive Elements: Zoom, pan, hover tooltips, and data point selection
  • Comparison Tools: Side-by-side country and indicator analysis

⚑ Performance & Reliability

  • Multi-layer Caching: Redis + MongoDB caching for optimal performance
  • Error Recovery: Comprehensive error handling with retry mechanisms
  • Rate Limiting: API throttling and request optimization
  • Offline Support: Cached data availability when API is unavailable
  • Real-time Updates: Automatic data refresh and background sync

πŸ—οΈ Architecture Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                 β”‚    β”‚                 β”‚    β”‚                 β”‚
β”‚   React Frontend│◄──►│ Django Backend  │◄──►│ World Bank API  β”‚
β”‚   (TypeScript)  β”‚    β”‚   (Python)      β”‚    β”‚                 β”‚
β”‚                 β”‚    β”‚                 β”‚    β”‚                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                       β”‚
         β”‚                       β–Ό
         β”‚              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
         β”‚              β”‚                 β”‚
         └───────────────   MongoDB +     β”‚
                        β”‚   Redis Cache   β”‚
                        β”‚                 β”‚
                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Technology Stack

Frontend (/frontend)

Technology Purpose
React UI Framework
TypeScript Type Safety
Vite Build Tool & Dev Server
TailwindCSS Styling & Design System
React Query Data Fetching & Caching
React Hook Form Form Management
Recharts Chart Visualizations
Zustand State Management
React Router Client-side Routing

Backend (/backend)

Technology Purpose
Django Web Framework
Django REST Framework API Development
MongoDB Primary Database
Redis Caching Layer
Gunicorn WSGI Server
JWT Authentication
Requests HTTP Client

DevOps & Deployment

  • Render for production hosting
  • MongoDB Atlas for managed database
  • GitHub Actions for CI/CD

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ and npm
  • Python 3.11+
  • Git
  • Docker (optional, for containerized setup)

Option 1: Development Setup (Recommended)

1. Clone the Repository

git clone https://github.com/pkparthk/Global-Development-Pulse.git
cd Global-Development-Pulse

2. Backend Setup

cd backend

# Create virtual environment
python -m venv .venv

# Activate virtual environment
# Windows:
.venv\Scripts\activate
# macOS/Linux:
source .venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Run database migrations
python manage.py migrate


# Start development server
python manage.py runserver

3. Frontend Setup

# In a new terminal
cd frontend

# Install dependencies
npm install

# Create environment file
cp .env.example .env  # Edit with your settings

# Start development server
npm run dev

4. Access the Application

πŸ“ Project Structure

Global-Development-Pulse/
β”œβ”€β”€ πŸ“ frontend/                 # React TypeScript frontend
β”‚   β”œβ”€β”€ πŸ“ src/
β”‚   β”‚   β”œβ”€β”€ πŸ“ components/       # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ πŸ“ pages/           # Route-level pages
β”‚   β”‚   β”œβ”€β”€ πŸ“ services/        # API services & queries
β”‚   β”‚   β”œβ”€β”€ πŸ“ store/           # State management
β”‚   β”‚   β”œβ”€β”€ πŸ“ types/           # TypeScript definitions
β”‚   β”‚   └── πŸ“ utils/           # Helper functions
β”‚   β”œβ”€β”€ πŸ“„ package.json
β”‚   β”œβ”€β”€ πŸ“„ vite.config.ts
β”‚   └── πŸ“„ tailwind.config.js
β”œβ”€β”€ πŸ“ backend/                  # Django Python backend
β”‚   β”œβ”€β”€ πŸ“ api/                 # Main API application
β”‚   β”‚   β”œβ”€β”€ πŸ“ services/        # External API integrations
β”‚   β”‚   β”œβ”€β”€ πŸ“„ models.py        # Database models
β”‚   β”‚   β”œβ”€β”€ πŸ“„ views.py         # API endpoints
β”‚   β”‚   └── πŸ“„ serializers.py   # Data serialization
β”‚   β”œβ”€β”€ πŸ“ project/             # Django project settings
β”‚   β”œβ”€β”€ πŸ“„ manage.py
β”‚   └── πŸ“„ requirements.txt
β”œβ”€β”€ πŸ“„ render.yaml             # Deployment configuration
└── πŸ“„ README.md               # Project documentation

πŸ”§ Configuration

Environment Variables

Backend (backend/.env)

# Django Configuration
DJANGO_SECRET_KEY=your-secret-key-here
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1,your-domain.com

# Database Configuration
MONGODB_URI=mongodb://localhost:27017
MONGODB_NAME=global_development_pulse

# External APIs
WORLD_BANK_API_BASE=https://api.worldbank.org/v2

# Cache Configuration
REDIS_URL=redis://localhost:6379/0
CACHE_TTL=3600

# Authentication
JWT_ACCESS_TOKEN_LIFETIME=60
JWT_REFRESH_TOKEN_LIFETIME=1440

Frontend (frontend/.env)

# API Configuration
VITE_API_BASE_URL=http://localhost:8000

# Application Configuration
VITE_APP_NAME=Global Development Pulse
VITE_APP_VERSION=1.1.0
VITE_NODE_ENV=development

# Development Tools
VITE_ENABLE_REACT_QUERY_DEVTOOLS=true

πŸ“š API Documentation

Authentication Endpoints

Register User

POST /api/auth/register/
Content-Type: application/json

{
  "username": "testuser",
  "email": "test@example.com",
  "first_name": "Test",
  "last_name": "User",
  "password": "testpass@1",
  "password_confirm": "testpass@1"
}

Login

POST /api/auth/login/
Content-Type: application/json

{
  "username": "testuser",
  "password": "testpass@1"
}

Data Endpoints

Get Countries

GET /api/countries/
Authorization: Bearer <access_token>

Get Indicators

GET /api/indicators/
Authorization: Bearer <access_token>

Get Time Series Data

GET /api/series/?indicator=NY.GDP.MKTP.CD&countries=USA,CHN,DEU&start=2010&end=2020
Authorization: Bearer <access_token>

Get Snapshot Data

GET /api/snapshot/?indicator=NY.GDP.MKTP.CD&countries=USA,CHN,DEU&year=2020
Authorization: Bearer <access_token>

πŸš€ Deployment

Production Deployment (Render)

1. Prepare for Deployment

# Update dependencies
pip freeze > backend/requirements.txt
npm run build  # Frontend build

# Set production environment variables in Render dashboard

2. Backend Deployment

  • Connect GitHub repository to Render
  • Create a Web Service with:
    • Build Command: python -m pip install -r backend/requirements.txt
    • Start Command: cd backend && python manage.py migrate && python manage.py collectstatic --noinput && gunicorn project.wsgi:application
    • Environment: Python 3.12

3. Frontend Deployment

  • Create a Static Site with:
    • Build Command: cd frontend && npm install && npm run build
    • Publish Directory: frontend/dist

4. Database Setup

  • Create MongoDB Atlas cluster
  • Configure connection string in environment variables
  • Run initial data migration

πŸ” Monitoring & Debugging

Application Monitoring

  • Django Admin: /admin/ - Database management
  • API Health: /api/health/ - System status
  • React Query DevTools: Development data fetching insights

Performance Optimization

# Backend profiling
python manage.py runserver --nostatic

# Frontend bundle analysis
npm run build --analyze

# Database query optimization
python manage.py debugsqlshell

Git Workflow

# 1. Create feature branch
git checkout -b feature/amazing-feature

# 2. Make changes and commit
git add .
git commit -m "feat: add amazing feature"

# 3. Push and create PR
git push origin feature/amazing-feature

πŸ”’ Security Features

  • JWT Authentication: Secure token-based auth with refresh mechanism
  • CORS Protection: Strict origin allowlisting
  • Input Validation: Comprehensive request validation with serializers
  • Rate Limiting: API throttling (100 requests/minute for authenticated users)
  • Environment Variables: All secrets externalized
  • HTTPS Enforcement: End-to-end encryption in production

🀝 Contributing

Development Workflow

  1. Fork the repository

  2. Create a feature branch

    git checkout -b feature/amazing-feature
  3. Make your changes

    • Follow coding standards
    • Add tests for new features
    • Update documentation
  4. Test your changes

    # Backend
    cd backend && python manage.py test
    
    # Frontend
    cd frontend && npm test
  5. Commit and push

    git commit -m "Add amazing feature"
    git push origin feature/amazing-feature
  6. Open a Pull Request

πŸ“Š Performance Metrics

  • Backend Response Time: < 200ms average
  • Frontend Load Time: < 3s initial load
  • Cache Hit Rate: > 80% for API requests
  • Database Query Time: < 50ms average
  • Bundle Size: < 500KB gzipped

πŸ™ Acknowledgments

  • World Bank Open Data - For providing comprehensive development indicators
  • Django & React Communities - For excellent documentation and support
  • Open Source Contributors - For the amazing tools and libraries used

Built with ❀️ for global development insights

Live Demo β€’ Report Bug

About

Highly configurable interactive dashboard for global development indicators with polished, responsive charts.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors