Giter Site home page Giter Site logo

hminhit / bicing-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jorge07/bicing-api

0.0 1.0 0.0 14.65 MB

Get statistics and locations of bicycle stations through REST API

PHP 92.17% Dockerfile 1.26% Makefile 0.93% Shell 0.55% Gherkin 5.01% HTML 0.08%

bicing-api's Introduction

Bicing Log

Bicing Statistics API

Symfony 4 REST API applying CQRS and DDD patterns, built with CI, driven by BDD.

PHP 7.2 reference build coverage insight Contributions welcome License

Get statistics and locations of bicycle stations.

The goal of this REST API is to ease customer's usage of large-scale public bicycle sharing system.
By collecting data from different providers (Bicing, Velib, ...) it gives powerful information (location to pick or return a bike, best time for picking up a bike, ...).
Here is an example of a user interface project calling the API /lechatquidanse/bicing-user-interface-app

Getting StartedFeaturesBuilt WithDevelopmentCoding StandardCI and Deployment

Bicing API RESTs examples

Getting Started

Prerequisites

To install and run the API you need Docker Compose and... that's all. Please follow the official documentation to install it on your environment.

Installing

Clone the project and run the default installation:

git clone https://github.com/lechatquidanse/bicing-api.git && cd bicing-api && make install

Your docker containers should have been successfully built and run.

Features

Multiple features are proposed across 2 user interfaces, a REST API and command-line commands:

REST API:

Bicing API RESTs features

You can find the concrete user stories written in Gherkin in features folder. These behaviour requirements are tested with Behat.

CLI:

Bicing API CLI features

To run the project once installed:

Built with

Development

The Makefile contains useful command for development purpose

Makefile helpul commands

Coding standard

Domain Driven Design

Code and folder structure follow Domain Driven Design (DDD).

src
    \
        |\ Application     `Contains the Use Cases and the Processes of the domain system, commands, handlers and subscribers`
        |
        |\ Domain          `The system business logic layer (Models, Events, Exceptions...)`
        |
        |\ Infrastructure  `Its the implementation of the system outside the model. I.E: Persistence, Query, etc`
        |
        |\ UserInterface   `It contains all the interfaces allowed for a user of the API (Cli, HTTP, Rest, etc)`

Command Query Responsibility Segregation

In this project, a use case is a command or a query with a single responsibility. This use case is then handled by a handler for a command or a data provider for a query.

Commands are handled by a message bus (SimpleBus) where a command is link to one handler.
For example, to create a station in database:

CQRS command handler

If you want to learn more and look for other DDD and CQRS implementation, here is a great Symfony4 boilerplate from jorge07.

CI and Deployment

CI and deployment can be handled through Gitlab and Docker thanks to .gitlab-ci.yml It contains 3 different stages.

Test

Environment 'test' is triggered when a 'feature/*' branch is pushed to the repository. It will then install project and launch qa tools.

Build

Environment 'build' is triggered when a 'release/*' branch is pushed to the repository. It will then install project, launch qa tools and then build and push a docker image on a registry if no error occurred.

Production

This manual action, will pull the image build by the previous step and update the specific container.

Continuous Integration

License

MIT

Stéphane EL MANOUNI  ·  Linkedin

Pascal Borreli  ·  GitHub

bicing-api's People

Contributors

lechatquidanse avatar pborreli avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.