Skip to content

nicolelucas03/MLH-DigitalOcean-Hackathon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MLH DigitalOcean Hackathon

Full-stack application with Django backend and React frontend.

Project Structure

├── backend/              # Django REST API
│   ├── config/          # Django project settings
│   ├── apps/            # Django apps
│   │   └── api/        # API endpoints
│   ├── tests/          # Backend tests
│   └── manage.py       # Django management script
├── frontend/            # React application
│   ├── src/
│   │   ├── components/ # Reusable components
│   │   ├── pages/      # Page components
│   │   ├── services/   # API client
│   │   ├── hooks/      # Custom React hooks
│   │   ├── utils/      # Utility functions
│   │   └── types/      # TypeScript types
│   └── public/         # Static assets
└── docker-compose.yml  # Docker orchestration

Quick Start

Using Docker (Recommended)

  1. Clone and setup

    git clone <your-repo-url>
    cd MLH-DigitalOcean-Hackathon
  2. Configure environment

    cp backend/.env.example backend/.env
    cp frontend/.env.example frontend/.env
  3. Run with Docker

    docker-compose up

Local Development

Backend Setup

  1. Create virtual environment

    cd backend
    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  2. Install dependencies

    pip install -r requirements.txt
  3. Configure environment

    cp .env.example .env
    # Edit .env with your settings
  4. Run migrations

    python manage.py migrate
  5. Create superuser (optional)

    python manage.py createsuperuser
  6. Run development server

    python manage.py runserver

    Backend will be available at http://localhost:8000

Frontend Setup

  1. Install dependencies

    cd frontend
    npm install
  2. Configure environment

    cp .env.example .env
  3. Run development server

    npm run dev

    Frontend will be available at http://localhost:3000

Development

Backend

  • Run tests: python manage.py test
  • Create new app: python manage.py startapp app_name
  • Make migrations: python manage.py makemigrations
  • Apply migrations: python manage.py migrate
  • Admin panel: http://localhost:8000/admin/

Frontend

  • Run tests: npm test (when configured)
  • Build for production: npm run build
  • Preview production build: npm run preview

API Documentation

  • Health check endpoint: GET /api/health/

Tech Stack

Backend

  • Django 5.0
  • Django REST Framework
  • SQLite (development) / PostgreSQL (production)
  • CORS headers for cross-origin requests

Frontend

  • React 18
  • TypeScript
  • Vite
  • React Router
  • Axios

Presentation and Links

License

See LICENSE file for details.

About

WaySafe-Safety Navigation Tool: A navigation tool that provides safety alongside travel time. It analyzes historical crime data and user preferences to rank the top route options, providing safety scores, estimated travel times, and clear explanations for each recommendation.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors