TeaTime is a simple app to select random tea members to make tea, like a round robin but for tea. The OpenAPI specification of the API is also included in the repository.
You can run the app with Docker and docker-compose:
docker-compose up --build -dThis will run the Postgres database, back-end service and front-end application in Docker. Database migrations are run automatically during initialisation. The back-end API is served on localhost:8000 and currently has no authentication layer. The front-end application is served on localhost:8080.
When running on a fresh setup, the database will be empty. It will be necessary to create team members (called 'Tea Makers' in the application).
Alternatively, you may want to run it manually. In order to do this, you will need a Postgres database and a user with read/write permissions on this database. This README is not opinionated regarding your local Postgres setup.
To run the back-end, pipenv is recommended:
pipenv install --dev
pipenv shellAssuming that the virtual environment is activated, you may run your back-end application with standard Django commands:
python manage.py migrate # to run database migrations
python manage.py runserver # to serve the application on port 8000The behaviour of the server, particularly in regards to the connection to the database, is controlled via the following environment variables:
DATABASE_NAME(default istea_robin)DATABASE_USER(default istea_robin_user)DATABASE_PASSWORD(default ispassword123)DATABASE_HOST(default islocalhost)DATABASE_PORT(default is5432)
To run the front-end, it is necessary to have node 12 installed. It is also recommended that the @angular/cli NPM package is installed, although this isn't strictly necessary.
npm install
npm run serve # to serve the application on port 4200Just like with the Docker setup, the manual setup will not have any members in the database, which will need to be added by the user.
To run the back-end tests, the same pipenv virtual environment may be used:
pytestTo run the front-end tests, the same node setup may be used:
npm run test