diff --git a/README.md b/README.md
index d85e943834..732f2059ee 100644
--- a/README.md
+++ b/README.md
@@ -1,270 +1,2 @@
-# Full Stack FastAPI and PostgreSQL - Base Project Generator
-[](https://travis-ci.com/tiangolo/full-stack-fastapi-postgresql)
-
-Generate a backend and frontend stack using Python, including interactive API documentation.
-
-### Interactive API documentation
-
-[](https://github.com/tiangolo/full-stack-fastapi-postgresql)
-
-### Alternative API documentation
-
-[](https://github.com/tiangolo/full-stack-fastapi-postgresql)
-
-### Dashboard Login
-
-[](https://github.com/tiangolo/full-stack-fastapi-postgresql)
-
-### Dashboard - Create User
-
-[](https://github.com/tiangolo/full-stack-fastapi-postgresql)
-
-## Features
-
-* Full **Docker** integration (Docker based).
-* Docker Swarm Mode deployment.
-* **Docker Compose** integration and optimization for local development.
-* **Production ready** Python web server using Uvicorn and Gunicorn.
-* Python **FastAPI** backend:
- * **Fast**: Very high performance, on par with **NodeJS** and **Go** (thanks to Starlette and Pydantic).
- * **Intuitive**: Great editor support. Completion everywhere. Less time debugging.
- * **Easy**: Designed to be easy to use and learn. Less time reading docs.
- * **Short**: Minimize code duplication. Multiple features from each parameter declaration.
- * **Robust**: Get production-ready code. With automatic interactive documentation.
- * **Standards-based**: Based on (and fully compatible with) the open standards for APIs: OpenAPI and JSON Schema.
- * **Many other features** including automatic validation, serialization, interactive documentation, authentication with OAuth2 JWT tokens, etc.
-* **Secure password** hashing by default.
-* **JWT token** authentication.
-* **SQLAlchemy** models (independent of Flask extensions, so they can be used with Celery workers directly).
-* Basic starting models for users (modify and remove as you need).
-* **Alembic** migrations.
-* **CORS** (Cross Origin Resource Sharing).
-* **Celery** worker that can import and use models and code from the rest of the backend selectively.
-* REST backend tests based on **Pytest**, integrated with Docker, so you can test the full API interaction, independent on the database. As it runs in Docker, it can build a new data store from scratch each time (so you can use ElasticSearch, MongoDB, CouchDB, or whatever you want, and just test that the API works).
-* Easy Python integration with **Jupyter Kernels** for remote or in-Docker development with extensions like Atom Hydrogen or Visual Studio Code Jupyter.
-* **Vue** frontend:
- * Generated with Vue CLI.
- * **JWT Authentication** handling.
- * Login view.
- * After login, main dashboard view.
- * Main dashboard with user creation and edition.
- * Self user edition.
- * **Vuex**.
- * **Vue-router**.
- * **Vuetify** for beautiful material design components.
- * **TypeScript**.
- * Docker server based on **Nginx** (configured to play nicely with Vue-router).
- * Docker multi-stage building, so you don't need to save or commit compiled code.
- * Frontend tests ran at build time (can be disabled too).
- * Made as modular as possible, so it works out of the box, but you can re-generate with Vue CLI or create it as you need, and re-use what you want.
- * It's also easy to remove it if you have an API-only app, check the instructions in the generated `README.md`.
-* **PGAdmin** for PostgreSQL database, you can modify it to use PHPMyAdmin and MySQL easily.
-* **Flower** for Celery jobs monitoring.
-* Load balancing between frontend and backend with **Traefik**, so you can have both under the same domain, separated by path, but served by different containers.
-* Traefik integration, including Let's Encrypt **HTTPS** certificates automatic generation.
-* GitLab **CI** (continuous integration), including frontend and backend testing.
-
-## How to use it
-
-Go to the directory where you want to create your project and run:
-
-```bash
-pip install cookiecutter
-cookiecutter https://github.com/tiangolo/full-stack-fastapi-postgresql
-```
-
-### Generate passwords
-
-You will be asked to provide passwords and secret keys for several components. Open another terminal and run:
-
-```bash
-openssl rand -hex 32
-# Outputs something like: 99d3b1f01aa639e4a76f4fc281fc834747a543720ba4c8a8648ba755aef9be7f
-```
-
-Copy the contents and use that as password / secret key. And run that again to generate another secure key.
-
-
-### Input variables
-
-The generator (cookiecutter) will ask you for some data, you might want to have at hand before generating the project.
-
-The input variables, with their default values (some auto generated) are:
-
-* `project_name`: The name of the project
-* `project_slug`: The development friendly name of the project. By default, based on the project name
-* `domain_main`: The domain in where to deploy the project for production (from the branch `production`), used by the load balancer, backend, etc. By default, based on the project slug.
-* `domain_staging`: The domain in where to deploy while staging (before production) (from the branch `master`). By default, based on the main domain.
-
-* `docker_swarm_stack_name_main`: The name of the stack while deploying to Docker in Swarm mode for production. By default, based on the domain.
-* `docker_swarm_stack_name_staging`: The name of the stack while deploying to Docker in Swarm mode for staging. By default, based on the domain.
-
-* `secret_key`: Backend server secret key. Use the method above to generate it.
-* `first_superuser`: The first superuser generated, with it you will be able to create more users, etc. By default, based on the domain.
-* `first_superuser_password`: First superuser password. Use the method above to generate it.
-* `backend_cors_origins`: Origins (domains, more or less) that are enabled for CORS (Cross Origin Resource Sharing). This allows a frontend in one domain (e.g. `https://dashboard.example.com`) to communicate with this backend, that could be living in another domain (e.g. `https://api.example.com`). It can also be used to allow your local frontend (with a custom `hosts` domain mapping, as described in the project's `README.md`) that could be living in `http://dev.example.com:8080` to communicate with the backend at `https://stag.example.com`. Notice the `http` vs `https` and the `dev.` prefix for local development vs the "staging" `stag.` prefix. By default, it includes origins for production, staging and development, with ports commonly used during local development by several popular frontend frameworks (Vue with `:8080`, React, Angular).
-* `smtp_port`: Port to use to send emails via SMTP. By default `587`.
-* `smtp_host`: Host to use to send emails, it would be given by your email provider, like Mailgun, Sparkpost, etc.
-* `smtp_user`: The user to use in the SMTP connection. The value will be given by your email provider.
-* `smtp_password`: The password to be used in the SMTP connection. The value will be given by the email provider.
-* `smtp_emails_from_email`: The email account to use as the sender in the notification emails, it would be something like `info@your-custom-domain.com`.
-
-* `postgres_password`: Postgres database password. Use the method above to generate it. (You could easily modify it to use MySQL, MariaDB, etc).
-* `pgadmin_default_user`: PGAdmin default user, to log-in to the PGAdmin interface.
-* `pgadmin_default_user_password`: PGAdmin default user password. Generate it with the method above.
-
-* `traefik_constraint_tag`: The tag to be used by the internal Traefik load balancer (for example, to divide requests between backend and frontend) for production. Used to separate this stack from any other stack you might have. This should identify each stack in each environment (production, staging, etc).
-* `traefik_constraint_tag_staging`: The Traefik tag to be used while on staging.
-* `traefik_public_constraint_tag`: The tag that should be used by stack services that should communicate with the public.
-
-* `flower_auth`: Basic HTTP authentication for flower, in the form`user:password`. By default: "`admin:changethis`".
-
-* `sentry_dsn`: Key URL (DSN) of Sentry, for live error reporting. You can use the open source version or a free account. E.g.: `https://1234abcd:5678ef@sentry.example.com/30`.
-
-* `docker_image_prefix`: Prefix to use for Docker image names. If you are using GitLab Docker registry it would be based on your code repository. E.g.: `git.example.com/development-team/my-awesome-project/`.
-* `docker_image_backend`: Docker image name for the backend. By default, it will be based on your Docker image prefix, e.g.: `git.example.com/development-team/my-awesome-project/backend`. And depending on your environment, a different tag will be appended ( `prod`, `stag`, `branch` ). So, the final image names used will be like: `git.example.com/development-team/my-awesome-project/backend:prod`.
-* `docker_image_celeryworker`: Docker image for the celery worker. By default, based on your Docker image prefix.
-* `docker_image_frontend`: Docker image for the frontend. By default, based on your Docker image prefix.
-
-## How to deploy
-
-This stack can be adjusted and used with several deployment options that are compatible with Docker Compose, but it is designed to be used in a cluster controlled with pure Docker in Swarm Mode with a Traefik main load balancer proxy handling automatic HTTPS certificates, using the ideas from DockerSwarm.rocks.
-
-Please refer to DockerSwarm.rocks to see how to deploy such a cluster in 20 minutes.
-
-## More details
-
-After using this generator, your new project (the directory created) will contain an extensive `README.md` with instructions for development, deployment, etc. You can pre-read [the project `README.md` template here too](./{{cookiecutter.project_slug}}/README.md).
-
-## Sibling project generators
-
-* Full Stack FastAPI Couchbase: [https://github.com/tiangolo/full-stack-fastapi-couchbase](https://github.com/tiangolo/full-stack-fastapi-couchbase).
-
-## Release Notes
-
-### Latest Changes
-
-* Update issue-manager. PR [#211](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/211).
-* Add [GitHub Sponsors](https://github.com/sponsors/tiangolo) button. PR [#201](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/201).
-* Add consistent errors for env vars not set. PR [#200](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/200).
-* Upgrade Traefik to version 2, keeping in sync with DockerSwarm.rocks. PR [#199](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/199).
-* Add docs about reporting test coverage in HTML. PR [#161](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/161).
-* Run tests with `TestClient`. PR [#160](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/160).
-* Refactor backend:
- * Simplify configs for tools and format to better support editor integration.
- * Add mypy configurations and plugins.
- * Add types to all the codebase.
- * Update types for SQLAlchemy models with plugin.
- * Update and refactor CRUD utils.
- * Refactor DB sessions to use dependencies with `yield`.
- * Refactor dependencies, security, CRUD, models, schemas, etc. To simplify code and improve autocompletion.
- * Change from PyJWT to Python-JOSE as it supports additional use cases.
- * Fix JWT tokens using user email/ID as the subject in `sub`.
- * PR [#158](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/158).
-* Add docs about removing the frontend, for an API-only app. PR [#156](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/156).
-* Simplify scripts and development, update docs and configs. PR [#155](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/155).
-* Simplify `docker-compose.*.yml` files, refactor deployment to reduce config files. PR [#153](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/153).
-* Simplify env var files, merge to a single `.env` file. PR [#151](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/151).
-
-### 0.5.0
-
-* Make the Traefik public network a fixed default of `traefik-public` as done in DockerSwarm.rocks, to simplify development and iteration of the project generator. PR [#150](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/150).
-* Update to PostgreSQL 12. PR [#148](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/148). by [@RCheese](https://github.com/RCheese).
-* Use Poetry for package management. Initial PR [#144](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/144) by [@RCheese](https://github.com/RCheese).
-* Fix Windows line endings for shell scripts after project generation with Cookiecutter hooks. PR [#149](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/149).
-* Upgrade Vue CLI to version 4. PR [#120](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/120) by [@br3ndonland](https://github.com/br3ndonland).
-* Remove duplicate `login` tag. PR [#135](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/135) by [@Nonameentered](https://github.com/Nonameentered).
-* Fix showing email in dashboard when there's no user's full name. PR [#129](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/129) by [@rlonka](https://github.com/rlonka).
-* Format code with Black and Flake8. PR [#121](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/121) by [@br3ndonland](https://github.com/br3ndonland).
-* Simplify SQLAlchemy Base class. PR [#117](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/117) by [@airibarne](https://github.com/airibarne).
-* Update CRUD utils for users, handling password hashing. PR [#106](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/106) by [@mocsar](https://github.com/mocsar).
-* Use `.` instead of `source` for interoperability. PR [#98](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/98) by [@gucharbon](https://github.com/gucharbon).
-* Use Pydantic's `BaseSettings` for settings/configs and env vars. PR [#87](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/87) by [@StephenBrown2](https://github.com/StephenBrown2).
-* Remove `package-lock.json` to let everyone lock their own versions (depending on OS, etc).
-* Simplify Traefik service labels PR [#139](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/139).
-* Add email validation. PR [#40](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/40) by [@kedod](https://github.com/kedod).
-* Fix typo in README. PR [#83](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/83) by [@ashears](https://github.com/ashears).
-* Fix typo in README. PR [#80](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/80) by [@abjoker](https://github.com/abjoker).
-* Fix function name `read_item` and response code. PR [#74](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/74) by [@jcaguirre89](https://github.com/jcaguirre89).
-* Fix typo in comment. PR [#70](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/70) by [@daniel-butler](https://github.com/daniel-butler).
-* Fix Flower Docker configuration. PR [#37](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/37) by [@dmontagu](https://github.com/dmontagu).
-* Add new CRUD utils based on DB and Pydantic models. Initial PR [#23](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/23) by [@ebreton](https://github.com/ebreton).
-* Add normal user testing Pytest fixture. PR [#20](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/20) by [@ebreton](https://github.com/ebreton).
-
-### 0.4.0
-
-* Fix security on resetting a password. Receive token as body, not query. PR [#34](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/34).
-
-* Fix security on resetting a password. Receive it as body, not query. PR [#33](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/33) by [@dmontagu](https://github.com/dmontagu).
-
-* Fix SQLAlchemy class lookup on initialization. PR [#29](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/29) by [@ebreton](https://github.com/ebreton).
-
-* Fix SQLAlchemy operation errors on database restart. PR [#32](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/32) by [@ebreton](https://github.com/ebreton).
-
-* Fix locations of scripts in generated README. PR [#19](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/19) by [@ebreton](https://github.com/ebreton).
-
-* Forward arguments from script to `pytest` inside container. PR [#17](https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/17) by [@ebreton](https://github.com/ebreton).
-
-* Update development scripts.
-
-* Read Alembic configs from env vars. PR #9 by @ebreton.
-
-* Create DB Item objects from all Pydantic model's fields.
-
-* Update Jupyter Lab installation and util script/environment variable for local development.
-
-### 0.3.0
-
-* PR #14:
- * Update CRUD utils to use types better.
- * Simplify Pydantic model names, from `UserInCreate` to `UserCreate`, etc.
- * Upgrade packages.
- * Add new generic "Items" models, crud utils, endpoints, and tests. To facilitate re-using them to create new functionality. As they are simple and generic (not like Users), it's easier to copy-paste and adapt them to each use case.
- * Update endpoints/*path operations* to simplify code and use new utilities, prefix and tags in `include_router`.
- * Update testing utils.
- * Update linting rules, relax vulture to reduce false positives.
- * Update migrations to include new Items.
- * Update project README.md with tips about how to start with backend.
-
-* Upgrade Python to 3.7 as Celery is now compatible too. PR #10 by @ebreton.
-
-### 0.2.2
-
-* Fix frontend hijacking /docs in development. Using latest https://github.com/tiangolo/node-frontend with custom Nginx configs in frontend. PR #6.
-
-### 0.2.1
-
-* Fix documentation for *path operation* to get user by ID. PR #4 by @mpclarkson in FastAPI.
-
-* Set `/start-reload.sh` as a command override for development by default.
-
-* Update generated README.
-
-### 0.2.0
-
-**PR #2**:
-
-* Simplify and update backend `Dockerfile`s.
-* Refactor and simplify backend code, improve naming, imports, modules and "namespaces".
-* Improve and simplify Vuex integration with TypeScript accessors.
-* Standardize frontend components layout, buttons order, etc.
-* Add local development scripts (to develop this project generator itself).
-* Add logs to startup modules to detect errors early.
-* Improve FastAPI dependency utilities, to simplify and reduce code (to require a superuser).
-
-### 0.1.2
-
-* Fix path operation to update self-user, set parameters as body payload.
-
-### 0.1.1
-
-Several bug fixes since initial publication, including:
-
-* Order of path operations for users.
-* Frontend sending login data in the correct format.
-* Add https://localhost variants to CORS.
-
-## License
-
-This project is licensed under the terms of the MIT license.
+docker build -f infra/backend.dockerfile -t local/base-project2:0.0.1 .
diff --git a/cookiecutter.json b/cookiecutter.json
index fc0e6fab00..69ecd7bc2a 100644
--- a/cookiecutter.json
+++ b/cookiecutter.json
@@ -3,42 +3,18 @@
"project_slug": "{{ cookiecutter.project_name|lower|replace(' ', '-') }}",
"domain_main": "{{cookiecutter.project_slug}}.com",
"domain_staging": "stag.{{cookiecutter.domain_main}}",
-
- "docker_swarm_stack_name_main": "{{cookiecutter.domain_main|replace('.', '-')}}",
- "docker_swarm_stack_name_staging": "{{cookiecutter.domain_staging|replace('.', '-')}}",
-
+ "env_prefix": "{{cookiecutter.project_slug|replace('-', '_')|upper}}_",
"secret_key": "changethis",
- "first_superuser": "admin@{{cookiecutter.domain_main}}",
- "first_superuser_password": "changethis",
- "backend_cors_origins": "[\"http://localhost\", \"http://localhost:4200\", \"http://localhost:3000\", \"http://localhost:8080\", \"https://localhost\", \"https://localhost:4200\", \"https://localhost:3000\", \"https://localhost:8080\", \"http://dev.{{cookiecutter.domain_main}}\", \"https://{{cookiecutter.domain_staging}}\", \"https://{{cookiecutter.domain_main}}\", \"http://local.dockertoolbox.tiangolo.com\", \"http://localhost.tiangolo.com\"]",
- "smtp_port": "587",
- "smtp_host": "",
- "smtp_user": "",
- "smtp_password": "",
- "smtp_emails_from_email": "info@{{cookiecutter.domain_main}}",
-
- "postgres_password": "changethis",
- "pgadmin_default_user": "{{cookiecutter.first_superuser}}",
- "pgadmin_default_user_password": "{{cookiecutter.first_superuser_password}}",
- "traefik_constraint_tag": "{{cookiecutter.domain_main}}",
- "traefik_constraint_tag_staging": "{{cookiecutter.domain_staging}}",
- "traefik_public_constraint_tag": "traefik-public",
- "flower_auth": "admin:{{cookiecutter.first_superuser_password}}",
-
- "sentry_dsn": "",
+ "postgres_password": "changethis",
"docker_image_prefix": "",
- "docker_image_backend": "{{cookiecutter.docker_image_prefix}}backend",
- "docker_image_celeryworker": "{{cookiecutter.docker_image_prefix}}celeryworker",
- "docker_image_frontend": "{{cookiecutter.docker_image_prefix}}frontend",
-
+ "docker_image_service": "{{cookiecutter.docker_image_prefix}}{{cookiecutter.project_slug}}",
+ "service_port": "8071",
"_copy_without_render": [
- "frontend/src/**/*.html",
- "frontend/src/**/*.vue",
- "frontend/node_modules/*",
- "backend/app/app/email-templates/**"
+ "**/chart/templates/**/*",
+ "**/chart/templates/*"
]
}
diff --git a/{{cookiecutter.project_slug}}/.env b/{{cookiecutter.project_slug}}/.env
index f6540eeff7..e831876170 100644
--- a/{{cookiecutter.project_slug}}/.env
+++ b/{{cookiecutter.project_slug}}/.env
@@ -1,45 +1,14 @@
-DOMAIN=localhost
-# DOMAIN=local.dockertoolbox.tiangolo.com
-# DOMAIN=localhost.tiangolo.com
-# DOMAIN=dev.{{cookiecutter.domain_main}}
+{{cookiecutter.env_prefix}}DOMAIN=localhost
-STACK_NAME={{cookiecutter.docker_swarm_stack_name_main}}
-
-TRAEFIK_PUBLIC_NETWORK=traefik-public
-TRAEFIK_TAG={{cookiecutter.traefik_constraint_tag}}
-TRAEFIK_PUBLIC_TAG={{cookiecutter.traefik_public_constraint_tag}}
-
-DOCKER_IMAGE_BACKEND={{cookiecutter.docker_image_backend}}
-DOCKER_IMAGE_CELERYWORKER={{cookiecutter.docker_image_celeryworker}}
-DOCKER_IMAGE_FRONTEND={{cookiecutter.docker_image_frontend}}
+{{cookiecutter.env_prefix}}DOCKER_IMAGE_BACKEND={{cookiecutter.docker_image_service}}
# Backend
-BACKEND_CORS_ORIGINS={{cookiecutter.backend_cors_origins}}
-PROJECT_NAME={{cookiecutter.project_name}}
-SECRET_KEY={{cookiecutter.secret_key}}
-FIRST_SUPERUSER={{cookiecutter.first_superuser}}
-FIRST_SUPERUSER_PASSWORD={{cookiecutter.first_superuser_password}}
-SMTP_TLS=True
-SMTP_PORT={{cookiecutter.smtp_port}}
-SMTP_HOST={{cookiecutter.smtp_host}}
-SMTP_USER={{cookiecutter.smtp_user}}
-SMTP_PASSWORD={{cookiecutter.smtp_password}}
-EMAILS_FROM_EMAIL={{cookiecutter.smtp_emails_from_email}}
-
-USERS_OPEN_REGISTRATION=False
+{{cookiecutter.env_prefix}}PROJECT_NAME={{cookiecutter.project_name}}
+{{cookiecutter.env_prefix}}SECRET_KEY={{cookiecutter.secret_key}}
-SENTRY_DSN={{cookiecutter.sentry_dsn}}
-
-# Flower
-FLOWER_BASIC_AUTH={{cookiecutter.flower_auth}}
# Postgres
-POSTGRES_SERVER=db
-POSTGRES_USER=postgres
-POSTGRES_PASSWORD={{cookiecutter.postgres_password}}
-POSTGRES_DB=app
-
-# PgAdmin
-PGADMIN_LISTEN_PORT=5050
-PGADMIN_DEFAULT_EMAIL={{cookiecutter.pgadmin_default_user}}
-PGADMIN_DEFAULT_PASSWORD={{cookiecutter.pgadmin_default_user_password}}
+{{cookiecutter.env_prefix}}POSTGRES_SERVER=db
+{{cookiecutter.env_prefix}}POSTGRES_USER=postgres
+{{cookiecutter.env_prefix}}POSTGRES_PASSWORD={{cookiecutter.postgres_password}}
+{{cookiecutter.env_prefix}}POSTGRES_DB=app
diff --git a/{{cookiecutter.project_slug}}/.gitlab-ci.yml b/{{cookiecutter.project_slug}}/.gitlab-ci.yml
deleted file mode 100644
index cd730c1b80..0000000000
--- a/{{cookiecutter.project_slug}}/.gitlab-ci.yml
+++ /dev/null
@@ -1,74 +0,0 @@
-image: tiangolo/docker-with-compose
-
-before_script:
- - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- - pip install docker-auto-labels
-
-stages:
- - test
- - build
- - deploy
-
-tests:
- stage: test
- script:
- - sh ./scripts/test.sh
- tags:
- - build
- - test
-
-build-stag:
- stage: build
- script:
- - TAG=stag FRONTEND_ENV=staging sh ./scripts/build-push.sh
- only:
- - master
- tags:
- - build
- - test
-
-build-prod:
- stage: build
- script:
- - TAG=prod FRONTEND_ENV=production sh ./scripts/build-push.sh
- only:
- - production
- tags:
- - build
- - test
-
-deploy-stag:
- stage: deploy
- script:
- - >
- DOMAIN={{cookiecutter.domain_staging}}
- TRAEFIK_TAG={{cookiecutter.traefik_constraint_tag_staging}}
- STACK_NAME={{cookiecutter.docker_swarm_stack_name_staging}}
- TAG=stag
- sh ./scripts/deploy.sh
- environment:
- name: staging
- url: https://{{cookiecutter.domain_staging}}
- only:
- - master
- tags:
- - swarm
- - stag
-
-deploy-prod:
- stage: deploy
- script:
- - >
- DOMAIN={{cookiecutter.domain_main}}
- TRAEFIK_TAG={{cookiecutter.traefik_constraint_tag}}
- STACK_NAME={{cookiecutter.docker_swarm_stack_name_main}}
- TAG=prod
- sh ./scripts/deploy.sh
- environment:
- name: production
- url: https://{{cookiecutter.domain_main}}
- only:
- - production
- tags:
- - swarm
- - prod
diff --git a/{{cookiecutter.project_slug}}/README.md b/{{cookiecutter.project_slug}}/README.md
index 5594dd546d..6683ea57b4 100644
--- a/{{cookiecutter.project_slug}}/README.md
+++ b/{{cookiecutter.project_slug}}/README.md
@@ -1,833 +1,14 @@
-# {{cookiecutter.project_name}}
-
-## Backend Requirements
-
-* [Docker](https://www.docker.com/).
-* [Docker Compose](https://docs.docker.com/compose/install/).
-* [Poetry](https://python-poetry.org/) for Python package and environment management.
-
-## Frontend Requirements
-
-* Node.js (with `npm`).
-
-## Backend local development
-
-* Start the stack with Docker Compose:
-
-```bash
-docker-compose up -d
-```
-
-* Now you can open your browser and interact with these URLs:
-
-Frontend, built with Docker, with routes handled based on the path: http://localhost
-
-Backend, JSON based web API based on OpenAPI: http://localhost/api/
-
-Automatic interactive documentation with Swagger UI (from the OpenAPI backend): http://localhost/docs
-
-Alternative automatic documentation with ReDoc (from the OpenAPI backend): http://localhost/redoc
-
-PGAdmin, PostgreSQL web administration: http://localhost:5050
-
-Flower, administration of Celery tasks: http://localhost:5555
-
-Traefik UI, to see how the routes are being handled by the proxy: http://localhost:8090
-
-**Note**: The first time you start your stack, it might take a minute for it to be ready. While the backend waits for the database to be ready and configures everything. You can check the logs to monitor it.
-
-To check the logs, run:
-
-```bash
-docker-compose logs
-```
-
-To check the logs of a specific service, add the name of the service, e.g.:
-
-```bash
-docker-compose logs backend
-```
-
-If your Docker is not running in `localhost` (the URLs above wouldn't work) check the sections below on **Development with Docker Toolbox** and **Development with a custom IP**.
-
-## Backend local development, additional details
-
-### General workflow
-
-By default, the dependencies are managed with [Poetry](https://python-poetry.org/), go there and install it.
-
-From `./backend/app/` you can install all the dependencies with:
-
-```console
-$ poetry install
-```
-
-Then you can start a shell session with the new environment with:
-
-```console
-$ poetry shell
-```
-
-Next, open your editor at `./backend/app/` (instead of the project root: `./`), so that you see an `./app/` directory with your code inside. That way, your editor will be able to find all the imports, etc. Make sure your editor uses the environment you just created with Poetry.
-
-Modify or add SQLAlchemy models in `./backend/app/app/models/`, Pydantic schemas in `./backend/app/app/schemas/`, API endpoints in `./backend/app/app/api/`, CRUD (Create, Read, Update, Delete) utils in `./backend/app/app/crud/`. The easiest might be to copy the ones for Items (models, endpoints, and CRUD utils) and update them to your needs.
-
-Add and modify tasks to the Celery worker in `./backend/app/app/worker.py`.
-
-If you need to install any additional package to the worker, add it to the file `./backend/app/celeryworker.dockerfile`.
-
-### Docker Compose Override
-
-During development, you can change Docker Compose settings that will only affect the local development environment, in the file `docker-compose.override.yml`.
-
-The changes to that file only affect the local development environment, not the production environment. So, you can add "temporary" changes that help the development workflow.
-
-For example, the directory with the backend code is mounted as a Docker "host volume", mapping the code you change live to the directory inside the container. That allows you to test your changes right away, without having to build the Docker image again. It should only be done during development, for production, you should build the Docker image with a recent version of the backend code. But during development, it allows you to iterate very fast.
-
-There is also a command override that runs `/start-reload.sh` (included in the base image) instead of the default `/start.sh` (also included in the base image). It starts a single server process (instead of multiple, as would be for production) and reloads the process whenever the code changes. Have in mind that if you have a syntax error and save the Python file, it will break and exit, and the container will stop. After that, you can restart the container by fixing the error and running again:
-
-```console
-$ docker-compose up -d
-```
-
-There is also a commented out `command` override, you can uncomment it and comment the default one. It makes the backend container run a process that does "nothing", but keeps the container alive. That allows you to get inside your running container and execute commands inside, for example a Python interpreter to test installed dependencies, or start the development server that reloads when it detects changes, or start a Jupyter Notebook session.
-
-To get inside the container with a `bash` session you can start the stack with:
-
-```console
-$ docker-compose up -d
-```
-
-and then `exec` inside the running container:
-
-```console
-$ docker-compose exec backend bash
-```
-
-You should see an output like:
-
-```console
-root@7f2607af31c3:/app#
-```
-
-that means that you are in a `bash` session inside your container, as a `root` user, under the `/app` directory.
-
-There you can use the script `/start-reload.sh` to run the debug live reloading server. You can run that script from inside the container with:
-
-```console
-$ bash /start-reload.sh
-```
-
-...it will look like:
-
-```console
-root@7f2607af31c3:/app# bash /start-reload.sh
-```
-
-and then hit enter. That runs the live reloading server that auto reloads when it detects code changes.
-
-Nevertheless, if it doesn't detect a change but a syntax error, it will just stop with an error. But as the container is still alive and you are in a Bash session, you can quickly restart it after fixing the error, running the same command ("up arrow" and "Enter").
-
-...this previous detail is what makes it useful to have the container alive doing nothing and then, in a Bash session, make it run the live reload server.
-
-### Backend tests
-
-To test the backend run:
-
-```console
-$ DOMAIN=backend sh ./scripts/test.sh
-```
-
-The file `./scripts/test.sh` has the commands to generate a testing `docker-stack.yml` file, start the stack and test it.
-
-The tests run with Pytest, modify and add tests to `./backend/app/app/tests/`.
-
-If you use GitLab CI the tests will run automatically.
-
-#### Local tests
-
-Start the stack with this command:
-
-```Bash
-DOMAIN=backend sh ./scripts/test-local.sh
-```
-The `./backend/app` directory is mounted as a "host volume" inside the docker container (set in the file `docker-compose.dev.volumes.yml`).
-You can rerun the test on live code:
-
-```Bash
-docker-compose exec backend /app/tests-start.sh
-```
-
-#### Test running stack
-
-If your stack is already up and you just want to run the tests, you can use:
-
-```bash
-docker-compose exec backend /app/tests-start.sh
-```
-
-That `/app/tests-start.sh` script just calls `pytest` after making sure that the rest of the stack is running. If you need to pass extra arguments to `pytest`, you can pass them to that command and they will be forwarded.
-
-For example, to stop on first error:
-
-```bash
-docker-compose exec backend bash /app/tests-start.sh -x
-```
-
-#### Test Coverage
-
-Because the test scripts forward arguments to `pytest`, you can enable test coverage HTML report generation by passing `--cov-report=html`.
-
-To run the local tests with coverage HTML reports:
-
-```Bash
-DOMAIN=backend sh ./scripts/test-local.sh --cov-report=html
-```
-
-To run the tests in a running stack with coverage HTML reports:
-
-```bash
-docker-compose exec backend bash /app/tests-start.sh --cov-report=html
-```
-
-### Live development with Python Jupyter Notebooks
-
-If you know about Python [Jupyter Notebooks](http://jupyter.org/), you can take advantage of them during local development.
-
-The `docker-compose.override.yml` file sends a variable `env` with a value `dev` to the build process of the Docker image (during local development) and the `Dockerfile` has steps to then install and configure Jupyter inside your Docker container.
-
-So, you can enter into the running Docker container:
-
-```bash
-docker-compose exec backend bash
-```
-
-And use the environment variable `$JUPYTER` to run a Jupyter Notebook with everything configured to listen on the public port (so that you can use it from your browser).
-
-It will output something like:
-
-```console
-root@73e0ec1f1ae6:/app# $JUPYTER
-[I 12:02:09.975 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
-[I 12:02:10.317 NotebookApp] Serving notebooks from local directory: /app
-[I 12:02:10.317 NotebookApp] The Jupyter Notebook is running at:
-[I 12:02:10.317 NotebookApp] http://(73e0ec1f1ae6 or 127.0.0.1):8888/?token=f20939a41524d021fbfc62b31be8ea4dd9232913476f4397
-[I 12:02:10.317 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
-[W 12:02:10.317 NotebookApp] No web browser found: could not locate runnable browser.
-[C 12:02:10.317 NotebookApp]
-
- Copy/paste this URL into your browser when you connect for the first time,
- to login with a token:
- http://(73e0ec1f1ae6 or 127.0.0.1):8888/?token=f20939a41524d021fbfc62b31be8ea4dd9232913476f4397
-```
-
-you can copy that URL and modify the "host" to be `localhost` or the domain you are using for development (e.g. `local.dockertoolbox.tiangolo.com`), in the case above, it would be, e.g.:
-
-```
-http://localhost:8888/token=f20939a41524d021fbfc62b31be8ea4dd9232913476f4397
-```
-
- and then open it in your browser.
-
-You will have a full Jupyter Notebook running inside your container that has direct access to your database by the container name (`db`), etc. So, you can just run sections of your backend code directly, for example with [VS Code Python Jupyter Interactive Window](https://code.visualstudio.com/docs/python/jupyter-support-py) or [Hydrogen](https://github.com/nteract/hydrogen).
-
-### Migrations
-
-As during local development your app directory is mounted as a volume inside the container, you can also run the migrations with `alembic` commands inside the container and the migration code will be in your app directory (instead of being only inside the container). So you can add it to your git repository.
-
-Make sure you create a "revision" of your models and that you "upgrade" your database with that revision every time you change them. As this is what will update the tables in your database. Otherwise, your application will have errors.
-
-* Start an interactive session in the backend container:
-
-```console
-$ docker-compose exec backend bash
-```
-
-* If you created a new model in `./backend/app/app/models/`, make sure to import it in `./backend/app/app/db/base.py`, that Python module (`base.py`) that imports all the models will be used by Alembic.
-
-* After changing a model (for example, adding a column), inside the container, create a revision, e.g.:
-
-```console
-$ alembic revision --autogenerate -m "Add column last_name to User model"
-```
-
-* Commit to the git repository the files generated in the alembic directory.
-
-* After creating the revision, run the migration in the database (this is what will actually change the database):
-
-```console
-$ alembic upgrade head
-```
-
-If you don't want to use migrations at all, uncomment the line in the file at `./backend/app/app/db/init_db.py` with:
-
-```python
-Base.metadata.create_all(bind=engine)
-```
-
-and comment the line in the file `prestart.sh` that contains:
-
-```console
-$ alembic upgrade head
-```
-
-If you don't want to start with the default models and want to remove them / modify them, from the beginning, without having any previous revision, you can remove the revision files (`.py` Python files) under `./backend/app/alembic/versions/`. And then create a first migration as described above.
-
-### Development with Docker Toolbox
-
-If you are using **Docker Toolbox** in Windows or macOS instead of **Docker for Windows** or **Docker for Mac**, Docker will be running in a VirtualBox Virtual Machine, and it will have a local IP different than `127.0.0.1`, which is the IP address for `localhost` in your machine.
-
-The address of your Docker Toolbox virtual machine would probably be `192.168.99.100` (that is the default).
-
-As this is a common case, the domain `local.dockertoolbox.tiangolo.com` points to that (private) IP, just to help with development (actually `dockertoolbox.tiangolo.com` and all its subdomains point to that IP). That way, you can start the stack in Docker Toolbox, and use that domain for development. You will be able to open that URL in Chrome and it will communicate with your local Docker Toolbox directly as if it was a cloud server, including CORS (Cross Origin Resource Sharing).
-
-If you used the default CORS enabled domains while generating the project, `local.dockertoolbox.tiangolo.com` was configured to be allowed. If you didn't, you will need to add it to the list in the variable `BACKEND_CORS_ORIGINS` in the `.env` file.
-
-To configure it in your stack, follow the section **Change the development "domain"** below, using the domain `local.dockertoolbox.tiangolo.com`.
-
-After performing those steps you should be able to open: http://local.dockertoolbox.tiangolo.com and it will be server by your stack in your Docker Toolbox virtual machine.
-
-Check all the corresponding available URLs in the section at the end.
-
-### Development in `localhost` with a custom domain
-
-You might want to use something different than `localhost` as the domain. For example, if you are having problems with cookies that need a subdomain, and Chrome is not allowing you to use `localhost`.
-
-In that case, you have two options: you could use the instructions to modify your system `hosts` file with the instructions below in **Development with a custom IP** or you can just use `localhost.tiangolo.com`, it is set up to point to `localhost` (to the IP `127.0.0.1`) and all its subdomains too. And as it is an actual domain, the browsers will store the cookies you set during development, etc.
-
-If you used the default CORS enabled domains while generating the project, `localhost.tiangolo.com` was configured to be allowed. If you didn't, you will need to add it to the list in the variable `BACKEND_CORS_ORIGINS` in the `.env` file.
-
-To configure it in your stack, follow the section **Change the development "domain"** below, using the domain `localhost.tiangolo.com`.
-
-After performing those steps you should be able to open: http://localhost.tiangolo.com and it will be server by your stack in `localhost`.
-
-Check all the corresponding available URLs in the section at the end.
-
-### Development with a custom IP
-
-If you are running Docker in an IP address different than `127.0.0.1` (`localhost`) and `192.168.99.100` (the default of Docker Toolbox), you will need to perform some additional steps. That will be the case if you are running a custom Virtual Machine, a secondary Docker Toolbox or your Docker is located in a different machine in your network.
-
-In that case, you will need to use a fake local domain (`dev.{{cookiecutter.domain_main}}`) and make your computer think that the domain is is served by the custom IP (e.g. `192.168.99.150`).
-
-If you used the default CORS enabled domains, `dev.{{cookiecutter.domain_main}}` was configured to be allowed. If you want a custom one, you need to add it to the list in the variable `BACKEND_CORS_ORIGINS` in the `.env` file.
-
-* Open your `hosts` file with administrative privileges using a text editor:
- * **Note for Windows**: If you are in Windows, open the main Windows menu, search for "notepad", right click on it, and select the option "open as Administrator" or similar. Then click the "File" menu, "Open file", go to the directory `c:\Windows\System32\Drivers\etc\`, select the option to show "All files" instead of only "Text (.txt) files", and open the `hosts` file.
- * **Note for Mac and Linux**: Your `hosts` file is probably located at `/etc/hosts`, you can edit it in a terminal running `sudo nano /etc/hosts`.
-
-* Additional to the contents it might have, add a new line with the custom IP (e.g. `192.168.99.150`) a space character, and your fake local domain: `dev.{{cookiecutter.domain_main}}`.
-
-The new line might look like:
-
-```
-192.168.99.100 dev.{{cookiecutter.domain_main}}
-```
-
-* Save the file.
- * **Note for Windows**: Make sure you save the file as "All files", without an extension of `.txt`. By default, Windows tries to add the extension. Make sure the file is saved as is, without extension.
-
-...that will make your computer think that the fake local domain is served by that custom IP, and when you open that URL in your browser, it will talk directly to your locally running server when it is asked to go to `dev.{{cookiecutter.domain_main}}` and think that it is a remote server while it is actually running in your computer.
-
-To configure it in your stack, follow the section **Change the development "domain"** below, using the domain `dev.{{cookiecutter.domain_main}}`.
-
-After performing those steps you should be able to open: http://dev.{{cookiecutter.domain_main}} and it will be server by your stack in `localhost`.
-
-Check all the corresponding available URLs in the section at the end.
-
-### Change the development "domain"
-
-If you need to use your local stack with a different domain than `localhost`, you need to make sure the domain you use points to the IP where your stack is set up. See the different ways to achieve that in the sections above (i.e. using Docker Toolbox with `local.dockertoolbox.tiangolo.com`, using `localhost.tiangolo.com` or using `dev.{{cookiecutter.domain_main}}`).
-
-To simplify your Docker Compose setup, for example, so that the API docs (Swagger UI) knows where is your API, you should let it know you are using that domain for development. You will need to edit 1 line in 2 files.
-
-* Open the file located at `./.env`. It would have a line like:
-
-```
-DOMAIN=localhost
-```
-
-* Change it to the domain you are going to use, e.g.:
-
-```
-DOMAIN=localhost.tiangolo.com
-```
-
-That variable will be used by the Docker Compose files.
-
-* Now open the file located at `./frontend/.env`. It would have a line like:
-
-```
-VUE_APP_DOMAIN_DEV=localhost
-```
-
-* Change that line to the domain you are going to use, e.g.:
-
-```
-VUE_APP_DOMAIN_DEV=localhost.tiangolo.com
-```
-
-That variable will make your frontend communicate with that domain when interacting with your backend API, when the other variable `VUE_APP_ENV` is set to `development`.
-
-After changing the two lines, you can re-start your stack with:
-
-```bash
-docker-compose up -d
-```
-
-and check all the corresponding available URLs in the section at the end.
-
-## Frontend development
-
-* Enter the `frontend` directory, install the NPM packages and start the live server using the `npm` scripts:
-
-```bash
-cd frontend
-npm install
-npm run serve
-```
-
-Then open your browser at http://localhost:8080
-
-Notice that this live server is not running inside Docker, it is for local development, and that is the recommended workflow. Once you are happy with your frontend, you can build the frontend Docker image and start it, to test it in a production-like environment. But compiling the image at every change will not be as productive as running the local development server with live reload.
-
-Check the file `package.json` to see other available options.
-
-If you have Vue CLI installed, you can also run `vue ui` to control, configure, serve, and analyze your application using a nice local web user interface.
-
-If you are only developing the frontend (e.g. other team members are developing the backend) and there is a staging environment already deployed, you can make your local development code use that staging API instead of a full local Docker Compose stack.
-
-To do that, modify the file `./frontend/.env`, there's a section with:
-
-```
-VUE_APP_ENV=development
-# VUE_APP_ENV=staging
-```
-
-* Switch the comment, to:
-
-```
-# VUE_APP_ENV=development
-VUE_APP_ENV=staging
-```
-
-### Removing the frontend
-
-If you are developing an API-only app and want to remove the frontend, you can do it easily:
-
-* Remove the `./frontend` directory.
-* In the `docker-compose.yml` file, remove the whole service / section `frontend`.
-* In the `docker-compose.override.yml` file, remove the whole service / section `frontend`.
-
-Done, you have a frontend-less (api-only) app. 🔥 🚀
-
----
-
-If you want, you can also remove the `FRONTEND` environment variables from:
-
-* `.env`
-* `.gitlab-ci.yml`
-* `./scripts/*.sh`
-
-But it would be only to clean them up, leaving them won't really have any effect either way.
-
-## Deployment
-
-You can deploy the stack to a Docker Swarm mode cluster with a main Traefik proxy, set up using the ideas from DockerSwarm.rocks, to get automatic HTTPS certificates, etc.
-
-And you can use CI (continuous integration) systems to do it automatically.
-
-But you have to configure a couple things first.
-
-### Traefik network
-
-This stack expects the public Traefik network to be named `traefik-public`, just as in the tutorials in DockerSwarm.rocks.
-
-If you need to use a different Traefik public network name, update it in the `docker-compose.yml` files, in the section:
-
-```YAML
-networks:
- traefik-public:
- external: true
-```
-
-Change `traefik-public` to the name of the used Traefik network. And then update it in the file `.env`:
-
-```bash
-TRAEFIK_PUBLIC_NETWORK=traefik-public
-```
-
-### Persisting Docker named volumes
-
-You need to make sure that each service (Docker container) that uses a volume is always deployed to the same Docker "node" in the cluster, that way it will preserve the data. Otherwise, it could be deployed to a different node each time, and each time the volume would be created in that new node before starting the service. As a result, it would look like your service was starting from scratch every time, losing all the previous data.
-
-That's specially important for a service running a database. But the same problem would apply if you were saving files in your main backend service (for example, if those files were uploaded by your users, or if they were created by your system).
-
-To solve that, you can put constraints in the services that use one or more data volumes (like databases) to make them be deployed to a Docker node with a specific label. And of course, you need to have that label assigned to one (only one) of your nodes.
-
-#### Adding services with volumes
-
-For each service that uses a volume (databases, services with uploaded files, etc) you should have a label constraint in your `docker-compose.yml` file.
-
-To make sure that your labels are unique per volume per stack (for example, that they are not the same for `prod` and `stag`) you should prefix them with the name of your stack and then use the same name of the volume.
-
-Then you need to have those constraints in your `docker-compose.yml` file for the services that need to be fixed with each volume.
-
-To be able to use different environments, like `prod` and `stag`, you should pass the name of the stack as an environment variable. Like:
-
-```bash
-STACK_NAME={{cookiecutter.docker_swarm_stack_name_staging}} sh ./scripts/deploy.sh
-```
-
-To use and expand that environment variable inside the `docker-compose.yml` files you can add the constraints to the services like:
-
-```yaml
-version: '3'
-services:
- db:
- volumes:
- - 'app-db-data:/var/lib/postgresql/data/pgdata'
- deploy:
- placement:
- constraints:
- - node.labels.${STACK_NAME?Variable not set}.app-db-data == true
-```
-
-note the `${STACK_NAME?Variable not set}`. In the script `./scripts/deploy.sh`, the `docker-compose.yml` would be converted, and saved to a file `docker-stack.yml` containing:
-
-```yaml
-version: '3'
-services:
- db:
- volumes:
- - 'app-db-data:/var/lib/postgresql/data/pgdata'
- deploy:
- placement:
- constraints:
- - node.labels.{{cookiecutter.docker_swarm_stack_name_main}}.app-db-data == true
-```
-
-**Note**: The `${STACK_NAME?Variable not set}` means "use the environment variable `STACK_NAME`, but if it is not set, show an error `Variable not set`".
-
-If you add more volumes to your stack, you need to make sure you add the corresponding constraints to the services that use that named volume.
-
-Then you have to create those labels in some nodes in your Docker Swarm mode cluster. You can use `docker-auto-labels` to do it automatically.
-
-#### `docker-auto-labels`
-
-You can use [`docker-auto-labels`](https://github.com/tiangolo/docker-auto-labels) to automatically read the placement constraint labels in your Docker stack (Docker Compose file) and assign them to a random Docker node in your Swarm mode cluster if those labels don't exist yet.
-
-To do that, you can install `docker-auto-labels`:
-
-```bash
-pip install docker-auto-labels
+### Start up for development
```
-
-And then run it passing your `docker-stack.yml` file as a parameter:
-
-```bash
-docker-auto-labels docker-stack.yml
-```
-
-You can run that command every time you deploy, right before deploying, as it doesn't modify anything if the required labels already exist.
-
-#### (Optionally) adding labels manually
-
-If you don't want to use `docker-auto-labels` or for any reason you want to manually assign the constraint labels to specific nodes in your Docker Swarm mode cluster, you can do the following:
-
-* First, connect via SSH to your Docker Swarm mode cluster.
-
-* Then check the available nodes with:
-
-```console
-$ docker node ls
-
-
-// you would see an output like:
-
-ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
-nfa3d4df2df34as2fd34230rm * dog.example.com Ready Active Reachable
-2c2sd2342asdfasd42342304e cat.example.com Ready Active Leader
-c4sdf2342asdfasd4234234ii snake.example.com Ready Active Reachable
+tilt up --stream
```
-then chose a node from the list. For example, `dog.example.com`.
-
-* Add the label to that node. Use as label the name of the stack you are deploying followed by a dot (`.`) followed by the named volume, and as value, just `true`, e.g.:
-
-```bash
-docker node update --label-add {{cookiecutter.docker_swarm_stack_name_main}}.app-db-data=true dog.example.com
-```
-
-* Then you need to do the same for each stack version you have. For example, for staging you could do:
-
-```bash
-docker node update --label-add {{cookiecutter.docker_swarm_stack_name_staging}}.app-db-data=true cat.example.com
-```
-
-### Deploy to a Docker Swarm mode cluster
-
-There are 3 steps:
-
-1. **Build** your app images
-2. Optionally, **push** your custom images to a Docker Registry
-3. **Deploy** your stack
-
----
-
-Here are the steps in detail:
-
-1. **Build your app images**
-
-* Set these environment variables, right before the next command:
- * `TAG=prod`
- * `FRONTEND_ENV=production`
-* Use the provided `scripts/build.sh` file with those environment variables:
-
-```bash
-TAG=prod FRONTEND_ENV=production bash ./scripts/build.sh
-```
-
-2. **Optionally, push your images to a Docker Registry**
-
-**Note**: if the deployment Docker Swarm mode "cluster" has more than one server, you will have to push the images to a registry or build the images in each server, so that when each of the servers in your cluster tries to start the containers it can get the Docker images for them, pulling them from a Docker Registry or because it has them already built locally.
-
-If you are using a registry and pushing your images, you can omit running the previous script and instead using this one, in a single shot.
-
-* Set these environment variables:
- * `TAG=prod`
- * `FRONTEND_ENV=production`
-* Use the provided `scripts/build-push.sh` file with those environment variables:
-
-```bash
-TAG=prod FRONTEND_ENV=production bash ./scripts/build-push.sh
-```
-
-3. **Deploy your stack**
-
-* Set these environment variables:
- * `DOMAIN={{cookiecutter.domain_main}}`
- * `TRAEFIK_TAG={{cookiecutter.traefik_constraint_tag}}`
- * `STACK_NAME={{cookiecutter.docker_swarm_stack_name_main}}`
- * `TAG=prod`
-* Use the provided `scripts/deploy.sh` file with those environment variables:
-
-```bash
-DOMAIN={{cookiecutter.domain_main}} \
-TRAEFIK_TAG={{cookiecutter.traefik_constraint_tag}} \
-STACK_NAME={{cookiecutter.docker_swarm_stack_name_main}} \
-TAG=prod \
-bash ./scripts/deploy.sh
+### Manually build docker image
```
-
----
-
-If you change your mind and, for example, want to deploy everything to a different domain, you only have to change the `DOMAIN` environment variable in the previous commands. If you wanted to add a different version / environment of your stack, like "`preproduction`", you would only have to set `TAG=preproduction` in your command and update these other environment variables accordingly. And it would all work, that way you could have different environments and deployments of the same app in the same cluster.
-
-#### Deployment Technical Details
-
-Building and pushing is done with the `docker-compose.yml` file, using the `docker-compose` command. The file `docker-compose.yml` uses the file `.env` with default environment variables. And the scripts set some additional environment variables as well.
-
-The deployment requires using `docker stack` instead of `docker-swarm`, and it can't read environment variables or `.env` files. Because of that, the `deploy.sh` script generates a file `docker-stack.yml` with the configurations from `docker-compose.yml` and injecting the environment variables in it. And then uses it to deploy the stack.
-
-You can do the process by hand based on those same scripts if you wanted. The general structure is like this:
-
-```bash
-# Use the environment variables passed to this script, as TAG and FRONTEND_ENV
-# And re-create those variables as environment variables for the next command
-TAG=${TAG?Variable not set} \
-# Set the environment variable FRONTEND_ENV to the same value passed to this script with
-# a default value of "production" if nothing else was passed
-FRONTEND_ENV=${FRONTEND_ENV-production?Variable not set} \
-# The actual comand that does the work: docker-compose
-docker-compose \
-# Pass the file that should be used, setting explicitly docker-compose.yml avoids the
-# default of also using docker-compose.override.yml
--f docker-compose.yml \
-# Use the docker-compose sub command named "config", it just uses the docker-compose.yml
-# file passed to it and prints their combined contents
-# Put those contents in a file "docker-stack.yml", with ">"
-config > docker-stack.yml
-
-# The previous only generated a docker-stack.yml file,
-# but didn't do anything with it yet
-
-# docker-auto-labels makes sure the labels used for constraints exist in the cluster
-docker-auto-labels docker-stack.yml
-
-# Now this command uses that same file to deploy it
-docker stack deploy -c docker-stack.yml --with-registry-auth "${STACK_NAME?Variable not set}"
+docker build -f infra/backend.dockerfile -t local/{{cookiecutter.docker_image_service}}:0.0.1 .
```
-### Continuous Integration / Continuous Delivery
-
-If you use GitLab CI, the included `.gitlab-ci.yml` can automatically deploy it. You may need to update it according to your GitLab configurations.
-
-If you use any other CI / CD provider, you can base your deployment from that `.gitlab-ci.yml` file, as all the actual script steps are performed in `bash` scripts that you can easily re-use.
-
-GitLab CI is configured assuming 2 environments following GitLab flow:
-
-* `prod` (production) from the `production` branch.
-* `stag` (staging) from the `master` branch.
-
-If you need to add more environments, for example, you could imagine using a client-approved `preprod` branch, you can just copy the configurations in `.gitlab-ci.yml` for `stag` and rename the corresponding variables. The Docker Compose file and environment variables are configured to support as many environments as you need, so that you only need to modify `.gitlab-ci.yml` (or whichever CI system configuration you are using).
-
-## Docker Compose files and env vars
-
-There is a main `docker-compose.yml` file with all the configurations that apply to the whole stack, it is used automatically by `docker-compose`.
-
-And there's also a `docker-compose.override.yml` with overrides for development, for example to mount the source code as a volume. It is used automatically by `docker-compose` to apply overrides on top of `docker-compose.yml`.
-
-These Docker Compose files use the `.env` file containing configurations to be injected as environment variables in the containers.
-
-They also use some additional configurations taken from environment variables set in the scripts before calling the `docker-compose` command.
-
-It is all designed to support several "stages", like development, building, testing, and deployment. Also, allowing the deployment to different environments like staging and production (and you can add more environments very easily).
-
-They are designed to have the minimum repetition of code and configurations, so that if you need to change something, you have to change it in the minimum amount of places. That's why files use environment variables that get auto-expanded. That way, if for example, you want to use a different domain, you can call the `docker-compose` command with a different `DOMAIN` environment variable instead of having to change the domain in several places inside the Docker Compose files.
-
-Also, if you want to have another deployment environment, say `preprod`, you just have to change environment variables, but you can keep using the same Docker Compose files.
-
-### The .env file
-
-The `.env` file is the one that contains all your configurations, generated keys and passwords, etc.
-
-Depending on your workflow, you could want to exclude it from Git, for example if your project is public. In that case, you would have to make sure to set up a way for your CI tools to obtain it while building or deploying your project.
-
-One way to do it could be to add each environment variable to your CI/CD system, and updating the `docker-compose.yml` file to read that specific env var instead of reading the `.env` file.
-
-## URLs
-
-These are the URLs that will be used and generated by the project.
-
-### Production URLs
-
-Production URLs, from the branch `production`.
-
-Frontend: https://{{cookiecutter.domain_main}}
-
-Backend: https://{{cookiecutter.domain_main}}/api/
-
-Automatic Interactive Docs (Swagger UI): https://{{cookiecutter.domain_main}}/docs
-
-Automatic Alternative Docs (ReDoc): https://{{cookiecutter.domain_main}}/redoc
-
-PGAdmin: https://pgadmin.{{cookiecutter.domain_main}}
-
-Flower: https://flower.{{cookiecutter.domain_main}}
-
-### Staging URLs
-
-Staging URLs, from the branch `master`.
-
-Frontend: https://{{cookiecutter.domain_staging}}
-
-Backend: https://{{cookiecutter.domain_staging}}/api/
-
-Automatic Interactive Docs (Swagger UI): https://{{cookiecutter.domain_staging}}/docs
-
-Automatic Alternative Docs (ReDoc): https://{{cookiecutter.domain_staging}}/redoc
-
-PGAdmin: https://pgadmin.{{cookiecutter.domain_staging}}
-
-Flower: https://flower.{{cookiecutter.domain_staging}}
-
-### Development URLs
-
-Development URLs, for local development.
-
-Frontend: http://localhost
-
-Backend: http://localhost/api/
-
-Automatic Interactive Docs (Swagger UI): https://localhost/docs
-
-Automatic Alternative Docs (ReDoc): https://localhost/redoc
-
-PGAdmin: http://localhost:5050
-
-Flower: http://localhost:5555
-
-Traefik UI: http://localhost:8090
-
-### Development with Docker Toolbox URLs
-
-Development URLs, for local development.
-
-Frontend: http://local.dockertoolbox.tiangolo.com
-
-Backend: http://local.dockertoolbox.tiangolo.com/api/
-
-Automatic Interactive Docs (Swagger UI): https://local.dockertoolbox.tiangolo.com/docs
-
-Automatic Alternative Docs (ReDoc): https://local.dockertoolbox.tiangolo.com/redoc
-
-PGAdmin: http://local.dockertoolbox.tiangolo.com:5050
-
-Flower: http://local.dockertoolbox.tiangolo.com:5555
-
-Traefik UI: http://local.dockertoolbox.tiangolo.com:8090
-
-### Development with a custom IP URLs
-
-Development URLs, for local development.
-
-Frontend: http://dev.{{cookiecutter.domain_main}}
-
-Backend: http://dev.{{cookiecutter.domain_main}}/api/
-
-Automatic Interactive Docs (Swagger UI): https://dev.{{cookiecutter.domain_main}}/docs
-
-Automatic Alternative Docs (ReDoc): https://dev.{{cookiecutter.domain_main}}/redoc
-
-PGAdmin: http://dev.{{cookiecutter.domain_main}}:5050
-
-Flower: http://dev.{{cookiecutter.domain_main}}:5555
-
-Traefik UI: http://dev.{{cookiecutter.domain_main}}:8090
-
-### Development in localhost with a custom domain URLs
-
-Development URLs, for local development.
-
-Frontend: http://localhost.tiangolo.com
-
-Backend: http://localhost.tiangolo.com/api/
-
-Automatic Interactive Docs (Swagger UI): https://localhost.tiangolo.com/docs
-
-Automatic Alternative Docs (ReDoc): https://localhost.tiangolo.com/redoc
-
-PGAdmin: http://localhost.tiangolo.com:5050
-
-Flower: http://localhost.tiangolo.com:5555
-
-Traefik UI: http://localhost.tiangolo.com:8090
-
-## Project generation and updating, or re-generating
-
-This project was generated using https://github.com/tiangolo/full-stack-fastapi-postgresql with:
-
-```bash
-pip install cookiecutter
-cookiecutter https://github.com/tiangolo/full-stack-fastapi-postgresql
+### Install helm chart local dev
```
-
-You can check the variables used during generation in the file `cookiecutter-config-file.yml`.
-
-You can generate the project again with the same configurations used the first time.
-
-That would be useful if, for example, the project generator (`tiangolo/full-stack-fastapi-postgresql`) was updated and you wanted to integrate or review the changes.
-
-You could generate a new project with the same configurations as this one in a parallel directory. And compare the differences between the two, without having to overwrite your current code but being able to use the same variables used for your current project.
-
-To achieve that, the generated project includes the file `cookiecutter-config-file.yml` with the current variables used.
-
-You can use that file while generating a new project to reuse all those variables.
-
-For example, run:
-
-```console
-$ cookiecutter --config-file ./cookiecutter-config-file.yml --output-dir ../project-copy https://github.com/tiangolo/full-stack-fastapi-postgresql
+helm upgrade -i -f infra/chart/values-local.yaml rr infra/chart
```
-
-That will use the file `cookiecutter-config-file.yml` in the current directory (in this project) to generate a new project inside a sibling directory `project-copy`.
diff --git a/{{cookiecutter.project_slug}}/backend/.tiltignore b/{{cookiecutter.project_slug}}/backend/.tiltignore
new file mode 100644
index 0000000000..0cf9208c1a
--- /dev/null
+++ b/{{cookiecutter.project_slug}}/backend/.tiltignore
@@ -0,0 +1,2 @@
+**/infra/chart/charts
+**/infra/chart/tmpcharts
\ No newline at end of file
diff --git a/{{cookiecutter.project_slug}}/backend/Tiltfile b/{{cookiecutter.project_slug}}/backend/Tiltfile
new file mode 100644
index 0000000000..d215e45f13
--- /dev/null
+++ b/{{cookiecutter.project_slug}}/backend/Tiltfile
@@ -0,0 +1,21 @@
+db_uri = os.getenv('DB_URI')
+release_name = os.getenv('RELEASE_NAME', 'tilt-base-project')
+
+settings = ['db.url=postgresql://postgres:postgres@{}-postgresql/postgres'.format(release_name)]
+if db_uri:
+ settings = ['db.url=' + db_uri, 'postgres.enabled=false']
+
+#helm dependencies update
+local_resource('helm update', cmd='pushd infra/chart ; helm dependencies update ; popd')
+
+docker_build('local/base-project2', '.', dockerfile='infra/backend.dockerfile')
+yaml = helm(
+ 'infra/chart',
+ # The release name, equivalent to helm --name
+ name='tilt-base-project',
+ values=['infra/chart/values-local.yaml'],
+ # Values to set from the command-line
+ set=settings
+)
+
+k8s_yaml(yaml)
diff --git a/{{cookiecutter.project_slug}}/backend/app/app/api/api_v1/endpoints/login.py b/{{cookiecutter.project_slug}}/backend/app/app/api/api_v1/endpoints/login.py
deleted file mode 100644
index 4dc3a9b248..0000000000
--- a/{{cookiecutter.project_slug}}/backend/app/app/api/api_v1/endpoints/login.py
+++ /dev/null
@@ -1,96 +0,0 @@
-from datetime import timedelta
-from typing import Any
-
-from fastapi import APIRouter, Body, Depends, HTTPException
-from fastapi.security import OAuth2PasswordRequestForm
-from sqlalchemy.orm import Session
-
-from app import crud, models, schemas
-from app.api import deps
-from app.core import security
-from app.core.config import settings
-from app.core.security import get_password_hash
-from app.utils import (
- generate_password_reset_token,
- send_reset_password_email,
- verify_password_reset_token,
-)
-
-router = APIRouter()
-
-
-@router.post("/login/access-token", response_model=schemas.Token)
-def login_access_token(
- db: Session = Depends(deps.get_db), form_data: OAuth2PasswordRequestForm = Depends()
-) -> Any:
- """
- OAuth2 compatible token login, get an access token for future requests
- """
- user = crud.user.authenticate(
- db, email=form_data.username, password=form_data.password
- )
- if not user:
- raise HTTPException(status_code=400, detail="Incorrect email or password")
- elif not crud.user.is_active(user):
- raise HTTPException(status_code=400, detail="Inactive user")
- access_token_expires = timedelta(minutes=settings.ACCESS_TOKEN_EXPIRE_MINUTES)
- return {
- "access_token": security.create_access_token(
- user.id, expires_delta=access_token_expires
- ),
- "token_type": "bearer",
- }
-
-
-@router.post("/login/test-token", response_model=schemas.User)
-def test_token(current_user: models.User = Depends(deps.get_current_user)) -> Any:
- """
- Test access token
- """
- return current_user
-
-
-@router.post("/password-recovery/{email}", response_model=schemas.Msg)
-def recover_password(email: str, db: Session = Depends(deps.get_db)) -> Any:
- """
- Password Recovery
- """
- user = crud.user.get_by_email(db, email=email)
-
- if not user:
- raise HTTPException(
- status_code=404,
- detail="The user with this username does not exist in the system.",
- )
- password_reset_token = generate_password_reset_token(email=email)
- send_reset_password_email(
- email_to=user.email, email=email, token=password_reset_token
- )
- return {"msg": "Password recovery email sent"}
-
-
-@router.post("/reset-password/", response_model=schemas.Msg)
-def reset_password(
- token: str = Body(...),
- new_password: str = Body(...),
- db: Session = Depends(deps.get_db),
-) -> Any:
- """
- Reset password
- """
- email = verify_password_reset_token(token)
- if not email:
- raise HTTPException(status_code=400, detail="Invalid token")
- user = crud.user.get_by_email(db, email=email)
- if not user:
- raise HTTPException(
- status_code=404,
- detail="The user with this username does not exist in the system.",
- )
- elif not crud.user.is_active(user):
- raise HTTPException(status_code=400, detail="Inactive user")
- hashed_password = get_password_hash(new_password)
- user.hashed_password = hashed_password
- db.add(user)
- db.commit()
- return {"msg": "Password updated successfully"}
diff --git a/{{cookiecutter.project_slug}}/backend/app/app/api/api_v1/endpoints/utils.py b/{{cookiecutter.project_slug}}/backend/app/app/api/api_v1/endpoints/utils.py
deleted file mode 100644
index 71fe68d0ce..0000000000
--- a/{{cookiecutter.project_slug}}/backend/app/app/api/api_v1/endpoints/utils.py
+++ /dev/null
@@ -1,35 +0,0 @@
-from typing import Any
-
-from fastapi import APIRouter, Depends
-from pydantic.networks import EmailStr
-
-from app import models, schemas
-from app.api import deps
-from app.core.celery_app import celery_app
-from app.utils import send_test_email
-
-router = APIRouter()
-
-
-@router.post("/test-celery/", response_model=schemas.Msg, status_code=201)
-def test_celery(
- msg: schemas.Msg,
- current_user: models.User = Depends(deps.get_current_active_superuser),
-) -> Any:
- """
- Test Celery worker.
- """
- celery_app.send_task("app.worker.test_celery", args=[msg.msg])
- return {"msg": "Word received"}
-
-
-@router.post("/test-email/", response_model=schemas.Msg, status_code=201)
-def test_email(
- email_to: EmailStr,
- current_user: models.User = Depends(deps.get_current_active_superuser),
-) -> Any:
- """
- Test emails.
- """
- send_test_email(email_to=email_to)
- return {"msg": "Test email sent"}
diff --git a/{{cookiecutter.project_slug}}/backend/app/app/celeryworker_pre_start.py b/{{cookiecutter.project_slug}}/backend/app/app/celeryworker_pre_start.py
deleted file mode 100644
index 81de37134f..0000000000
--- a/{{cookiecutter.project_slug}}/backend/app/app/celeryworker_pre_start.py
+++ /dev/null
@@ -1,37 +0,0 @@
-import logging
-
-from tenacity import after_log, before_log, retry, stop_after_attempt, wait_fixed
-
-from app.db.session import SessionLocal
-
-logging.basicConfig(level=logging.INFO)
-logger = logging.getLogger(__name__)
-
-max_tries = 60 * 5 # 5 minutes
-wait_seconds = 1
-
-
-@retry(
- stop=stop_after_attempt(max_tries),
- wait=wait_fixed(wait_seconds),
- before=before_log(logger, logging.INFO),
- after=after_log(logger, logging.WARN),
-)
-def init() -> None:
- try:
- # Try to create session to check if DB is awake
- db = SessionLocal()
- db.execute("SELECT 1")
- except Exception as e:
- logger.error(e)
- raise e
-
-
-def main() -> None:
- logger.info("Initializing service")
- init()
- logger.info("Service finished initializing")
-
-
-if __name__ == "__main__":
- main()
diff --git a/{{cookiecutter.project_slug}}/backend/app/app/core/celery_app.py b/{{cookiecutter.project_slug}}/backend/app/app/core/celery_app.py
deleted file mode 100644
index 0477d14589..0000000000
--- a/{{cookiecutter.project_slug}}/backend/app/app/core/celery_app.py
+++ /dev/null
@@ -1,5 +0,0 @@
-from celery import Celery
-
-celery_app = Celery("worker", broker="amqp://guest@queue//")
-
-celery_app.conf.task_routes = {"app.worker.test_celery": "main-queue"}
diff --git a/{{cookiecutter.project_slug}}/backend/app/app/core/config.py b/{{cookiecutter.project_slug}}/backend/app/app/core/config.py
deleted file mode 100644
index 8b07276dac..0000000000
--- a/{{cookiecutter.project_slug}}/backend/app/app/core/config.py
+++ /dev/null
@@ -1,89 +0,0 @@
-import secrets
-from typing import Any, Dict, List, Optional, Union
-
-from pydantic import AnyHttpUrl, BaseSettings, EmailStr, HttpUrl, PostgresDsn, validator
-
-
-class Settings(BaseSettings):
- API_V1_STR: str = "/api/v1"
- SECRET_KEY: str = secrets.token_urlsafe(32)
- # 60 minutes * 24 hours * 8 days = 8 days
- ACCESS_TOKEN_EXPIRE_MINUTES: int = 60 * 24 * 8
- SERVER_NAME: str
- SERVER_HOST: AnyHttpUrl
- # BACKEND_CORS_ORIGINS is a JSON-formatted list of origins
- # e.g: '["http://localhost", "http://localhost:4200", "http://localhost:3000", \
- # "http://localhost:8080", "http://local.dockertoolbox.tiangolo.com"]'
- BACKEND_CORS_ORIGINS: List[AnyHttpUrl] = []
-
- @validator("BACKEND_CORS_ORIGINS", pre=True)
- def assemble_cors_origins(cls, v: Union[str, List[str]]) -> Union[List[str], str]:
- if isinstance(v, str) and not v.startswith("["):
- return [i.strip() for i in v.split(",")]
- elif isinstance(v, (list, str)):
- return v
- raise ValueError(v)
-
- PROJECT_NAME: str
- SENTRY_DSN: Optional[HttpUrl] = None
-
- @validator("SENTRY_DSN", pre=True)
- def sentry_dsn_can_be_blank(cls, v: str) -> Optional[str]:
- if len(v) == 0:
- return None
- return v
-
- POSTGRES_SERVER: str
- POSTGRES_USER: str
- POSTGRES_PASSWORD: str
- POSTGRES_DB: str
- SQLALCHEMY_DATABASE_URI: Optional[PostgresDsn] = None
-
- @validator("SQLALCHEMY_DATABASE_URI", pre=True)
- def assemble_db_connection(cls, v: Optional[str], values: Dict[str, Any]) -> Any:
- if isinstance(v, str):
- return v
- return PostgresDsn.build(
- scheme="postgresql",
- user=values.get("POSTGRES_USER"),
- password=values.get("POSTGRES_PASSWORD"),
- host=values.get("POSTGRES_SERVER"),
- path=f"/{values.get('POSTGRES_DB') or ''}",
- )
-
- SMTP_TLS: bool = True
- SMTP_PORT: Optional[int] = None
- SMTP_HOST: Optional[str] = None
- SMTP_USER: Optional[str] = None
- SMTP_PASSWORD: Optional[str] = None
- EMAILS_FROM_EMAIL: Optional[EmailStr] = None
- EMAILS_FROM_NAME: Optional[str] = None
-
- @validator("EMAILS_FROM_NAME")
- def get_project_name(cls, v: Optional[str], values: Dict[str, Any]) -> str:
- if not v:
- return values["PROJECT_NAME"]
- return v
-
- EMAIL_RESET_TOKEN_EXPIRE_HOURS: int = 48
- EMAIL_TEMPLATES_DIR: str = "/app/app/email-templates/build"
- EMAILS_ENABLED: bool = False
-
- @validator("EMAILS_ENABLED", pre=True)
- def get_emails_enabled(cls, v: bool, values: Dict[str, Any]) -> bool:
- return bool(
- values.get("SMTP_HOST")
- and values.get("SMTP_PORT")
- and values.get("EMAILS_FROM_EMAIL")
- )
-
- EMAIL_TEST_USER: EmailStr = "test@example.com" # type: ignore
- FIRST_SUPERUSER: EmailStr
- FIRST_SUPERUSER_PASSWORD: str
- USERS_OPEN_REGISTRATION: bool = False
-
- class Config:
- case_sensitive = True
-
-
-settings = Settings()
diff --git a/{{cookiecutter.project_slug}}/backend/app/app/core/security.py b/{{cookiecutter.project_slug}}/backend/app/app/core/security.py
deleted file mode 100644
index 6c6ee8bc30..0000000000
--- a/{{cookiecutter.project_slug}}/backend/app/app/core/security.py
+++ /dev/null
@@ -1,34 +0,0 @@
-from datetime import datetime, timedelta
-from typing import Any, Union
-
-from jose import jwt
-from passlib.context import CryptContext
-
-from app.core.config import settings
-
-pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
-
-
-ALGORITHM = "HS256"
-
-
-def create_access_token(
- subject: Union[str, Any], expires_delta: timedelta = None
-) -> str:
- if expires_delta:
- expire = datetime.utcnow() + expires_delta
- else:
- expire = datetime.utcnow() + timedelta(
- minutes=settings.ACCESS_TOKEN_EXPIRE_MINUTES
- )
- to_encode = {"exp": expire, "sub": str(subject)}
- encoded_jwt = jwt.encode(to_encode, settings.SECRET_KEY, algorithm=ALGORITHM)
- return encoded_jwt
-
-
-def verify_password(plain_password: str, hashed_password: str) -> bool:
- return pwd_context.verify(plain_password, hashed_password)
-
-
-def get_password_hash(password: str) -> str:
- return pwd_context.hash(password)
diff --git a/{{cookiecutter.project_slug}}/backend/app/app/db/init_db.py b/{{cookiecutter.project_slug}}/backend/app/app/db/init_db.py
deleted file mode 100644
index bc1dd2e06c..0000000000
--- a/{{cookiecutter.project_slug}}/backend/app/app/db/init_db.py
+++ /dev/null
@@ -1,25 +0,0 @@
-from sqlalchemy.orm import Session
-
-from app import crud, schemas
-from app.core.config import settings
-from app.db import base # noqa: F401
-
-# make sure all SQL Alchemy models are imported (app.db.base) before initializing DB
-# otherwise, SQL Alchemy might fail to initialize relationships properly
-# for more details: https://github.com/tiangolo/full-stack-fastapi-postgresql/issues/28
-
-
-def init_db(db: Session) -> None:
- # Tables should be created with Alembic migrations
- # But if you don't want to use migrations, create
- # the tables un-commenting the next line
- # Base.metadata.create_all(bind=engine)
-
- user = crud.user.get_by_email(db, email=settings.FIRST_SUPERUSER)
- if not user:
- user_in = schemas.UserCreate(
- email=settings.FIRST_SUPERUSER,
- password=settings.FIRST_SUPERUSER_PASSWORD,
- is_superuser=True,
- )
- user = crud.user.create(db, obj_in=user_in) # noqa: F841
diff --git a/{{cookiecutter.project_slug}}/backend/app/app/email-templates/build/new_account.html b/{{cookiecutter.project_slug}}/backend/app/app/email-templates/build/new_account.html
deleted file mode 100644
index 395c7bd156..0000000000
--- a/{{cookiecutter.project_slug}}/backend/app/app/email-templates/build/new_account.html
+++ /dev/null
@@ -1,26 +0,0 @@
-