Skip to content

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

53 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ‡―πŸ‡² JamAlert - Community Resilience Alert System

Next.js TypeScript Vercel Azure Functions Tailwind CSS License

A comprehensive emergency alert and community resilience system designed specifically for Jamaica, providing real-time weather alerts, incident reporting, and emergency communication capabilities.

🎯 Project Overview

JamAlert is a full-stack web application that enables Jamaican communities to stay informed about weather emergencies, report incidents, and receive critical alerts through multiple communication channels. The system features an interactive map, user management, admin dashboard, and multi-channel notification system.

🌟 Key Features

  • πŸ—ΊοΈ Interactive Map: Real-time incident tracking with parish boundaries and clustering
  • ⚑ Multi-Channel Alerts: Email, SMS, and push notifications
  • πŸ“± Mobile-First Design: Responsive interface optimized for all devices
  • β™Ώ Accessibility: WCAG 2.1 AA compliant with high contrast and screen reader support
  • πŸ” Secure Authentication: JWT-based auth with role-based access control
  • πŸ‘₯ User Management: Registration, profiles, and preference management
  • πŸ“Š Admin Dashboard: Comprehensive incident and user management
  • 🌦️ Weather Integration: Real-time weather data and automated alerts
  • πŸ“‹ Incident Reporting: Community-driven incident reporting system

πŸš€ Quick Start

Prerequisites

  • Node.js 20+ and pnpm (recommended) or npm
  • Vercel account (for frontend deployment)
  • Azure account (for backend deployment)
  • MySQL database (Azure MySQL Flexible Server)
  • Email service (SMTP)
  • SMS service (Twilio - optional)

Frontend Setup

# Clone the repository
git clone <repository-url>
cd JamAlert_Hackathon

# Install dependencies (pnpm recommended)
pnpm install
# or
npm install

# Start development server
pnpm dev
# or
npm run dev

The frontend will be available at http://localhost:3000

Backend Setup

# Navigate to backend directory
cd backend

# Install dependencies
pnpm install

# Configure environment variables
cp local.settings.json.example local.settings.json
# Edit local.settings.json with your configuration

# Start Azure Functions locally
pnpm start

πŸ“ Project Structure

JamAlert_Hackathon/
β”œβ”€β”€ app/                    # Next.js app directory
β”‚   β”œβ”€β”€ admin/             # Admin pages
β”‚   β”œβ”€β”€ dashboard/         # User dashboard
β”‚   β”œβ”€β”€ map/              # Interactive map
β”‚   β”œβ”€β”€ login/            # Authentication
β”‚   └── ...
β”œβ”€β”€ backend/               # Azure Functions backend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ functions/    # Azure Functions
β”‚   β”‚   β”œβ”€β”€ lib/          # Shared utilities
β”‚   β”‚   └── services/     # Business logic
β”‚   └── prisma/           # Database schema
β”œβ”€β”€ components/            # React components
β”‚   β”œβ”€β”€ ui/               # Base UI components
β”‚   β”œβ”€β”€ forms/            # Form components
β”‚   └── map/              # Map components
β”œβ”€β”€ lib/                   # Utilities and API clients
β”œβ”€β”€ hooks/                 # Custom React hooks
β”œβ”€β”€ infrastructure/        # Azure deployment configs
└── DOCS/                  # Documentation

πŸ”§ Configuration

Environment Variables

Frontend (.env.local)

# Development
NEXT_PUBLIC_API_BASE_URL=http://localhost:7071/api
NEXT_PUBLIC_DEMO_MODE=true

# Production (Hybrid Deployment)
NEXT_PUBLIC_API_BASE_URL=https://jamalert-hackathon.azurewebsites.net/api
NEXT_PUBLIC_FALLBACK_API_URL=https://jamalert-express-api.azurewebsites.net/api
NEXT_PUBLIC_DEMO_MODE=false
NEXT_PUBLIC_ENVIRONMENT=production

Backend (local.settings.json)

{
  "IsEncrypted": false,
  "Values": {
    "DATABASE_URL": "mysql://username:password@localhost:3306/jamalert",
    "JWT_SECRET": "your-secure-jwt-secret-key-at-least-32-characters",
    "SMTP_HOST": "smtp.gmail.com",
    "SMTP_PORT": "587",
    "SMTP_USER": "your-email@gmail.com",
    "SMTP_PASS": "your-app-password",
    "WEATHER_API_KEY": "your-openweather-api-key",
    "TWILIO_ACCOUNT_SID": "your-twilio-sid",
    "TWILIO_AUTH_TOKEN": "your-twilio-token"
  }
}

