No description
Find a file
Bilal Bellafkir d1cbca0f97
Some checks are pending
ci/woodpecker/push/ci Pipeline is running
Treat null Cognito names as empty strings.
A stored null given_name or family_name crashed every protected route.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-28 16:41:12 +01:00
.woodpecker Add the Woodpecker pipeline for dev-us. 2026-10-28 14:43:31 +01:00
ci Install pytest in the CI API container. 2026-10-28 16:03:06 +01:00
command_functions migrate sharingpoint table to postgres 2026-07-21 16:17:17 +02:00
config update fire alarm logic 2026-10-15 13:05:22 +02:00
docs impl new station public route 2026-03-09 11:42:59 +01:00
grafana discount changes 2026-06-01 18:06:36 +02:00
helper Treat null Cognito names as empty strings. 2026-10-28 16:41:12 +01:00
routes Treat null Cognito names as empty strings. 2026-10-28 16:41:12 +01:00
scripts update seed locations script 2026-06-18 09:34:40 +02:00
service update fire alarm logic 2026-10-15 13:05:22 +02:00
terraform bug fixes 2026-10-13 09:46:46 +02:00
tests Add the Woodpecker pipeline for dev-us. 2026-10-28 14:43:31 +01:00
translations implement get swap user interaction and translations 2025-10-09 13:10:11 +02:00
.dockerignore fix docker build 2026-09-30 10:17:47 +02:00
.DS_Store update seed locations script 2026-06-18 09:34:40 +02:00
.gitignore add scripts 2026-05-18 13:30:16 +02:00
.python-version adjust monitoring 2026-05-28 05:08:24 +02:00
.zappaignore Fix Zappa build 2026-04-22 12:44:15 +02:00
api_spec.py update fire alarm logic 2026-10-15 13:05:22 +02:00
app.py update fire alarm logic 2026-10-15 13:05:22 +02:00
AWSCLIV2.pkg #337 2026-01-23 09:25:05 +01:00
changelog.md Resolve "Add new routes for referral program" 2024-09-06 07:07:52 +00:00
docker-compose_ci_app.yml Add the Woodpecker pipeline for dev-us. 2026-10-28 14:43:31 +01:00
docker-compose_ci_deployment.yml Add the Woodpecker pipeline for dev-us. 2026-10-28 14:43:31 +01:00
docker-compose_dev.yml docker compose dev working 2025-12-11 08:55:15 +01:00
Dockerfile_dev able to install pipfile 2025-12-10 12:17:36 +01:00
Dockerfile_prod fix docker build 2026-09-30 10:17:47 +02:00
gunicorn.conf.py grafana fix 2026-05-08 14:44:25 +02:00
i18n.py add translation lib and translation files 2025-09-04 11:42:45 +02:00
Jenkinsfile tests 2026-05-07 21:35:05 +02:00
makefile Add the Woodpecker pipeline for dev-us. 2026-10-28 14:43:31 +01:00
Pipfile Merge branch 'appium-js-tests-changes' into merge-memory-leack-fix-to-new-release 2026-05-08 14:44:05 +02:00
pytest.ini Add the Woodpecker pipeline for dev-us. 2026-10-28 14:43:31 +01:00
README.md #132 2024-04-09 11:12:39 +00:00
zappa-api-template-1647279457.json copy project to repo 2022-12-06 13:51:10 +01:00
zappa_settings.json Fix Zappa build 2026-04-22 12:44:15 +02:00

Swobbee REST APi

activate virtual environment

pipenv shell

install dependencies

pipenv install

or

pipenv install --sequential

Using this command will make sure that the dependencies are installed in the order as found in pipfile. therefor avoiding installing incorrect version of dependencies. After installing the dependencies, make sure pycryptodome with version 3.14.1 is installed. Otherwise, there will be error with python 3.7.3

run api locally

switch between stack by changing the environment variable STACK

FLASK_APP=app.py STACK=beta FLASK_ENV=development flask run

deploy new api (new lambda/rest-api)

<name> api name links to a definition in zappa_settings.json. Choose your definition, or create a new one, before deploy a new stack.

zappa deploy <name>

deploy (update) exsisting stack <name>

Take a look into zappa_settings.json to get exsting Stacks and Stages

zappa update <name>

undeploy api

zappa undeploy <name>

Documentation

Check out zappa-aws-docu and Github for more documentation.

Local development using docker

Requirements

Docker, docker-compose and make utility installed. All make cmd can be found at ./makefile

Docker version 20.10.5+dfsg1, build 55c4c88
docker-compose version 1.25.0, build unknown

Build docker image

This is the common image for all staging with all the dependencies needed to run the app. It can be used to run with different staging environment (beta, dev, local ...)

make build-dev      --> Create common image for all staging environments 

Run docker image for local development

make run-dev        --> Run app with STACK=dev

Deployment to staging using docker-compose

  • First build the image
make build-dev
  • Second deploy using zappa via docker compose:
make docker-deploy-beta             --> deploy to beta stage (zappa update beta_v1)
make staging-beta                   --> deploy to jenkins stage (zappa update staging-beta)
make docker-deploy-dev              --> deploy to dev stage (zappa update dev_v1)
make docker-deploy-release          --> deploy to dev stage (zappa update rel_v1)

Testing and deploy with Jenkins CI/CD pipeline

Stages of the pipeline: PREPARATION => BUILD => TEST => DEPLOY

The pipeline will ONLY run automatically after a merge request. If you want to run start the pipeline before creating a merge request, click the play button next to your branch at this URL The BUILD stage will be skipped by default. If you add new dependencies into the Pipfile then add keyword build to your last commit message before pushing to remote and start the pipeline. It will detect it and rebuild the project again. Example commit Refactor | build

Deploy

For each deployment the whole project will be rebuild and tested by default. ONLY when all the tests are passed, the new version can be deployed

Conditions to run auto deployment It's a merge request to selected branches as pre-defined in the following AND the keyword deploy muss be present in merge commit message Example merge commit: Resolve "random feature | deploy

Target stage is based on the following:

TARGET_BRANCH_TO_AUTO_DEPLOY_2_STAGING_BETA='beta' --> accepted merge request on branch beta should triggered deployment on staging-beta stage 
TARGET_BRANCH_TO_AUTO_DEPLOY_2_RELEASE='dummy-place-holder' --> accepted merge request on branch dummy-place-holder should triggered deployment on release stage