|
1 |
| -# time-tracker-api V2 |
| 1 | +# **Time-tracker-api V2 Architecture** |
| 2 | +Architecture |
| 3 | +The application follows a DDD approach with a hexagonal clean architecture. BIG WORDS!, what does it mean? it means the following: |
2 | 4 |
|
3 |
| -Refer to [Serverless docs](https://serverless.com/framework/docs/providers/azure/guide/intro/) for more information. |
| 5 | +We have a directory for each domain entitiy (i.e. time entries, technologies, activities, etc) |
| 6 | +Inside each entity directory we have other 3 directories (application, domain and infrastructure) |
| 7 | +I'll leave this drawing to understand how these three folders work and what logic should be included in these directories |
4 | 8 |
|
5 |
| -## Requirements to use makefile |
| 9 | + |
| 10 | +More information [Here](https://github.com/eguezgustavo/time_tracker_app_skeleton) |
6 | 11 |
|
7 |
| -- Python version 3.6 or 3.7. |
| 12 | +## **Stack Technologies** |
| 13 | + - [Serverless](https://serverless.com/framework/docs/providers/azure/guide/intro/) |
| 14 | + - Python |
| 15 | + - Pytest |
| 16 | + - Docker Compose |
| 17 | + |
| 18 | +Recommended link [tdd_dojo](https://github.com/eguezgustavo/tdd_dojo) |
8 | 19 |
|
9 |
| -- Use an environment to install requirements (pyenv). |
| 20 | +## **Setup environment** |
10 | 21 |
|
11 |
| -## How to use makefile |
| 22 | +### **Requeriments** |
| 23 | + |
| 24 | +- Install python 3.6 or 3.7 (recommendation to install python [pyenv](https://github.com/pyenv/pyenv)) |
| 25 | +- Install node (recommendation to install node [nvm](https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-20-04-es#:~:text=de%20Node.js.-,Opci%C3%B3n%203%3A%20Instalar%20Node%20usando%20el%20administrador%20de%20versiones%20de%20Node,-Otra%20forma%20de)) |
| 26 | + |
| 27 | +### **Add variables** |
| 28 | +In the root directory /time-tracker-backend create a file .env with these values |
| 29 | + |
| 30 | +``` |
| 31 | +export MS_AUTHORITY=XXX |
| 32 | +export MS_CLIENT_ID=XXX |
| 33 | +export MS_SCOPE=XXX |
| 34 | +export MS_SECRET=XXX |
| 35 | +export MS_ENDPOINT=XXX |
| 36 | +export DATABASE_ACCOUNT_URI=XXX |
| 37 | +export DATABASE_MASTER_KEY=XXX |
| 38 | +export DATABASE_NAME=XXX |
| 39 | +export FLASK_APP=XXX |
| 40 | +export FLASK_ENV=XXX |
| 41 | +export AZURE_APP_CONFIGURATION_CONNECTION_STRING=XXX |
| 42 | +export USERID=XXX |
| 43 | +export FLASK_DEBUG=True |
| 44 | +export PYTHONPATH=XXX |
| 45 | +export DB_CONNECTION=XXX |
| 46 | +export ENVIRONMENT=XXX |
| 47 | +``` |
| 48 | + |
| 49 | +In the directory /V2 create a file .env with these values |
| 50 | +``` |
| 51 | +DB_USER=XXX |
| 52 | +DB_PASS=XXX |
| 53 | +DB_NAME=XXX |
| 54 | +``` |
| 55 | + |
| 56 | +### **Install dependencies** |
| 57 | +In the Directory /V2 |
| 58 | +``` |
| 59 | +make install |
| 60 | +``` |
| 61 | + |
| 62 | +## **Start Project** |
| 63 | +In the directory /V2 |
| 64 | +``` |
| 65 | +npm run offline |
| 66 | +docker compose up or make start-local |
| 67 | +``` |
| 68 | + |
| 69 | + |
| 70 | +## **Makefile to run a locally CI** |
12 | 71 |
|
13 | 72 | Execute the next command to show makefile help:
|
14 | 73 |
|
15 | 74 | ```shell
|
16 |
| -make help |
| 75 | +$ make help |
17 | 76 | ```
|
18 | 77 |
|
19 | 78 | - To install the dependencies type the command ```make install```
|
20 |
| - |
21 | 79 | - To test the project type the command ```make test```
|
22 |
| - |
23 | 80 | - To run the local database type the command ```make start-local```
|
| 81 | + |
| 82 | +## **How to contribute to the project** |
| 83 | +Clone the repository and from the master branch create a new branch for each new task. |
| 84 | +### **Branch names format** |
| 85 | +For example if your task in Jira is **TT-48 implement semantic versioning** your branch name is: |
| 86 | +``` |
| 87 | + TT-48-implement-semantic-versioning |
| 88 | +``` |
| 89 | +### **Commit messages format** |
| 90 | + |
| 91 | + |
| 92 | + Below there are some common examples you can use for your commit messages [semantic version](https://semver.org/) : |
| 93 | + |
| 94 | + - **feat**: A new feature. |
| 95 | + - **fix**: A bug fix. |
| 96 | + - **perf**: A code change that improves performance. |
| 97 | + - **build**: Changes that affect the build system or external dependencies (example scopes: npm, ts configuration). |
| 98 | + - **ci**: Changes to our CI or CD configuration files and scripts (example scopes: Azure devops, github actions). |
| 99 | + - **docs**: Documentation only changes. |
| 100 | + - **refactor**: A code change that neither fixes a bug nor adds a feature. |
| 101 | + It is important to mention that this key is not related to css styles. |
| 102 | + - **test**: Adding missing tests or correcting existing tests. |
| 103 | + |
| 104 | + ### Example |
| 105 | + fix: TT-48 implement semantic versioning |
| 106 | + |
| 107 | + Prefix to use in the space fix: |
| 108 | + `(fix: |feat: |perf: |build: |ci: |docs: |refactor: |style: |test: )` |
0 commit comments