Skip to content
Martin Mendoza edited this page Dec 25, 2024 · 4 revisions

StateForce Documentation

Introduction

Description

StateForce is a platform designed to help Mexican states manage and optimize their emergency resources, such as ambulances, rescue trucks, firefighters, and hospital occupancy. The system aims to enhance decision-making and resource distribution during critical situations.

Objectives

  • Improve the efficiency of emergency resource management.
  • Provide real-time information on resource availability and location.
  • Facilitate planning and operational analysis.

Scope

  • Included:
    • Registration and tracking of emergency resources.
    • Real-time monitoring dashboard.
    • Report generation.
  • Excluded:
    • Direct control of operations or dispatch.

Requirements

Functional Requirements

  • User authentication and role-based access (via email and Google login).
  • Administrative dashboard for resource monitoring.
  • API integration for geolocation and maps.
  • Monthly resource usage reporting.

Non-Functional Requirements

  • Scalability to support multiple states and thousands of resources.
  • Real-time response for critical queries (<1 second).
  • Data security and privacy compliance.

Project Structure

Architecture

  • Backend: Ruby on Rails
  • Database: PostgreSQL
  • Frontend: (IDK)
  • APIs: (IDK)

High-Level Diagram

(User Flow)


Database Design

Entity-Relationship Diagram

(Diagram)

Key Tables

  • Users: Handles authentication and roles.
  • Resources: Stores information on emergency resources.
  • Incidents: Logs incidents and resource usage.
  • Reports: Tracks historical data and analytics.

Roadmap

Phases

  1. Phase 1: Initial setup, authentication, and user management.
  2. Phase 2: Resource registration and real-time monitoring.
  3. Phase 3: Integration with geolocation and maps.
  4. Phase 4: Reporting and data analysis.

Tasks

  • Set up Devise for email and Google authentication.
  • Design initial database schema.
  • Develop API for resource registration and queries.

Use Cases

Example Scenarios

  1. Administrator Monitoring: View available ambulances in a specific area.
  2. Incident Reporting: Log and track the resources deployed to a rescue mission.
  3. Report Generation: Generate a monthly report on resource usage.

Collaboration Guidelines

Contributing

  • Clone the repository: git clone <repo-url>
  • Install dependencies: bundle install
  • Set up the database: rails db:setup

Coding Standards

  • Follow Ruby style guide conventions.
  • Use meaningful commit messages.
  • Write tests for new features.

Maintenance

Updates and Monitoring

  • Regularly update dependencies.
  • Run tests before deploying new features.
  • Monitor application performance using tools like New Relic or Skylight.

Backup Policy

  • Schedule daily database backups.
  • Store backups securely in cloud storage.

Tools

Diagram Tools

  • Lucidchart: For architecture and database diagrams.
  • dbdiagram.io: For database schema.

Task Management

  • GitHub Projects: Organize tasks using Kanban boards.
  • Trello or Notion: For detailed planning.

Documentation

  • GitHub Wiki: Structure and store all project documentation.
  • Markdown Files: Use .md files for quick guides and README updates.

πŸ“š StateForce Wiki Sidebar

Welcome to the StateForce Wiki! Use this sidebar to navigate through the documentation.


🏠 Home


πŸ›  System Design


πŸ—„ Database


🎨 Design & Style


🚦 User Workflows


πŸ§ͺ Testing


πŸ“Ž Others

This sidebar provides quick access to all the documentation pages. For detailed information, click on the desired section.

Clone this wiki locally