mirror of
https://github.com/dat515-2025/Group-8.git
synced 2026-03-22 06:57:47 +01:00
update docs
This commit is contained in:
@@ -91,10 +91,15 @@ The workflow works in the following way:
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Here are software and hardware prerequisites for the development and production environments. This section also
|
||||
describes
|
||||
necessary environment variables and key dependencies used in the project.
|
||||
|
||||
### System Requirements
|
||||
|
||||
#### Development
|
||||
|
||||
- OS: Tested on MacOS, Linux and Windows should work as well
|
||||
- Minimum RAM: 8 GB
|
||||
- Storage: 10 GB+ free
|
||||
|
||||
@@ -138,8 +143,8 @@ The workflow works in the following way:
|
||||
#### Backend
|
||||
|
||||
- `MOJEID_CLIENT_ID`, `MOJEID_CLIENT_SECRET` \- OAuth client ID and secret for
|
||||
[MojeID](https://www.mojeid.cz/en/provider/)
|
||||
- `BANKID_CLIENT_ID`, `BANKID_CLIENT_SECRET` \- OAuth client ID and secret for [BankID](https://developer.bankid.cz/)
|
||||
[MojeID](https://www.mojeid.cz/en/provider/)
|
||||
- `BANKID_CLIENT_ID`, `BANKID_CLIENT_SECRET` \- OAuth client ID and secret for [BankID](https://developer.bankid.cz/)
|
||||
- `CSAS_CLIENT_ID`, `CSAS_CLIENT_SECRET` \- OAuth client ID and secret for [Česká
|
||||
spořitelna](https://developers.erstegroup.com/docs/apis/bank.csas)
|
||||
- `DATABASE_URL`(or `MARIADB_HOST`, `MARIADB_PORT`, `MARIADB_DB`, `MARIADB_USER`, `MARIADB_PASSWORD`) \- MariaDB
|
||||
@@ -227,6 +232,9 @@ npm run dev
|
||||
|
||||
### Backend
|
||||
|
||||
App is separated into backend and frontend so it also needs to be built separately. Backend is build into docker image
|
||||
and frontend is deployed as static files.
|
||||
|
||||
```bash
|
||||
cd 7project/backend
|
||||
# Dont forget to set correct image tag with your registry and name
|
||||
@@ -244,6 +252,10 @@ npm run build
|
||||
|
||||
## Deployment Instructions
|
||||
|
||||
Deployment is tested on TalosOS cluster with 1 control plane and 4 workers, cluster needs to be setup and configured
|
||||
manually. Terraform/OpenTofu is then used to deploy base services to the cluster. App itself is deployed automatically
|
||||
via GitHub actions and Helm chart. Frontend files are deployed to Cloudflare pages.
|
||||
|
||||
### Setup Cluster
|
||||
|
||||
Deployment should work on any Kubernetes cluster. However, we are using 4 TalosOS virtual machines (1 control plane, 3
|
||||
@@ -427,6 +439,7 @@ See the workflow [here](../.github/workflows/run-tests.yml).
|
||||
|
||||
If you want to run the tests locally, the preferred way is to use a [bash script](backend/test_locally.sh)
|
||||
that will start a test DB container with [docker compose](backend/docker-compose.test.yml) and remove it afterwards.
|
||||
|
||||
```bash
|
||||
cd 7project/src/backend
|
||||
bash test_locally.sh
|
||||
@@ -486,10 +499,12 @@ curl -H "Authorization: Bearer $TOKEN" http://127.0.0.1:8000/authenticated-route
|
||||
|
||||
### Frontend
|
||||
|
||||
- Start with:
|
||||
- Start with:
|
||||
|
||||
```bash
|
||||
npm run dev in 7project/src/frontend
|
||||
```
|
||||
|
||||
- Ensure VITE_BACKEND_URL is set to the backend URL (e.g., http://127.0.0.1:8000)
|
||||
- Open http://localhost:5173
|
||||
- Login, view latest transactions, filter, and add new transactions from the UI.
|
||||
@@ -511,20 +526,27 @@ npm run dev in 7project/src/frontend
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
running on arm
|
||||
tofu apply error
|
||||
|
||||
### Common Issues
|
||||
|
||||
#### Issue 1: [Common problem]
|
||||
#### Issue 1: Unable to apply Cloudflare terraform module
|
||||
|
||||
**Symptoms**: [What the user sees]
|
||||
**Solution**: [Step-by-step fix]
|
||||
**Symptoms**: Terraform/OpenTofu apply fails during Cloudflare module deployment.
|
||||
This is caused by unknown variable not known beforehand.
|
||||
|
||||
#### Issue 2: [Another common problem]
|
||||
**Solution**: Apply first without Cloudflare module and then apply again.
|
||||
|
||||
**Symptoms**: [What the user sees]
|
||||
**Solution**: [Step-by-step fix]
|
||||
```bash
|
||||
tofu apply -exclude modules.cloudflare
|
||||
tofu apply
|
||||
```
|
||||
|
||||
#### Issue 2: Pods are unable to start
|
||||
|
||||
**Symptoms**: Pods are unable to start with ImagePullBackOff error. This could be caused
|
||||
by either hitting docker hub rate limits or by docker hub being down.
|
||||
|
||||
**Solution**: Make sure you updated the cluster config to use registry mirror as described in
|
||||
"Setup Cluster" section.
|
||||
|
||||
### Debug Commands
|
||||
|
||||
@@ -587,22 +609,22 @@ tofu apply error
|
||||
|
||||
### Dejan
|
||||
|
||||
| Date | Activity | Hours | Description | Representative Commit / PR |
|
||||
|:----------------|:-------------------------|:-------|:--------------------------------------------------------------|:---------------------------------------------------------|
|
||||
| 25.9. | Design | 2 | 6design | |
|
||||
| 9.10 to 11.10. | Backend APIs | 14 | Implemented Backend APIs | `PR #26`, `20-create-a-controller-layer-on-backend-side` |
|
||||
| 13.10 to 15.10. | Frontend Development | 8 | Created user interface mockups | `PR #28`, `frontend basics` |
|
||||
| Continually | Documentation | 7 | Documenting the dev process | |
|
||||
| 21.10 to 23.10 | Tests, frontend | 10 | Test basics, balance charts, and frontend improvement | `PR #31`, `30 create tests and set up a GitHub pipeline` |
|
||||
| 28.10 to 30.10 | CI | 6 | Integrated tests with test database setup on github workflows | `PR #28`, `frontend basics` |
|
||||
| 28.10 to 30.10 | Frontend | 8 | UI improvements and exchange rate API integration | `PR #28`, `frontend basics` |
|
||||
| 4.11 to 6.11 | Tests | 6 | Test fixes improvement, more integration and e2e | `PR #28`, `frontend basics` |
|
||||
| 4.11 to 6.11 | Frontend | 6 | Fixes, Improved UI, added support for mobile devices | `PR #28`, `frontend basics` |
|
||||
| 11.11 | Backend APIs | 4 | Moved rates API, mock bank to Backend, few fixes | `PR #28`, `frontend basics` |
|
||||
| 11.11 to 12.11 | Tests | 3 | Local testing DB container, few fixes | `PR #28`, `frontend basics` |
|
||||
| 12.11 | Frontend | 3 | Enabled multiple transaction edits at once, CSAS button state | `PR #28`, `frontend basics` |
|
||||
| 13.11 | Video | 3 | Video | |
|
||||
| **Total** | | **80** | | |
|
||||
| Date | Activity | Hours | Description | Representative Commit / PR |
|
||||
|:----------------|:---------------------|:-------|:--------------------------------------------------------------|:---------------------------------------------------------|
|
||||
| 25.9. | Design | 2 | 6design | |
|
||||
| 9.10 to 11.10. | Backend APIs | 14 | Implemented Backend APIs | `PR #26`, `20-create-a-controller-layer-on-backend-side` |
|
||||
| 13.10 to 15.10. | Frontend Development | 8 | Created user interface mockups | `PR #28`, `frontend basics` |
|
||||
| Continually | Documentation | 7 | Documenting the dev process | |
|
||||
| 21.10 to 23.10 | Tests, frontend | 10 | Test basics, balance charts, and frontend improvement | `PR #31`, `30 create tests and set up a GitHub pipeline` |
|
||||
| 28.10 to 30.10 | CI | 6 | Integrated tests with test database setup on github workflows | `PR #28`, `frontend basics` |
|
||||
| 28.10 to 30.10 | Frontend | 8 | UI improvements and exchange rate API integration | `PR #28`, `frontend basics` |
|
||||
| 4.11 to 6.11 | Tests | 6 | Test fixes improvement, more integration and e2e | `PR #28`, `frontend basics` |
|
||||
| 4.11 to 6.11 | Frontend | 6 | Fixes, Improved UI, added support for mobile devices | `PR #28`, `frontend basics` |
|
||||
| 11.11 | Backend APIs | 4 | Moved rates API, mock bank to Backend, few fixes | `PR #28`, `frontend basics` |
|
||||
| 11.11 to 12.11 | Tests | 3 | Local testing DB container, few fixes | `PR #28`, `frontend basics` |
|
||||
| 12.11 | Frontend | 3 | Enabled multiple transaction edits at once, CSAS button state | `PR #28`, `frontend basics` |
|
||||
| 13.11 | Video | 3 | Video | |
|
||||
| **Total** | | **80** | | |
|
||||
|
||||
### Group Total: [XXX.X] hours
|
||||
|
||||
@@ -649,15 +671,11 @@ The biggest challenge for me was time tracking since I am used to tracking to pr
|
||||
It was also interesting experience to be the one responsible for the initial project structure/design/setup
|
||||
used not only by myself.
|
||||
|
||||
[Personal reflection on growth, challenges, and learning]
|
||||
|
||||
#### [Dejan]
|
||||
Since I do not have a job, this project was probably the most complex one I have ever worked on.
|
||||
|
||||
Since I do not have a job, this project was probably the most complex one I have ever worked on.
|
||||
It was also the first school project where I was encouraged to use AI.
|
||||
|
||||
Lukas
|
||||
|
||||
[Personal reflection on growth, challenges, and learning]
|
||||
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user