Giter Club home page Giter Club logo

supinfo-4cite's Introduction

CI

Hotel API

Quick install guide

This application makes use of containers through Docker and Docker compose which provide an easy-to-run development environment. Docker compose simulates a production environment by creating containers for all the needed services and exposing them in a virtual network.

Pre-requisites

  • Have docker and docker compose installed on your machine. An easy way to do that is by installing Docker Desktop (though be mindful of its licencing requirements).

Running the application

  • docker compose up --wait : Run the application (and build it on first run)
  • docker compose exec php bin/console d:d:c : Create the database
  • docker compose exec php bin/console d:m:m : Create / update the database structure
  • docker exec php bin/console lexik:jwt:generate-keypair : Create keys for JWT generation

After these steps, the API should now be available on localhost/docs, while the front-end application is located at localhost/admin.

See the next sections for more commands and troubleshooting steps.

Troubleshooting

If the php container does not start (or is "Unhealthy") during docker compose up, try running ./update-deps.sh.

If error messages relating to the database appear, try running docker compose exec php bin/console d:m:m to update the database schema.

In other cases, restarting the containers can help : docker compose down.

Running tests

To run the test suite, run :

docker compose exec php bin/phpunit

Before running tests for the first time, you will need to initialize a database for the TEST environment, like so :

  • docker compose exec php bin/console -e test d:d:c
  • docker compose exec php bin/console -e test d:m:m

Useful commands

docker compose build --no-cache : Build images

docker compose up --wait : Start services

docker compose logs -f : See logs

docker compose ps : See containers

docker compose exec php bin/phpunit : Run tests

docker compose exec php bin/console -e test ... : Execute commands for the test environment (create db, migrate...)

XDEBUG_MODE=debug docker compose up --wait : Enable XDebug

docker exec php bin/console lexik:jwt:generate-keypair : Generate keys for JWT authentication

supinfo-4cite's People

Contributors

axel37 avatar

Watchers

 avatar

supinfo-4cite's Issues

Documentation

Not providing a documentation result on negative points (up to -5)

CI Pipeline to run tests

It is also expected to provide a basic GitHub pipeline for the CI/CD part

Pull Request need to be reviewed by at least one people and not open comment to be able to merge. This should also trigger a pipeline to run all tests and allow the merge only if everything is green
When merging to the main branch it should trigger a full pipeline with at least
    run all tests
    check for security
    Build the solution
    "Deploy" the solution (no need to really deploy just have a job with an "echo")

Validation and DTOs

We must be able to use the Symfony Validator before letting our objects throw domain exceptions

image

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.