diff --git a/README.md b/README.md index b304160..2294689 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,38 @@ Includes Jinja, WTForms, MySQL ORM and Docker. - Dockerfile, Docker-Compose +## Usage +1. Create a repository from this template +2. For debugging, change the database connection parameters +in `.env_debug` file correspoding to the configuration +of MariaDB/MySQL server on your PC +3. Edit app [paths](#paths), +[custom error pages](#custom-error-pages) +and [forms](#wtforms) +as explained in the "Structure" section +4. Create your own Jinja templates in the `templates/` directory, +editing `base.html` and inheriting other templates from it is recommended +(see `index,table,admin.html` for examples) +5. Edit or remove CSS and JS files in `static/` +6. Edit `sql/models,schemas,crud.py` +corresponding to your database structure +as explained below ([Structure > Database](#database)) +7. Check if `Makefile`, `Dockerfile`, `docker-compose.yml` are correct +8. Run the formatter and linters (`make format`, then `make check`) +9. Build a docker image and [publish](#publishing-app) it + +### Makefile +Make commands: +|Command|Description| +|:-----:|:----------| +|`make format`|Format the code using AutoPEP8| +|`make check`|Check the code with linters (MyPy, Pylint)| +|`make dev`|Run the app in development mode| +|`make prod`|Run a production server| +|`make docker`|Build a docker image from `Dockerfile`| +|`make clean`|Clean all cache| + + ## Structure ### Configuration @@ -66,7 +98,7 @@ You can copying the contents of `pages.py` > **Note** -> In the paths files FastAPI's decorators +> In the paths files, FastAPI's decorators are called with `@self.app.`, not just `@app.` In case of deleteing/renaming/creating any paths files, @@ -92,36 +124,6 @@ TODO TODO -## Usage - - - -### Makefile -Make commands: -|Command|Description| -|:-----:|:----------| -|`make format`|Format the code using AutoPEP8| -|`make check`|Check the code with linters (MyPy, Pylint)| -|`make dev`|Run the app in development mode| -|`make prod`|Run a production server| -|`make docker`|Build a docker image from `Dockerfile`| -|`make clean`|Clean all cache| - - ## Helper functions ### `respond.py`