Code Monkey home page Code Monkey logo

healthfit's Introduction

PHP with DDD in Symfony

Description

PHP project based on Symfony skeleton with some components and tools to build a solid application following clean architecture. The environment is built with Docker which contains the components to run the application without external dependencies.

Requirements

The project only requires to have installed Docker and Docker Compose in order to start working on it.

Set Up

  1. Create a copy of .env.example as .env and assign values to APP_SECRET and MYSQL_ROOT_PASSWORD

    cp .env.example .env
  2. Build and start docker containers

    docker compose build --no-cache --pull && docker compose up -d
  3. Install composer dependencies

    docker exec php sh -c 'composer install'
  4. Execute all DB migrations.

    docker exec php sh -c 'php bin/console doctrine:migrations:migrate -n'
  5. (Optional) Import seeder.

    docker exec -i mysql sh -c 'exec mysql -uroot -p"$MYSQL_ROOT_PASSWORD" storage' < seeder/database_seeder_data.sql
  6. Use the desired service.

  7. Endpoints accessible

GET http://localhost:8000/api/activities

Query params

activity_type: "AEROBIC" (string)

Examples: http://localhost:8000/api/activities?activity_type=BALANCE http://localhost:8000/api/activities

Response

HTTPStatus: 200

[
    {
        "id": 8,
        "activity_type": "BALANCE",
        "name": "One-leg stand",
        "description": "Start by standing facing the wall, with your arms outstretched."
    }
]

GET http://localhost:8000/api/activities/{id}

Uri params

id: 1 (integer)

Example: http://localhost:8000/api/1

Response

HTTPStatus: 200

{
    "id": 1,
    "activity_type": "AEROBIC",
    "name": "Running",
    "description": "Running is for the cowards"
}

http://localhost:8000/api/activities

POST http://localhost:8000/api/activities

Body params

{
    "activity_type": "FLEXIBILITY",
    "name": "strecth",
    "description": "Walking is a type of exercise where you walk"
}

Example: http://localhost:8000/api/activities

Response

HTTPStatus: 200

Resource Created

healthfit's People

Contributors

antoiba86 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.