ASROY is a premium, real-time Relief and Disaster Management System designed to coordinate emergency volunteer activities, resource distribution, and agency communications across Bangladesh. Built with a modern, high-fidelity user interface, ASROY connects relief organizations with system administrators to expedite crisis response.
An intelligent Disaster Operations Analyst & General AI Chatbot integrated directly into the platform to assist administrators and organizations:
- Multi-Provider AI Fallback Engine:
- Custom AI Router: Integrates with custom OpenAI-compatible gateways (
AI_API_ENDPOINT, e.g.https://router.bynara.id/v1). - OpenRouter API Support: Supports OpenRouter keys (
VITE_OPENROUTER_API_KEY) with models likemeta-llama/llama-3.3-70b-instruct,google/gemini-flash-1.5,openai/gpt-4o-mini, anddeepseek-r1. - Google Gemini AI Studio: Direct client integration with
gemini-3.6-flashandgemini-3.5-flash(VITE_GEMINI_API_KEY).
- Custom AI Router: Integrates with custom OpenAI-compatible gateways (
- Live Real Database Intelligence:
- Directly queries live Supabase database views and tables (
all_shelters,all_events,goods,volunteer,donation) to compute real-time capacity metrics, stock shortages, active responder counts, and donation totals.
- Directly queries live Supabase database views and tables (
- Dual Operational & General Chatbot Capabilities:
- Operational Queries & Prompt Cards: Generates live summaries for Dashboard Summary, Low Stock Audits, Overcrowded Shelters tracking, and Daily Briefing exports.
- General Knowledge & Task Resolver: Direct, accurate responses for general queries (coding tasks, technical support, science, math, literature, and general advice).
- Premium Multi-Session Chat UI:
- ChatGPT/Gemini Style Sidebar: A left-hand history panel showing previous chat sessions.
- "+ New Chat Thread" Button: Clears current dialogue and opens a fresh workspace.
- Dynamic Session Renaming: Automatically renames thread titles to match the topic of your first query.
- User-Scoped Isolation: Scopes chat history to the logged-in user's UID (
asroy_ai_sessions_${userId}). - Custom Markdown-to-HTML Parser: Renders markdown formatting, bold text, lists, and responsive tables.
- Relief Stream: A global chat room for all registered organizations and system administrators to coordinate logistics and announcements.
- Support Desk: Direct messaging channel for organizations to contact Super Admins for support.
- Peer-to-Peer Messaging: Secure direct message threads between active relief organizations.
- Rich Messaging Features:
- Optimistic UI Updates: Message delivery, editing, reactions, and deletions reflect instantly.
- Attachment Sharing: Upload images and documents with Base64 fallback.
- Interactive Reactions: Emoji reaction badges (
👍,❤️,⚠️,🚨,👏,🔥). - Message Lifecycle: Inline editing with
(edited)badge and soft-deletion overlays.
- Distinct Module Icons: Every sidebar section (Overview, Organizations, Monitor Events, Shelters, Volunteers, Donations, Inventory, Reports & Export, User Accounts, Audit Logs, Alert Feed, System Settings, Emergency Control, Communication, AI Assistant) features a unique vector SVG icon.
- Exact Route Highlighting: Prevents prefix matching so links highlight strictly on active routes.
- Disaster Registry: Log and monitor active events (Floods, Cyclones, Earthquakes, Landslides, Droughts, Fires).
- Interactive Map Spread: Leaflet-powered GIS map of Bangladesh showing geographic spread of active disaster zones.
- Status Controls: Toggle event statuses between
ActiveandNot Activewith real-time alerts.
- Occupancy Metrics: Monitor total bed capacities vs. current occupancy numbers in real time.
- Beds Available Counter: Dynamically computes and displays remaining vacancy counts.
- Overcapacity Warns: Visual indicators highlight shelters operating beyond safety limits.
- Donation Logbook: Detailed logs of cash (Tk.) and material donations, tracking donors, contacts, and organizations.
- Supply Distribution: Allocate donation items directly to shelters located in active disaster areas.
- Automated Stock Adjustments: Database triggers increase inventory counts when material donations are logged.
- Low Stock Alerts: Automatically triggers a platform warning when any commodity drops below
20units.
- Volunteer Registry: Manage volunteers, gender metrics, age verification, and crisis skill sets.
- Task Assignment: Distribute volunteers to active missions (
Relief Distribution,Rescue,Reconstruction).
- Broadcast Composer: Super Admins compose and broadcast warning banners to all logged-in organizations.
- Severity Levels: Select alert urgency (
🚨 Critical,⚠️ Warning,ℹ️ Info) controlling banner styling and audio prompts.
ASROY is built using a modern, multi-tier serverless architecture that decouples client interfaces from database access controls and AI execution loops.
graph TD
Client[React Frontend - Vite/Leaflet] <-->|Realtime WebSockets| SupabaseRealtime[Supabase Realtime Channel Engine]
Client -->|REST & GraphQL HTTP API| SupabaseDatabase[(PostgreSQL DB + RLS + Triggers)]
Client -->|HTTP Authorization Bearer Token| EdgeFunction[Deno Edge Function - ai-chat]
Client -->|API Integration| AIProviders[OpenRouter / Google Gemini Studio / Custom AI Gateway]
subgraph Supabase Serverless Backend
EdgeFunction -->|JWT Verification| SupabaseAuth[Supabase Auth]
EdgeFunction -->|Contextual DB Queries with User RLS| SupabaseDatabase
end
- Frontend: React.js, Vite, React Router DOM, Leaflet (GIS Maps), Lucide Icons, Vanilla CSS (Glassmorphism & dark themes).
- Backend & Database: Supabase (PostgreSQL with RLS, Supabase Auth, Real-time channels, Supabase Storage, Deno Edge Functions).
- AI Integration: OpenRouter API, Google Gemini AI Studio (
gemini-3.6-flash), Bynara Custom AI Gateway.
- Node.js (v18 or higher)
- A Supabase account and database project instance
git clone https://github.com/arifulmist/ASROY_Relief-Management-System.git
cd ASROY_Relief-Management-SystemCreate a .env file inside the Frontend/ folder:
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
VITE_OPENROUTER_API_KEY=your_openrouter_api_key
VITE_GEMINI_API_KEY=your_gemini_api_keyOpen the SQL Editor in your Supabase Dashboard and execute the SQL statements in:
supabase_schema.sql(Database structure, triggers, views, RLS)role_based_security_migration.sql(Security enhancements)messages_migration.sql(Real-time communication logs)
cd Frontend
npm install
npm run devOpen your browser at http://localhost:5173/.