Skip to content

Repository files navigation

Pinpoint

A comprehensive event management and emergency response platform designed for large-scale venues. Pinpoint combines a React Native mobile app with a Node.js backend to provide real-time crowd management, medical staff coordination, and incident reporting capabilities.

Features

  • Real-time Event Management: Create and manage events at multiple venues
  • Crowd Analytics: Monitor crowd density and movement patterns
  • Medical Staff Coordination: Dispatch and track medical personnel
  • Incident Reporting: Report and track alerts in real-time
  • POI Management: Define and monitor points of interest
  • User Authentication: Secure role-based access control
  • WebSocket Support: Real-time updates via WebSocket connections

Tech Stack

Client:

  • React Native with Expo
  • Expo Router for navigation
  • React Native Maps for location services
  • TypeScript for type safety

Server:

  • Express.js
  • MongoDB with Mongoose
  • WebSocket (ws) for real-time updates
  • JWT for authentication
  • bcryptjs for password hashing

Project Structure

Pinpoint/
├── client/              # React Native/Expo mobile application
│   ├── app/            # Application screens and layout
│   ├── components/     # Reusable React components
│   ├── hooks/          # Custom React hooks
│   ├── utils/          # Utility functions
│   └── assets/         # Images, fonts, and static assets
│
├── server/             # Node.js/Express backend
│   ├── config/         # Configuration (MongoDB, etc.)
│   ├── controllers/    # Route controllers
│   ├── models/         # MongoDB schemas
│   ├── routes/         # API endpoints
│   ├── middleware/     # Express middleware
│   └── scripts/        # Utility scripts
│
└── docker-compose.yml  # Multi-container setup

Installation

Prerequisites

  • Node.js 16+
  • Docker & Docker Compose (optional)
  • MongoDB (local or connection string)
  • Expo CLI: npm install -g expo-cli

Local Setup

  1. Clone the repository

    git clone https://github.com/Texas-Convergent-Emergency-Team/Pinpoint.git
    cd Pinpoint
  2. Install server dependencies

    cd server
    npm install
    cd ..
  3. Install client dependencies

    cd client
    npm install
    cd ..
  4. Create environment variables

    Create a .env file in the server/ directory:

    MONGODB_URI=mongodb://localhost:27017/pinpoint
    PORT=5000
    NODE_ENV=development
    JWT_SECRET=your_jwt_secret_here
    SEED_USERS_ON_STARTUP=true
    

Docker Setup

  1. Build and start all services

    docker-compose up --build

    This starts:

    • Client: Expo dev server on ports 19000, 19001, 19002, 19006, 8081
    • Server: Express API on port 5000
    • MongoDB: Database service
  2. Access the application

    • Mobile app: Use Expo Go or emulator to connect
    • Server API: http://localhost:5000

Usage

Starting Development Servers

Option 1: Local Development

Terminal 1 - Start server:

cd server
npm run dev

Terminal 2 - Start client:

cd client
npm start

Option 2: Docker

docker-compose up

API Endpoints

Endpoint Purpose
/api/users User management and authentication
/api/events Event creation and management
/api/venues Venue information and configuration
/api/medical-staff Medical personnel management
/api/alerts Incident and alert reporting
/api/pois Points of interest management
/api/venue-planners Venue planner coordination

Database Seeding

Seed default data:

cd server
npm run seed-all

Check seed status:

npm run check-seed

Clear seeded users:

./clear-users.sh

Scripts

Client

  • npm start - Start Expo development server
  • npm run ios - Run on iOS simulator
  • npm run android - Run on Android emulator
  • npm run web - Run in web browser
  • npm run lint - Run ESLint

Server

  • npm start - Start production server
  • npm run dev - Start with hot reload (nodemon)
  • npm run seed-all - Seed all events and data
  • npm run check-seed - Check database seed status

Configuration

Environment Variables

Server (.env)

MONGODB_URI          # MongoDB connection string
PORT                 # Server port (default: 5000)
NODE_ENV             # development/production
JWT_SECRET           # Secret for JWT signing
SEED_USERS_ON_STARTUP # Auto-seed on startup (true/false)
FORCE_AUTO_SEED      # Force seeding even in production

Architecture

The application uses a client-server architecture:

  • Client: React Native app deployed via Expo
  • Server: Express.js REST API with WebSocket support
  • Database: MongoDB for persistent data storage
  • Real-time: WebSocket connections for live updates

Authentication flows through JWT tokens stored securely on the client.

Development

Adding a New API Route

  1. Create a controller in server/controllers/
  2. Define a model in server/models/ (if needed)
  3. Create a route file in server/routes/
  4. Import the route in server/server.js

Adding a New Screen

  1. Create a component in client/app/ or client/app/(tabs)/
  2. Export it and configure in navigation layout
  3. Use Expo Router for routing

Troubleshooting

Port conflicts?

# Kill process on port (e.g., 5000)
lsof -ti :5000 | xargs kill -9

Docker not finding host?

  • Ensure Docker Desktop is running
  • Use host.docker.internal for references to localhost

WebSocket connection issues?

  • Check server is running with WebSocket support
  • Verify client is using correct server URL

Contributing

  1. Create a feature branch: git checkout -b feature/your-feature
  2. Commit changes: git commit -m 'Add feature'
  3. Push to branch: git push origin feature/your-feature
  4. Submit a pull request

License

This project is part of the Texas Convergent Emergency Team initiative.

About

A comprehensive event management and emergency response platform designed for large-scale venues.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages