You must have Python 3.13 or higher installed, to build and start back-end and front-end service.
To create mysql container for project:
To setup PyPI credentials for the current project :
pdm config --local repository.pypi.username __token__
pdm config --local repository.pypi.password pypi-YOUR_SECRET_TOKEN_HEREIt will create at the root of the project, a file named pdm.toml with following content :
[repository.pypi]
username = "__token__"
password = "pypi-YOUR_SECRET_TOKEN_HERE"To publish new version for the project in PyPI :
pdm publishTo install dev dependancies for the project :
pdm lock --dev -G:all
pdm install --group test --group devTo update local dependancies :
pdm install --dev -G:allTo export dependancies for production (used automatically in dockerfile) :
pdm export --pyproject --prod --group prod --format requirements --output requirements.txt --no-hashesTo execute tests :
pdm run pytestTo run services :
pdm run dev_winCreate a .env file for each project in back folder :
- Database service
ENV_MODE="prod"
DB_DIALECT="mysql+aiomysql"
DB_URL="goatcalendar_user:goatcalendar_passwd@localhost:3306/goatcalendar_db"- Auth service
ENV_MODE="prod"
DB_DIALECT="mysql+aiomysql"
DB_URL="goatcalendar_user:goatcalendar_passwd@localhost:3306/goatcalendar_db"
SERVER_HOST="127.0.0.1"
SERVER_PORT=5001
FRONT_URL="http://localhost:8080"
ENCRYPTION_KEY="q+b4dGwz4nZOjdoYvOwurO781EPliCKWxo0/2bTb7NeBN/lsybkh0EU+mWiefEtFtcIOrv0yZJHuakJQGYQz1Q=="
ACCESS_TOKEN_DURATION_MINUTES=1000
REFRESH_TOKEN_DURATION_HOURS=24- Board service
ENV_MODE="prod"
DB_DIALECT="mysql+aiomysql"
DB_URL="goatcalendar_user:goatcalendar_passwd@localhost:3306/goatcalendar_db"
SERVER_HOST="127.0.0.1"
SERVER_PORT=5002
FRONT_URL="http://localhost:8080"
ENCRYPTION_KEY="q+b4dGwz4nZOjdoYvOwurO781EPliCKWxo0/2bTb7NeBN/lsybkh0EU+mWiefEtFtcIOrv0yZJHuakJQGYQz1Q=="
ACCESS_TOKEN_DURATION_MINUTES=1000
REFRESH_TOKEN_DURATION_HOURS=24Le front est volontairement statique : HTML, CSS et JavaScript natif uniquement.
Configuration API par défaut :
- Auth service :
http://localhost:5001 - Board service :
http://localhost:5002
Pour lancer le front en dev :
cd front
py -m http.server 8080Puis ouvrir http://localhost:8080.
Les URLs des services sont centralisées dans front/scripts/config.js.
Comptes de demo seedés :
aliceproprio@gmail.comboblocataire@gmail.comclairemixte@gmail.com
Mot de passe : azerty
Pour lancer les services, se positionner dans le répertoire GoatCalendar :
docker-compose pull
docker-compose build
docker-compose upPuis ouvrir http://localhost:8080.
Comptes de demo seedés :
aliceproprio@gmail.comboblocataire@gmail.comclairemixte@gmail.com
Mot de passe : azerty