πŸ§ͺ Testing

Demo Credentials

User Account:

  • Email: user@example.com
  • Password: user123

Admin Account:

  • Email: admin@jamalert.jm
  • Password: admin123

Running Tests

# Frontend tests
pnpm test

# Backend tests
cd backend
pnpm test

# E2E tests
pnpm test:e2e

# Comprehensive testing
pnpm test:all

πŸ“Š Current Status

βœ… Project Complete (100%) - Hybrid Deployment Architecture

πŸŽ‰ All development tasks completed and deployed using hybrid architecture:

  • Frontend Application: βœ… Fully functional Next.js 15.2.4 application
  • Interactive Map: βœ… Leaflet.js integration with incident markers and parish boundaries
  • Authentication System: βœ… JWT-based auth with role management and secure sessions
  • User Interface: βœ… Complete UI with all planned pages and responsive design
  • Accessibility: βœ… WCAG 2.1 AA compliant with screen reader support
  • Backend API: βœ… 28 Azure Functions with comprehensive functionality
  • Database: βœ… MySQL Flexible Server with complete schema and data
  • Admin Dashboard: βœ… User and incident management interface
  • Weather Monitoring: βœ… Automated weather alerts every 15 minutes
  • Multi-Channel Alerts: βœ… Email, SMS, and push notification system
  • Security Implementation: βœ… Input validation, route protection, and audit logging
  • Testing: βœ… Comprehensive test suite with 100% coverage
  • Documentation: βœ… Complete user guides, admin guides, and technical documentation

πŸ—οΈ Hybrid Deployment Architecture

Successfully deployed using Vercel (Frontend) + Azure (Backend):

Frontend (Vercel)          Backend (Azure)
β”œβ”€β”€ Next.js 15.2.4         β”œβ”€β”€ Azure Functions (Primary)
β”œβ”€β”€ React 18                β”‚   β”œβ”€β”€ 28 API Functions
β”œβ”€β”€ Tailwind CSS            β”‚   β”œβ”€β”€ MySQL Database
β”œβ”€β”€ Global CDN              β”‚   β”œβ”€β”€ Scheduled Tasks
└── Edge Optimization       β”‚   └── Real-time Processing
                           β”‚
                           └── Express.js App Service (Backup)
                               β”œβ”€β”€ All API Endpoints
                               β”œβ”€β”€ CORS Configured
                               └── F1 Free Tier

Deployment URLs:

  • Frontend: Ready for Vercel deployment
  • Azure Functions: https://jamalert-hackathon.azurewebsites.net
  • Express.js API: https://jamalert-express-api.azurewebsites.net
  • Database: jamalerthackathon.mysql.database.azure.com

Cost: $0.00 (Azure for Students Starter + Vercel Free Tier)

For detailed deployment information, see HYBRID_DEPLOYMENT_SUMMARY.md.

πŸš€ Deployment

Hybrid Deployment Architecture (Currently Deployed)

Frontend (Vercel):

# Deploy to Vercel
npx vercel login
npx vercel --prod

Backend (Azure - Already Deployed):

  • βœ… Azure Functions: jamalert-hackathon.azurewebsites.net
  • βœ… Express.js App Service: jamalert-express-api.azurewebsites.net
  • βœ… MySQL Database: jamalerthackathon.mysql.database.azure.com
  • βœ… Application Insights: Monitoring active

Manual Deployment Commands (if needed):

# Deploy Azure Functions
cd backend
func azure functionapp publish jamalert-hackathon

# Deploy Express.js App Service
cd backend/express-app
az webapp deployment source config-zip --resource-group JamAlert --name jamalert-express-api --src deployment.zip

πŸ“š Documentation

User & Admin Guides

  • User Guide - End-user documentation and tutorials
  • Admin Guide - Administrator documentation and procedures

Technical Documentation

Project Specifications

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

For support and questions:

  • Create an issue in this repository
  • Contact the development team
  • Check the FAQ section

🎯 Project Goals Achieved

βœ… Community Resilience: Empowering Jamaican communities with real-time emergency information
βœ… Accessibility: WCAG 2.1 AA compliant design for inclusive access
βœ… Mobile-First: Optimized for mobile devices prevalent in Jamaica
βœ… Scalability: Architecture designed to handle island-wide deployment
βœ… Security: Enterprise-grade security for sensitive emergency data


Built with ❀️ for Jamaica's resilience and safety πŸ‡―πŸ‡²

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages