An open API service indexing awesome lists of open source software.

https://github.com/simovilab/databus

Core GTFS server implementing Schedule and Realtime specifications for comprehensive transit data management with RESTful APIs
https://github.com/simovilab/databus

api celery django gtfs

Last synced: 2 months ago
JSON representation

Core GTFS server implementing Schedule and Realtime specifications for comprehensive transit data management with RESTful APIs

Awesome Lists containing this project

README

          

databus

# DatabΓΊs

![Static Badge](https://img.shields.io/badge/web_framework-Django-white?logo=django)
![Static Badge](https://img.shields.io/badge/package_manager-uv-white?logo=uv)

Core backend server implementing GTFS Schedule and GTFS Realtime specifications for comprehensive transit data management. Provides RESTful API endpoints for static schedule data (routes, stops, trips) and real-time vehicle information (positions, alerts, service updates) with PostgreSQL/PostGIS storage and real-time data validation.

## ✨ Features

- 🚌 **GTFS Schedule & Realtime Support** - Full implementation of GTFS specifications
- 🌐 **RESTful API** - Comprehensive endpoints for transit data access
- πŸ“Š **Real-time Data Processing** - Live vehicle positions, alerts, and service updates
- πŸ—ΊοΈ **Geospatial Support** - PostgreSQL/PostGIS for location-based queries
- πŸ”„ **Background Processing** - Celery integration for data validation and updates
- 🏒 **Multi-tenant Architecture** - Support for multiple transit agencies

## πŸš€ Getting Started

### Prerequisites

- Python 3.11+
- Redis server
- PostgreSQL 12+ with PostGIS extension
- Git

### Installation

1. **Clone the repository**

```bash
git clone https://github.com/simovilab/databus.git
cd databus
```

2. **Set up virtual environment** (recommended)

```bash
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```

3. **Install dependencies**

```bash
pip install -r requirements.txt
```

4. **Configure environment**

```bash
cp .env.example .env # Create and edit your environment variables
```

5. **Set up database**
```bash
python manage.py migrate
python manage.py createsuperuser # Optional: create admin user
```

### Running the Application

1. **Start Redis server** (in separate terminal)

```bash
redis-server
```

2. **Start Celery worker** (in separate terminal)

```bash
celery -A realtime worker -l info
```

3. **Start Django development server**
```bash
python manage.py runserver
```

The application will be available at `http://localhost:8000`

## πŸš€ Usage

| Endpoint | Description |
| ------------------- | ---------------------------------------------- |
| `/api/` | REST API root - browse all available endpoints |
| `/api/docs/` | Interactive API documentation (ReDoc) |
| `/api/docs/schema/` | OpenAPI schema |
| `/admin/` | Django admin interface |
| `/feed/` | GTFS feed endpoints |

## πŸ“š Documentation

- **[HOWTO.md](HOWTO.md)** - Complete guide for setting up a development environment with Docker
- **[docs/development.md](docs/development.md)** - Functional development notes and data specifications (Spanish)
- **[docs/deployment.md](docs/deployment.md)** - Production deployment with Celery and systemd
- **[docs/api.md](docs/api.md)** - API specification and data formats
- **[docs/obe.md](docs/obe.md)** - On-board equipment specifications
- **[WARP.md](WARP.md)** - Development guidance for Warp terminal users

For the full documentation site, run `mkdocs serve` and visit http://localhost:8000

## πŸ›£οΈ Roadmap

Where is this going? Check SIMOVI's [roadmap](https://github.com/simovilab/context/blob/main/roadmap.md).

## 🀝 Contributing

Help is welcome! See the [guidelines](https://github.com/simovilab/.github/blob/main/CONTRIBUTING.md).

## πŸ“ž Contact

- Email: simovi@ucr.ac.cr
- Website: [simovi.org](https://simovi.org)

## πŸ“„ License

Apache 2.0