Skip to content

Demo implementation of a Taxi API using Symfony, Codeception, Stripe, and OpenStreetRoute.

Notifications You must be signed in to change notification settings

xEdelweiss/taxi-backend

Repository files navigation

Demo Taxi API

This project demonstrates a taxi API that implements ordering a taxi from point A to point B.

All features are covered by tests using Codeception and PHPUnit.

Important! This project is intended for demonstration purposes only and should not be used in a production environment. Although implementing validation and authorization mechanisms is planned, it is not a top priority at the moment.

API Docs and UI example

Todo

  • Debug UI (moved to separate repository)
  • API documentation at /api/doc
  • Simulate driver/user actions
  • Registration and authentication
  • Driver profile activation
  • Geocoding and reverse geocoding
    • OpenStreetMap Nominatim service
  • Location tracking
  • Route planning
    • OpenStreetRoute self-hosted service
    • Route rendering
  • Cost estimation
    • Simple distance-based cost estimation
    • Advanced cost estimation
  • Payment processing
    • Stripe integration
    • Hold payment until the order is completed
    • Charge payment if the order is completed
    • Refund payment if the order is cancelled
  • Driver matching
    • Shortest distance matching strategy
    • Fastest delivery time matching strategy
    • Retry matching if no drivers are available
  • Order management
    • Order creation
    • Order cancellation
    • Order completion
  • Rating system

Development Environment

Start

symfony serve

Preparation

OpenStreetRoute service

  1. Download OSM data from OSM - use Overpass API to export large chunk of data
  2. (optional) Update permissions: sudo chown -R 1000:1000 var/ors-docker
  3. Put the data into var/ors-docker/files/map-odesa-test.osm or change the file name in var/ors-docker/config/ors-config.yml:102
  4. Run docker-compose up to start the service (REBUILD_GRAPHS should be True to rebuild the graphs)

Production Environment

Deployment

  • TBD

Notes

Custom OSM tiles: https://leaflet-extras.github.io/leaflet-providers/preview/

Notes

  • Build API documentation:

    php bin/console nelmio:apidoc:dump --format=html > api.html
    php bin/console nelmio:apidoc:dump --format=json > api.json
  • Do not use the same name for Response DTO constructor argument and property name, because NelmoApiDocBundle will use the constructor argument type for documentation.

About

Demo implementation of a Taxi API using Symfony, Codeception, Stripe, and OpenStreetRoute.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published