π Open Bus Backend
August 24, 2025 Β· View on GitHub
A backend service powering the Open-Bus platform. Provides APIs for health checks, GitHub issue creation, complaints, and government transportation data.
π’ Get Involved
- π¬ For general help and system updates, join the Hasadna Slack: #open-bus channel
- π Found a bug or have a feature request? Open an issue
- π€ Want to contribute? See our contributing guidelines
π API Documentation
- π Swagger UI (production): https://open-bus-backend.k8s.hasadna.org.il/docs
- π₯οΈ Swagger UI (local): http://localhost:3001/docs
π Related Projects
βοΈ Installation
npm install
π Environment Variables
Create a .env file:
# Server Configuration
PORT=3001
HOST=0.0.0.0
NODE_ENV=development
LOG_LEVEL=info
# GitHub Configuration
GITHUB_TOKEN=your_github_token
GITHUB_OWNER=your_github_username
GITHUB_REPO=your_repository_name
π Running the Server
Development
npm run dev
Production
npm start
π§ͺ Testing
# Run all tests
npm test
# Run with coverage
npm run test:coverage
# Run lint checks
npm run test:lint
# Fix lint issues
npm run lint:fix
π³ Running with Docker
- Build the image
docker build -t open-bus-backend .
- Run the container
docker run -it -p 3001:3001 \
-e GITHUB_TOKEN=your_github_token \
-e GITHUB_OWNER=your_github_owner \
-e GITHUB_REPO=your_github_repo \
-e LOG_LEVEL=info \
open-bus-backend
π API Endpoints
π©Ί Health Check
GET /β Returns server status
π GitHub Issues
POST /issuesβ Create a new GitHub issue- Required:
title,contactName,contactEmail,description,environment,expectedBehavior,actualBehavior,reproducibility - Optional:
attachments[](array of URLs)
- Required:
π£ Complaints
POST /complaintsβ Submit a complaint to government forms-
Required:
userData:firstName,lastName,id,email,phonedatabusData:operator
-
Optional:
debug,complaintType,description
-
ποΈ Government Transportation
| Endpoint | Method | Required Body |
|---|---|---|
/gov/lines-by-station | POST | EventDate, OperatorId, StationId |
/gov/stations-by-line | POST | eventDate, OperatorId, OfficelineId, Directions |
/gov/subjects | POST | listName = "subject_type_vehicles" |
/gov/train-stations | POST | StationTypeId |
/gov/pniya | POST | listName = "pniya" |
/gov/not-real-numbers | POST | listName = "notrealnumbers" |
/gov/lines-by-line | POST | eventDate, OperatorId, OperatorLineId |
/gov/cities | POST | none |
/gov/time | GET | none |
Server will be available at: http://localhost:3001