Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NOJIRA] Release 0.1.0 #31

Merged
merged 159 commits into from
Apr 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
159 commits
Select commit Hold shift + click to select a range
5471ab3
Created delete api model.
bkulawska Apr 1, 2022
4a4ecea
Add GitHub gadgets (#3)
john-sonz Apr 1, 2022
3607707
Update readme (#4)
john-sonz Apr 1, 2022
5999e4d
Moved passing id to path.
bkulawska Apr 2, 2022
6f8355d
Changed filter to get.
bkulawska Apr 2, 2022
42b1b15
Changed filter to get.
bkulawska Apr 2, 2022
bf91927
Merge branch 'feature/ITG-31' of https://github.com/it-goats/it-goats…
bkulawska Apr 2, 2022
c7083b4
Changed 'filter' -> 'get'
bkulawska Apr 2, 2022
58dfb0f
Merge branch 'feature/ITG-31' of https://github.com/it-goats/it-goats…
bkulawska Apr 2, 2022
712ad31
Merge pull request #2 from it-goats/feature/ITG-31
bkulawska Apr 2, 2022
f858c80
fix: node version in README.md
tgargula Apr 3, 2022
4268bde
fix: add .env to .gitignore
tgargula Apr 3, 2022
3078609
Merge branch 'develop' of github.com:it-goats/it-goats into fix/gener…
tgargula Apr 3, 2022
dfcc026
fix: DELETE response status code
tgargula Apr 3, 2022
9976f75
feat: add extension recommendations
tgargula Apr 3, 2022
7989ddb
Add due date and description model fields
john-sonz Apr 3, 2022
c602472
feat(bode): implement GET /tasks/task_id
tgargula Apr 3, 2022
7e9c46b
feat(cabra): implement routing
tgargula Apr 3, 2022
04f92d4
Merge pull request #5 from it-goats/fix/general-adjustments
tgargula Apr 3, 2022
5c6e361
Merge branch 'develop' into feature/ITG-64-przekierowanie-do-szczegol…
tgargula Apr 3, 2022
87908ee
feat: improve caching
tgargula Apr 4, 2022
1915442
Merge branch 'feature/ITG-64-przekierowanie-do-szczegolow-zadania' of…
tgargula Apr 4, 2022
133dc6a
Add new field to task input schema
john-sonz Apr 3, 2022
8806456
Add new fields to task form
john-sonz Apr 4, 2022
846bd63
apply PR suggestions
tgargula Apr 4, 2022
9260550
Merge pull request #6 from it-goats/feature/ITG-64-przekierowanie-do-…
tgargula Apr 4, 2022
28df104
Merge branch 'develop' of github.com:john-sonz/it-goats into feature/…
john-sonz Apr 4, 2022
8ab728c
Merge pull request #7 from it-goats/feature/ITG-77/more-task-fields
john-sonz Apr 4, 2022
cedb24a
Added edit API
bkulawska Apr 5, 2022
dc817fc
Add task edit page
john-sonz Apr 5, 2022
7aeeb98
Add route helpers
john-sonz Apr 5, 2022
8d415f5
Changed http code 201 -> 200.
bkulawska Apr 5, 2022
81b5442
Merge pull request #8 from it-goats/ITG-66
bkulawska Apr 5, 2022
46276f9
Refactor API calls
john-sonz Apr 5, 2022
f466b3a
Rename warmGray to stone
john-sonz Apr 5, 2022
fe64800
Merge pull request #9 from it-goats/feature/ITG-65/task-edit-frontend
john-sonz Apr 6, 2022
981287d
Add checkbox widget
gregori0o Apr 6, 2022
0792460
Add parameter done to task
gregori0o Apr 6, 2022
a3c5594
Add done column to db
gregori0o Apr 6, 2022
a603ac2
Add column to db
gregori0o Apr 7, 2022
eb711a9
add updating value of is_done
gregori0o Apr 7, 2022
b0ece95
remove default from checked
gregori0o Apr 7, 2022
6462b3a
Added delete button
Apr 8, 2022
de0a524
Added handling of delete button.
Apr 8, 2022
e3d0030
Merge pull request #11 from it-goats/feature/ITG-30
john-sonz Apr 8, 2022
ec022f6
Rename addTask to editTask in TaskEdit component
john-sonz Apr 8, 2022
9b1bb8e
Merge pull request #12 from it-goats/fix/rename-one-function-in-task-…
john-sonz Apr 8, 2022
a2f98f0
empty commit
tgargula Apr 8, 2022
1142ae5
Add Cabra & Bode CI Github actions
john-sonz Apr 8, 2022
400f554
Merge pull request #13 from it-goats/feature/ITG-79-setup-ci
john-sonz Apr 8, 2022
09173dd
Revert "Merge pull request #13 from it-goats/feature/ITG-79-setup-ci"
john-sonz Apr 8, 2022
aed3f9b
Setup bode and cabra CI
john-sonz Apr 8, 2022
67ebca5
Run CI on all pushes and pull requests
john-sonz Apr 8, 2022
ebccca0
Refactor code and fix bugs
gregori0o Apr 9, 2022
4f07fce
Merge pull request #15 from it-goats/feature/ITG-79/setup-ci
john-sonz Apr 9, 2022
4ec246d
Add handling of exceptions
gregori0o Apr 10, 2022
0ad3080
Clean code
gregori0o Apr 10, 2022
886ae8f
Clean code
gregori0o Apr 10, 2022
d089683
Clean
gregori0o Apr 10, 2022
99a4504
Remove caching from CI
john-sonz Apr 10, 2022
6911c52
Merge pull request #16 from it-goats/fix/remove-ci-caching
john-sonz Apr 10, 2022
72a0541
Merge pull request #10 from it-goats/feature/ITG-63
gregori0o Apr 10, 2022
14c4ac9
Update CI workflow names
john-sonz Apr 10, 2022
0230a41
Added pagination to the main tasks list, sorted tasks by due dates
Apr 10, 2022
efafbcd
Add task relations model
john-sonz Apr 11, 2022
2936e43
Add api for task relations creation and deletion
john-sonz Apr 11, 2022
7925612
Add tags
tgargula Apr 18, 2022
170e588
Add unique constraint
tgargula Apr 18, 2022
292b860
Merge branch 'develop' into ITG-47-zdefiniowanie-endpointu-patch-do-d…
tgargula Apr 18, 2022
efcc710
Improve readability
john-sonz Apr 18, 2022
f253b62
remove doubled CI checks
tgargula Apr 18, 2022
5946a70
Update linting rules
john-sonz Apr 18, 2022
98c3d96
Merge pull request #21 from it-goats/tgargula/fix-ci
tgargula Apr 18, 2022
395b431
Merge branch 'develop' into ITG-47-zdefiniowanie-endpointu-patch-do-d…
tgargula Apr 18, 2022
b8d5cda
Merge branch 'develop' into feature/task-relations-model
john-sonz Apr 18, 2022
c4f90db
Merge pull request #19 from it-goats/feature/task-relations-model
john-sonz Apr 18, 2022
9e6e41f
Update bode/bode/models/tag.py
tgargula Apr 19, 2022
c79cd36
Merge branch 'develop' into ITG-47-zdefiniowanie-endpointu-patch-do-d…
tgargula Apr 19, 2022
adf2ef0
fix linting
tgargula Apr 19, 2022
f95aebf
Merge branch 'develop' of https://github.com/it-goats/it-goats into f…
Apr 19, 2022
b7ac9dd
Add 'add' buttons in edit task
gregori0o Apr 20, 2022
5d3be8a
feat: add tags as many-many relationship and add endpoints
tgargula Apr 21, 2022
65c9f43
Added get endpoint with tasks related with given
Apr 22, 2022
e8f4d26
feat: appy suggested comments
tgargula Apr 22, 2022
dabf5be
Merge pull request #20 from it-goats/ITG-47-zdefiniowanie-endpointu-p…
tgargula Apr 22, 2022
cd841a6
feat: Add GET for subtasks
gregori0o Apr 22, 2022
cbe69b0
refactor: Move +add button code to TaskEdit file
gregori0o Apr 22, 2022
3c74a87
fix: Fix GET points in api for subtasks
gregori0o Apr 23, 2022
2a81d82
feat: Creating and view of subtask in edit view
gregori0o Apr 23, 2022
3c63338
feat: View of subtasks list in details.
gregori0o Apr 23, 2022
8a980fb
refactor: create useTask hook
tgargula Apr 23, 2022
bf3b3dd
refactor: change background
tgargula Apr 23, 2022
9b65f87
feat: implement new layout
tgargula Apr 23, 2022
e93f595
feat: Add delete button handler for subtasks
gregori0o Apr 23, 2022
d3a3df7
feat: bigger width
tgargula Apr 23, 2022
7c9b18d
feat: add no deadline fallback
tgargula Apr 23, 2022
3562c23
feat: apply suggested changes
tgargula Apr 23, 2022
ff6fcc2
Merge pull request #23 from it-goats/feature/ITG-43
tgargula Apr 23, 2022
b134fef
Removed redundant TaskRelationSchema
Apr 24, 2022
5e5bdcf
Merge branch 'develop' into feature/ITG-44
koszar91 Apr 24, 2022
18f0da0
Added CompleteTaskRelationSchema
Apr 25, 2022
168f527
Added proper TaskTasksInRelationWith endpoint and schemas used by it.
Apr 25, 2022
6e58f98
Merge branch 'develop' into feature/ITG-58-ITG-62
gregori0o Apr 25, 2022
dcd9fd2
Update task form design
john-sonz Apr 25, 2022
d6bf07c
Update checkbox styles
john-sonz Apr 25, 2022
d2d9ad5
Update task list design
john-sonz Apr 25, 2022
46bfc1a
Order tasks when querying from DB
john-sonz Apr 25, 2022
3a112f2
fix: Change GET point
gregori0o Apr 25, 2022
cbdef9a
fix: Fix subtasks list on client side.
gregori0o Apr 25, 2022
62c58fa
Added relation type argument to get request
Apr 25, 2022
29082e3
Minor fixes
Apr 25, 2022
4534891
fix: Fix subtasks list on client side.
gregori0o Apr 25, 2022
cd845a7
refactor: Clean code
gregori0o Apr 25, 2022
cf44411
Merge branch 'develop' of https://github.com/it-goats/it-goats into f…
Apr 25, 2022
42e3a3b
Reviews applied to ITG-72 PR
Apr 25, 2022
f8d3a74
Redirect to home page after creating a task
john-sonz Apr 26, 2022
55fbd3a
Merge pull request #18 from it-goats/feature/ITG-72
basiav Apr 26, 2022
e770680
Merge branch 'develop' into feature/ITG-44 (to fix migrations error)
Apr 26, 2022
235b088
Update font family
john-sonz Apr 26, 2022
b8baa85
Merge branch 'develop' of github.com:it-goats/it-goats into feature/I…
john-sonz Apr 26, 2022
3d3c4e1
Update ordering direction
john-sonz Apr 26, 2022
1e95a90
refactor: Refactor code as suggested in review
gregori0o Apr 26, 2022
6ce2376
fix: Fix cascade delete of task
gregori0o Apr 26, 2022
7d73b83
feat: Automatic check interchangable tasks
gregori0o Apr 27, 2022
0c17d61
fix: Fix cascade check tasks
gregori0o Apr 27, 2022
4c4d827
Merge branch 'develop' into feature/ITG-58-ITG-62
gregori0o Apr 27, 2022
962636d
Refactored
Apr 27, 2022
cb17da2
fix: Fix height of subtask card in details layout
gregori0o Apr 27, 2022
5cab778
Merge pull request #25 from it-goats/feature/ITG-58-ITG-62
gregori0o Apr 27, 2022
82698ab
Merge branch 'develop' into feature/ITG-44
Apr 27, 2022
ea46a74
Replaced old solutions with newely merged functionalities (get relate…
Apr 27, 2022
aaa1ed8
Deleted outdated docstring
Apr 27, 2022
437d0ee
Merge pull request #22 from it-goats/feature/ITG-44
koszar91 Apr 27, 2022
f5c2965
Merge branch 'develop' into feature/ITG-95
john-sonz Apr 27, 2022
018ceae
Merge branch 'develop' into feature/ITG-57
gregori0o Apr 27, 2022
305cd1a
Make related task component more generic (deleted subtask). Created r…
Apr 27, 2022
40337cc
Refactored, made font prettier
Apr 27, 2022
d9fb8eb
Update subtasks styling
john-sonz Apr 27, 2022
1ec9394
Merge pull request #24 from it-goats/feature/ITG-95
john-sonz Apr 27, 2022
44c20cc
Fixes after merge
Apr 27, 2022
58c808d
refactor: Rename edit function to edit_task.
gregori0o Apr 27, 2022
5362f4a
Merge branch 'develop' into feature/ITG-57
gregori0o Apr 27, 2022
539a254
Merge pull request #26 from it-goats/feature/ITG-57
gregori0o Apr 27, 2022
531883f
fix: Fix update of checkbox in list view
gregori0o Apr 27, 2022
557e020
Merge branch 'develop' into feature/ITG-46
koszar91 Apr 27, 2022
d620aa1
Merge
Apr 27, 2022
0bbecb3
Merge branch 'feature/ITG-46' of https://github.com/it-goats/it-goats…
Apr 27, 2022
0f4e9ff
Merge pull request #27 from it-goats/feature/ITG-46
koszar91 Apr 27, 2022
05dbae0
Substituted SubtaskList with more generic RelatedTaskList
Apr 27, 2022
be37b73
Added redirection after clicking on a related task in detials view.
Apr 27, 2022
9b01fcc
Fixes after review
Apr 27, 2022
36b250d
feat: Create, add, remove tags in task edit.
gregori0o Apr 28, 2022
1463f12
Made back button redirecting to task list instead of going back.
Apr 28, 2022
007b82a
Made "checking" subtask actually check it, not redirect to it's details.
Apr 28, 2022
5bf4b0e
fix: Fix problems with types
gregori0o Apr 28, 2022
c065957
Merge pull request #28 from it-goats/feature/ITG-45
koszar91 Apr 28, 2022
269b469
refactor: Refactor code as suggestion in review.
gregori0o Apr 28, 2022
fd2f333
Merge branch 'develop' into feature/ITG-97
gregori0o Apr 28, 2022
0e0aa21
Merge pull request #30 from it-goats/feature/ITG-97
koszar91 Apr 28, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!--
- [ ] Provide a summary of the features and changes
- [ ] Assign one or more reviewers
-->

---

#### Resources

<!-- Include links to relevant Jira stories or visual resources. -->
45 changes: 45 additions & 0 deletions .github/workflows/bode_ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "Bode CI"

on:
pull_request:
paths:
- "bode/**"
push:
paths:
- "bode/**"
branches:
- develop
- master

jobs:
ci:
name: "Bode CI - linting & formatting"
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./bode

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.10.4"
- uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: "1.1.13"

- run: poetry config virtualenvs.in-project true

- name: Install dependencies
run: |
poetry config virtualenvs.in-project true
poetry install
- name: Check formatting
run: poetry run black bode migrations --check --verbose

- name: Lint
run: poetry run flake8 bode migrations --verbose

- name: Check sorting
run: poetry run isort bode migrations --check
38 changes: 38 additions & 0 deletions .github/workflows/cabra_ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "Cabra CI"

on:
pull_request:
paths:
- "cabra/**"
push:
paths:
- "cabra/**"
branches:
- develop
- master

jobs:
ci:
name: "Cabra CI - linting, formatting & type checking"
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./cabra

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "16.14.2"

- name: Install Dependencies
run: npm ci

- name: Check formatting
run: npm run format:check

- name: Check types
run: npm run types:check

- name: Lint
run: npm run lint:check
15 changes: 15 additions & 0 deletions .github/workflows/pr_jira_check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "PR Jira check"
on:
pull_request:
branches:
- develop
types: [opened, edited, reopened, synchronize]

jobs:
check-jira-presence:
name: "Verify PR title starts with [NOJIRA] or [PROJECT-123]"
runs-on: ubuntu-latest
env:
PR_TITLE: ${{ github.event.pull_request.title }}
steps:
- run: egrep '^\[(NOJIRA|([[:upper:]]{3,}\-[[:digit:]]+[[:blank:],]+)*[[:upper:]]{3,}\-[[:digit:]]+)\]' <<< ${PR_TITLE}
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
.vscode/
node_modules/
.vscode/*
!.vscode/extensions.json

node_modules/
.env
17 changes: 17 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"amatiasq.sort-imports",
"bradlc.vscode-tailwindcss",
"dsznajder.es7-react-js-snippets",
"wix.glean",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-azuretools.vscode-docker",
"ms-vscode-remote.remote-containers",
"mhutchie.git-graph",
"eamodio.gitlens",
"oderwat.indent-rainbow"
]
}
61 changes: 50 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,23 @@ IT-GOATS

## Struktura

| Codebase | Opis |
| :-------------------- | :-----------------------: |
| [bode](bode) | Flask API |
| [cabra](cabra) | React Frontend |
| Codebase | Opis |
| :------------- | :------------: |
| [bode](bode) | Flask API |
| [cabra](cabra) | React Frontend |

## Uruchomienie projektu

### Wymagania (zalecane):

- [Docker](https://docs.docker.com/get-docker/) + [docker-compose](https://docs.docker.com/compose/) dla Linux'a lub [Docker Desktop](https://docs.docker.com/get-docker/) dla OSX/Windows'a
- [WSL2](https://docs.microsoft.com/en-us/windows/wsl/install) w przypadku Windows'a
- [asdf](https://github.com/asdf-vm/asdf)

### Wymagania (alternatywne i niezalecane):

- [PostgreSQL](https://www.postgresql.org/) w rozsądnej wersji
- [Node.js + npm](https://nodejs.org/en/) najlepiej w wersji 16.14.12
- [Node.js + npm](https://nodejs.org/en/) najlepiej w wersji 16.14.2
- [Poetry](https://python-poetry.org/) najlepiej w wersji 1.1.13
- [Python](https://www.python.org/downloads/) najlepiej w wersji 3.10.4

Expand All @@ -28,46 +30,55 @@ Do pracy nad projektem najlepiej wykorzystać UNIX'owe środowisko.
OSX, jakiś Linux lub WSL2 pod Windows'em sprawdzą się w sam raz. W takim środowisku potrzebujemy mieć Docker'a z Compose'em (patrz linki w wymaganiach) oraz [asdf'a](https://asdf-vm.com/guide/getting-started.html).

Mając gotowe te dwie rzeczy, sklonowane repo (w przypadku WSL'a repo klonujemy do niego zamiast do Windowsa) i trochę szczęścia projekt powinien wstać po odpaleniu [skryptu](setup.sh):

```
$ ./setup.sh
```

Skrypt po kolei:

- zainstaluje potrzebne narzędzia przez asdf'a
- doda do gita hooki sprawdzające kod przed każdym commit'em (gdy będziemy mieć wybór, które hooki zainstalować to wybieramy spacją tylko `pre-commit` i potwierdzamy)
- zainstaluje potrzebne zależności w bode i cabrze
- uruchomi kontenery z bazą danych, backend'em i frontend'em

Po tym wszystkim aplikacja będzie dostępna po adresem http://localhost:3000.
Po tym wszystkim aplikacja będzie dostępna po adresem http://localhost:3000. API jest dostępne pod adresem http://localhost:4000/api/v1.

Setup wystarczy wykonać pomyślnie tylko raz, potem aplikację stawiamy:

- na Linuxie

```
docker-compose up
```

- na Macu/WSL:

```
docker compose up
```

### Alternatywna i niezalecana instrukcja:

Można spróbować uruchomić projekt bez Docker'a i/lub asdf'a. Wtedy trzeba samemu zapewnić, że wszystkie wymagane narzędzia są zainstalowane i serwer PostgreSQL jest uruchomiony. Następnie należy uruchamiać kolejne kroki z [setup.sh](setup.sh) pomijając ostatni oraz ręcznie ustawić w powłoce zmienne środowiskowe z pliku [.env.example](.env.example).
Można spróbować uruchomić projekt bez Docker'a i/lub asdf'a. Wtedy trzeba samemu zapewnić, że wszystkie wymagane narzędzia są zainstalowane i serwer PostgreSQL jest uruchomiony. Następnie należy uruchamiać kolejne kroki z [setup.sh](setup.sh) pomijając ostatni oraz ręcznie ustawić w powłoce zmienne środowiskowe z pliku [.env.example](.env.example).

Po tym wszystkim uruchamiamy w jednym terminalu bode:

```
cd bode && poetry run flask run --port=$FLASK_PORT
```

A w drugim cabrę:

```
cd cabra && npm run dev
```

W tym przypadku aplikacja też będzie dostępna po adresem http://localhost:3000.

### Możliwe problemy
Jeśli w trakcie instalacji zależności przez poetry pojawi się błąd dotyczący `psycopg2` to konieczne może być doinstalowanie odpowiednich pakietów zgodnie ze [stackiem](https://stackoverflow.com/questions/11618898/pg-config-executable-not-found).

Jeśli w trakcie instalacji zależności przez poetry pojawi się błąd dotyczący `psycopg2` to konieczne może być doinstalowanie odpowiednich pakietów zgodnie ze [stackiem](https://stackoverflow.com/questions/11618898/pg-config-executable-not-found).

## Przygotowanie VS Code

Expand All @@ -79,10 +90,14 @@ VS Code lepiej działa mając dodane foldery z poszczególnymi częściami aplik

### Interpreter pythona

VS Code będzie chciał żeby podać mu ścieżkę do używanego przez interpretera pythona. Wtedy wskazujemy ten w katalogu `bode/.venv`.

VS Code będzie chciał żeby podać mu ścieżkę do używanego przez nas interpretera pythona. Wtedy wskazujemy ten w katalogu `bode/.venv`.

### Lista fajnych i przydatnych dla naszego projektu dodatków:

Poniższe rozszerzenia znajdują się w rekomendacjach dla projektu. Przy uruchomieniu projektu powinno się wyświetlić powiadomienie z opcją ich instalacji.

Rozszerzenie [Remote - WSL](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) należy zainstalować manualnie, jeśli korzystasz z WSL.

- Frontend/React/Tailwind
- [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) **MUST HAVE**
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) **MUST HAVE**
Expand All @@ -95,9 +110,33 @@ VS Code będzie chciał żeby podać mu ścieżkę do używanego przez interpret
- [Pylance](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance) **MUST HAVE**
- DevOps
- [Docker](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker)
- [Remote - Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
- [Remote - Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
- [Remote - WSL](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) **MUST HAVE** przy WSL
- Inne
- [Git Graph](https://marketplace.visualstudio.com/items?itemName=mhutchie.git-graph) - ładnie pokazuje drzewo gita
- [Git Lens](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens) - można łatwo wyklikiwać rzeczy związane z gitem
- [indent-rainbow](https://marketplace.visualstudio.com/items?itemName=oderwat.indent-rainbow) - koloruje wcięcia

## Materiały dotyczące używanych technologii i bibliotek

### Dostęp do bazy danych

- ORM
- [SQLAlchemy](https://docs.sqlalchemy.org/en/14/)
- [Flask-SQLAlchemy](https://flask-sqlalchemy.palletsprojects.com/en/2.x/)
- Migracje
- [Flask-Migrate](https://flask-migrate.readthedocs.io/en/latest/)
- [Alembic](https://alembic.sqlalchemy.org/en/latest/)

### REST API

- [flask-smorest](https://flask-smorest.readthedocs.io/en/latest/)
- [marshmallow](https://marshmallow.readthedocs.io/en/stable/)

### Frontend

- [React](https://beta.reactjs.org/)
- [Typescript](https://www.typescriptlang.org/)
- [Tailwind CSS](https://tailwindcss.com/)
- [react-query](https://react-query.tanstack.com/)
- [react-hook-form](https://react-hook-form.com/)
2 changes: 2 additions & 0 deletions bode/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max-line-length = 120
5 changes: 4 additions & 1 deletion bode/bode/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from .config import Config
from .extensions import api, db, migrate
from .resources import tasks
from .resources import tags, task_relations, tasks

CONFIG = Config()

Expand All @@ -19,6 +19,7 @@ def create_app():
app.config["OPENAPI_VERSION"] = "3.0.2"

app.config["SQLALCHEMY_DATABASE_URI"] = CONFIG.DATABASE_URI
app.config["SQLALCHEMY_ECHO"] = True
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False

register_extensions(app)
Expand All @@ -42,6 +43,8 @@ def register_extensions(app):
def register_blueprints(app):
api_blueprint = Blueprint("api", "api", url_prefix="/api/v1")
api_blueprint.register_blueprint(tasks.api.blueprint)
api_blueprint.register_blueprint(tags.api.blueprint)
api_blueprint.register_blueprint(task_relations.api.blueprint)

app.register_blueprint(api_blueprint)
return None
2 changes: 0 additions & 2 deletions bode/bode/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ def get_db_uri():
port = os.getenv("POSTGRES_PORT", "5432")
db = os.getenv("POSTGRES_DB", "tasks")

print()

return f"postgresql://{user}:{password}@{host}:{port}/{db}"


Expand Down
37 changes: 37 additions & 0 deletions bode/bode/models/tag.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import uuid

from sqlalchemy.dialects.postgresql import UUID

from bode.app import db
from bode.models.task_tag import task_tag


class Tag(db.Model):
__tablename__ = "tags"

id = db.Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
name = db.Column(db.String(80), unique=True, nullable=False)

task = db.relationship("Task", secondary=task_tag, back_populates="tags")

def create(tag_name):
tag = Tag(name=tag_name)

db.session.add(tag)
db.session.commit()

return tag

def delete(tag_id):
tag = Tag.query.get_or_404(tag_id)

db.session.delete(tag)
db.session.commit()

return tag

def get_by_name(tag_name):
return Tag.query.filter(Tag.name == tag_name).first()

def __repr__(self):
return f'<Tag {self.id} \n name="{self.name}">'
Loading