Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
245 commits
Select commit Hold shift + click to select a range
053d20e
feat: creation of the itemManagement feature
MarcosND Nov 30, 2023
d0693a1
feat: adding itemManagement scenarios
MarcosND Nov 30, 2023
867b0fa
feat: adding update scenario
MarcosND Nov 30, 2023
41ecc08
feat: adding new required step
MarcosND Nov 30, 2023
4dd0511
feat: updating scenarios and adding read scenario
MarcosND Nov 30, 2023
6ac2f6b
Merge branch 'dev'
MarcosND Nov 30, 2023
777e4ef
feat: making adjustments to .feature
MarcosND Nov 30, 2023
6aa2a74
fix: read scenario adjustment
MarcosND Nov 30, 2023
f711789
feat: testing rebase
MarcosND Nov 30, 2023
8f97f1f
feat: testing rebase on dev
MarcosND Nov 30, 2023
4c574ad
feat: second test of rebase on dev
MarcosND Nov 30, 2023
183f09b
feat: adding deleting of hamburguer 03 scenario to itemManagement
MarcosND Nov 30, 2023
7e6ef0f
feat: creation of the category_items feature
pccql Nov 30, 2023
df851c4
feat: add scenarios to category items feature
pccql Nov 30, 2023
446678c
feat: add failed scenarios for category_items feature
pccql Nov 30, 2023
fbeeb59
feat: add new scenario to category items feature
pccql Nov 30, 2023
2bf9967
feat:creation of payment.feature
claraabk Nov 30, 2023
fe95b59
<Descrição_do_commit>
claraabk Nov 30, 2023
104ced8
feat:line in payment.feature
claraabk Nov 30, 2023
b3b510d
feat:new line in payment.feature
claraabk Nov 30, 2023
0c03344
feat:new card scenario
claraabk Nov 30, 2023
7e27c3a
fix:added then to scenario
claraabk Nov 30, 2023
67bcd36
feat:delete card scenario
claraabk Nov 30, 2023
40d7b63
merge with dev
claraabk Nov 30, 2023
468eedb
fix(payment): change card number
claraabk Dec 1, 2023
e839448
Merge pull request #3 from claraabk/fix/payment-scenario-then
claraabk Dec 1, 2023
c266518
feat: add and to last scenario
pccql Dec 1, 2023
9b83ded
feat: add scenario
pccql Dec 1, 2023
318f70a
Merge branch 'dev'
pccql Dec 1, 2023
42b18ea
fix: adjust category items scenario add item
pccql Dec 1, 2023
13dfb12
Merge pull request #1 from pccql/fix/category-items
pccql Dec 1, 2023
d4619f5
fix:changed card number
Dec 1, 2023
d792f34
feat:register promotion scenario
Dec 1, 2023
40d7d44
feat:pix payment scenario
Dec 1, 2023
a608aef
feat:adding register card service scenario
Dec 1, 2023
7329290
fix:changed card number
Dec 1, 2023
3e93b29
feat: add gui naming to scenario on category items
pccql Dec 1, 2023
44b9e6c
feat: add .env to gitignore
pccql Dec 1, 2023
e05e9c3
feat: add node modules to gitignore
pccql Dec 1, 2023
9cf1069
feat: add node modules to gitignore
pccql Dec 1, 2023
5f91faa
feat: creation of the menu feature
caio-barreto Dec 1, 2023
24dd6a7
feat: creation and read menu item scenarios
caiolbarreto Dec 1, 2023
4f9024d
feat: add update menu item scenario
caiolbarreto Dec 1, 2023
7b1de61
feat: add final steps at the menu scenarios
caiolbarreto Dec 1, 2023
a73821c
feat: add feature description for the menu scenarios
caiolbarreto Dec 1, 2023
e41ce09
fix: fixing the scenarios
caiolbarreto Dec 1, 2023
1bd1a64
Merge pull request #1 from caiolbarreto/fix/menu
caiolbarreto Dec 1, 2023
82c4f36
feat: main branch changes
caiolbarreto Dec 1, 2023
b4c3f47
feat: dev branch changes
caiolbarreto Dec 1, 2023
20571c8
feat: adding deleting menu item scenario to menu feature after correc…
caiolbarreto Dec 1, 2023
68cbe7f
feat: added all the menu feature scenarios
caiolbarreto Dec 1, 2023
a560d1b
feat:creation of the order feature
dinizluiza Dec 2, 2023
bbac6e9
feat(order): adding first scenario view chronological order list
dinizluiza Dec 2, 2023
b496a7c
Update
dinizluiza Dec 2, 2023
6bae8d2
feat(order): adding scenario selected order details
dinizluiza Dec 2, 2023
8ab5e55
feat(order): adding a new then in the view chronologic order list sce…
dinizluiza Dec 2, 2023
f0eb07c
feat(order): adding repeat previous order scenario
dinizluiza Dec 2, 2023
986421a
Merge branch 'dev'
dinizluiza Dec 2, 2023
87820db
fix(order): adjustment last scenario
dinizluiza Dec 2, 2023
8b9635e
reorg project history main
dinizluiza Dec 2, 2023
55b8179
reorg project history dev
dinizluiza Dec 2, 2023
2e972a2
feat: adding review restaurant of previous order scenario to order fe…
dinizluiza Dec 2, 2023
58fa3e0
fix: fixing review restaurant of previous order scenario of order fea…
dinizluiza Dec 2, 2023
9015577
Squashed 'frontend/' content from commit ecb2f67
caiolbarreto Dec 11, 2023
3eb0989
Merge commit '90155775e0da53cc5643466dc01080383927e44e' as 'frontend'
caiolbarreto Dec 11, 2023
a069e5c
Squashed 'backend/' content from commit f8aeda3
caiolbarreto Dec 11, 2023
b35a067
Merge commit 'a069e5c66c1f72c4940dc71be352e756644b12b7' as 'backend'
caiolbarreto Dec 11, 2023
5ca43cb
feat: menu crud and project configuration
caiolbarreto Dec 11, 2023
cced2b6
fix: add depedency to run tests
caiolbarreto Dec 11, 2023
cf49351
Merge pull request #9 from caiolbarreto/feat/menu-crud
claraabk Dec 11, 2023
eb4def2
Merge pull request #8 from dinizluiza/main
claraabk Dec 11, 2023
2534668
Merge pull request #4 from pccql/main
claraabk Dec 11, 2023
4925a2e
Merge pull request #2 from MarcosND/main
claraabk Dec 11, 2023
b7ca335
feat: category crud
pccql Dec 12, 2023
a0f9894
feat: connect category to menu item
pccql Dec 12, 2023
a597b50
Merge pull request #10 from pccql/feat/category-crud
claraabk Dec 12, 2023
a60f308
entitie + dto
claraabk Dec 12, 2023
bbdd477
Merge branch 'main' into feat/payment-crud
claraabk Dec 12, 2023
5d07534
feat: controller tests
pccql Dec 12, 2023
a69b718
Merge pull request #11 from pccql/feat/category-crud
claraabk Dec 12, 2023
414c1c7
payment crud
claraabk Dec 12, 2023
0bde388
Merge branch 'main' of https://github.com/claraabk/ess-delivery-app i…
claraabk Dec 12, 2023
cf2bde2
fix: category items scenario
pccql Dec 12, 2023
938da2b
Merge pull request #13 from claraabk/feat/payment-crud
claraabk Dec 13, 2023
cfd1ec2
feat(order): adjusting order.feature scenarios GUI and SERVICES
dinizluiza Dec 13, 2023
08d45a4
(feat/main): Added support for update and delete of menu items
MarcosND Dec 13, 2023
1d1389a
Merge pull request #12 from pccql/main
claraabk Dec 13, 2023
dbaad2f
Merge pull request #14 from dinizluiza/main
claraabk Dec 13, 2023
10da6ad
feat: add promotions scenarios
Brunonaive03 Dec 13, 2023
61f3e55
chore: fix unit tests, dependency inversion and e2e tests
caiolbarreto Feb 16, 2024
6cedb3f
fix: add the other changes
caiolbarreto Feb 16, 2024
28eb1a7
Merge pull request #15 from MarcosND/main
claraabk Feb 16, 2024
6944a3b
Merge pull request #16 from Brunonaive03/main
claraabk Feb 16, 2024
3f422dd
fix: fetch the delete and update functions
caiolbarreto Feb 16, 2024
ce1f05e
chore: update and delete unit tests and service implementation
caiolbarreto Feb 16, 2024
d2f9c38
chore: update and delete e2e tests
caiolbarreto Feb 16, 2024
3ea1941
fix: remove make file config in editorconfig file
caiolbarreto Feb 16, 2024
b1c01d2
feat: creation of the shopping cart feature
biaferre Dec 1, 2023
2f07069
feat: added remove item and increase product scenarios
biaferre Dec 1, 2023
3f282fb
test deleting file
biaferre Dec 1, 2023
fb55bd2
fix: added specified and to increment quantity
biaferre Dec 1, 2023
814802b
feat: add cart and cartitem models
biaferre Feb 17, 2024
c470781
Merge pull request #17 from caiolbarreto/fix/unit-tests
claraabk Feb 17, 2024
5e538cf
feaet: category update, delete and position property
pccql Feb 17, 2024
5815bce
tests: category
pccql Feb 17, 2024
5eca481
tests: payment
pccql Feb 17, 2024
f52525a
fix: adjustments order services scenarios and creation of some more
dinizluiza Feb 18, 2024
787a49d
Merge pull request #18 from pccql/main
claraabk Feb 18, 2024
2351c6e
Merge pull request #19 from dinizluiza/adjustmentsOrderServiceScenarios
pccql Feb 18, 2024
74546df
chore: category item service scenarios
pccql Feb 18, 2024
46c9386
feat: added restaurants crud
MarcosND Feb 18, 2024
cd884bc
chore: categories scenarios
pccql Feb 18, 2024
f960655
Merge pull request #21 from MarcosND/main
pccql Feb 18, 2024
adb2a0c
feat: added restaurants crud
MarcosND Feb 18, 2024
8493974
feat: categories working with restaurant
pccql Feb 18, 2024
60c13fd
Merge branch 'main' into main
pccql Feb 18, 2024
4e501fe
Merge pull request #22 from pccql/main
pccql Feb 18, 2024
f050ffa
scenarios
claraabk Feb 19, 2024
d0523e0
fix: tests
pccql Feb 19, 2024
5cc25b6
Merge pull request #23 from pccql/main
pccql Feb 19, 2024
5a41610
chore: order history back and tests
dinizluiza Feb 19, 2024
100cff7
feat: added restaurants e2e and unit tests
MarcosND Feb 19, 2024
27b7fbd
fix: delete migration
caiolbarreto Feb 19, 2024
60f92b0
fix: include restaurant in schema
caiolbarreto Feb 19, 2024
d5630ed
fix: include restaurant in app module
caiolbarreto Feb 19, 2024
b88a72f
Merge pull request #25 from MarcosND/main
pccql Feb 19, 2024
9a144fe
implement cart model
biaferre Feb 19, 2024
8a85223
fix: categories controller
caiolbarreto Feb 19, 2024
fe7feef
fix: update categories controller with restaurant
caiolbarreto Feb 19, 2024
55fef63
implement cart model and scenarios
biaferre Feb 19, 2024
1820fea
fix: update categories service tests
caiolbarreto Feb 19, 2024
628daf7
fix: update categories service
caiolbarreto Feb 19, 2024
bba7ce2
fix: add restaurant in class validation
caiolbarreto Feb 19, 2024
71664c6
Merge branch 'main' into feat/cart
biaferre Feb 19, 2024
aeca791
Merge pull request #24 from dinizluiza/feat/orderBackTest
caiolbarreto Feb 19, 2024
e48566d
Update order.feature
dinizluiza Feb 19, 2024
c338af3
Merge pull request #27 from dinizluiza/patch-1
pccql Feb 19, 2024
08c357c
Merge branch 'main' into feat/cart
biaferre Feb 19, 2024
1e45904
Merge pull request #26 from biaferre/feat/cart
pccql Feb 19, 2024
efa950a
feat: redone cart crud
biaferre Feb 19, 2024
db2ac4e
feat: cart module
biaferre Feb 19, 2024
367c734
fix: provide service for cart module
biaferre Feb 19, 2024
9604fa0
feat: get cart item by id
biaferre Feb 19, 2024
42de625
fix: get cart item by id
biaferre Feb 19, 2024
36ffdfa
fix: retrieve test for cart
biaferre Feb 20, 2024
ad7ff47
adjustment: order.feature scenarios and tests
dinizluiza Feb 20, 2024
6356178
Merge pull request #29 from dinizluiza/patch-2
pccql Feb 20, 2024
f07dffc
Merge pull request #28 from kurapixa/feat/cart
pccql Feb 20, 2024
6511098
fix: merge promotions
Brunonaive03 Feb 19, 2024
dae20a9
feat: add promotions migration
Brunonaive03 Feb 19, 2024
da994c3
Merge pull request #30 from Brunonaive03/main
claraabk Feb 20, 2024
183beaf
Update order.feature
dinizluiza Mar 9, 2024
31ef688
Merge pull request #31 from dinizluiza/patch-3
caiolbarreto Mar 9, 2024
8c286d7
fix: cart integration
caiolbarreto Mar 9, 2024
e38ef77
Merge pull request #32 from caiolbarreto/fix/cart-integration
caiolbarreto Mar 9, 2024
95ccd44
fix: promotions creating
Brunonaive03 Mar 10, 2024
4781286
Merge branch 'promotions'
Brunonaive03 Mar 10, 2024
371aa10
Merge pull request #33 from Brunonaive03/main
caiolbarreto Mar 10, 2024
096c9f6
chore: menu item front end and initial config
caiolbarreto Mar 10, 2024
5eeb8fc
Merge pull request #34 from caiolbarreto/feat/menu-item-front
caiolbarreto Mar 10, 2024
dd056fb
chore: enable cors
caiolbarreto Mar 10, 2024
318b56b
Merge pull request #35 from caiolbarreto/feat/menu-item-front
caiolbarreto Mar 10, 2024
2285236
main/feature: initial restaurants create and listing fe setup
MarcosND Mar 10, 2024
a286f17
Merge branch 'main' of https://github.com/claraabk/ess-delivery-app
MarcosND Mar 10, 2024
3bfefdc
Merge pull request #36 from MarcosND/main
caiolbarreto Mar 10, 2024
cb39fc9
feat: categories post and delete
pccql Mar 10, 2024
955529d
Merge branch 'main' into main
pccql Mar 10, 2024
4c289a3
Merge pull request #37 from pccql/main
pccql Mar 10, 2024
4f74c59
feat: categories post and delete
pccql Mar 10, 2024
66c1e98
chore: manage menu item
caiolbarreto Mar 10, 2024
0299da8
Merge remote-tracking branch 'ess/main' into feat/menu-item-front
caiolbarreto Mar 10, 2024
47906ec
feat: pages connection
pccql Mar 10, 2024
36cdc09
Merge pull request #38 from pccql/main
pccql Mar 10, 2024
8b98e7a
chore: create, update and delete item
caiolbarreto Mar 10, 2024
ac1d82d
chore: solve conflicts
caiolbarreto Mar 10, 2024
d06fd82
feat: home page
pccql Mar 10, 2024
c201d26
chore: remove tabs
caiolbarreto Mar 10, 2024
a92245a
Merge pull request #39 from caiolbarreto/feat/menu-item-front
caiolbarreto Mar 10, 2024
702f2b9
feat: update categories
pccql Mar 10, 2024
b7f6a85
Merge remote-tracking branch 'upstream/main'
pccql Mar 10, 2024
317c24c
feat:payment
claraabk Mar 10, 2024
0da538f
fix conflicts
claraabk Mar 10, 2024
8315b28
Merge branch 'main' of https://github.com/claraabk/ess-delivery-app
MarcosND Mar 10, 2024
99dcf09
feat: join menu to menu page
pccql Mar 10, 2024
9a012bf
Merge pull request #40 from pccql/main
pccql Mar 10, 2024
af5a4cf
finished payment
claraabk Mar 10, 2024
c633d71
Merge branch 'main' of https://github.com/claraabk/ess-delivery-app i…
claraabk Mar 10, 2024
6ac5a76
Merge branch 'main' of https://github.com/claraabk/ess-delivery-app
MarcosND Mar 10, 2024
121de8f
fixed bottom
claraabk Mar 10, 2024
b62069a
bottom bar user option
claraabk Mar 10, 2024
d7bda90
fixed payment useEffect
claraabk Mar 10, 2024
12bdbe8
feat: tests config
pccql Mar 10, 2024
de970a1
Merge remote-tracking branch 'upstream/main'
pccql Mar 10, 2024
7b3a2b2
remove lock
pccql Mar 10, 2024
bd5b9ee
Merge pull request #42 from pccql/main
pccql Mar 10, 2024
50732ef
added cart route
biaferre Mar 11, 2024
432d8ab
feat: create categories test
pccql Mar 11, 2024
055bc58
Merge pull request #43 from pccql/main
pccql Mar 11, 2024
6d0c0ef
Merge branch 'main' of https://github.com/claraabk/ess-delivery-app
MarcosND Mar 11, 2024
1f7ef26
feat: categories tests
pccql Mar 11, 2024
0df808c
tests: dont use id
pccql Mar 11, 2024
a9a57bb
Merge pull request #44 from pccql/main
pccql Mar 11, 2024
beb39bf
feat: payment first test
claraabk Mar 11, 2024
d4b31e4
Merge branch 'main' of https://github.com/claraabk/ess-delivery-app i…
claraabk Mar 11, 2024
01d0bc3
Merge branch 'main' of https://github.com/claraabk/ess-delivery-app
MarcosND Mar 11, 2024
bfe3c74
feat/main: finishing restaurant fe and initial tests setup
MarcosND Mar 11, 2024
d36d804
feat: payment tests
claraabk Mar 11, 2024
f0e86d7
implemented cart context
biaferre Mar 11, 2024
207cf2f
feat:cart: implemented clear and max quantity
biaferre Mar 11, 2024
b8018c5
Merge remote-tracking branch 'upstream/main' into feat/cart
biaferre Mar 11, 2024
b2f5388
fixed cart scenarios
biaferre Mar 11, 2024
54577fd
feat/order: front and tests
dinizluiza Mar 11, 2024
64341de
main/feature: finishing restaurants e2e tests
MarcosND Mar 11, 2024
65ecaf4
Merge pull request #49 from MarcosND/main
MarcosND Mar 11, 2024
db6cd61
Merge remote-tracking branch 'upstream/main' into feat/cart
biaferre Mar 11, 2024
049ada9
adjustment test comment
dinizluiza Mar 11, 2024
b4dd9bb
scenario comment final adjustment
dinizluiza Mar 11, 2024
6711030
fix: avaliar pedido anterior teste e cenario
dinizluiza Mar 11, 2024
d922051
chore: item menu tests
caiolbarreto Mar 11, 2024
df601c9
Merge pull request #50 from caiolbarreto/feat/menu-items-tests
caiolbarreto Mar 11, 2024
d04753e
Merge pull request #48 from dinizluiza/order-front-history
caiolbarreto Mar 11, 2024
6ffd022
feat/main: added picture to restaurant and new scenario
MarcosND Mar 11, 2024
54a1dd0
Merge pull request #51 from MarcosND/main
MarcosND Mar 11, 2024
0dfa772
feat/main: added img fallback
MarcosND Mar 11, 2024
6f376b9
feat: first test implemented
biaferre Mar 11, 2024
a7a0481
fix/main: adjusted test names
MarcosND Mar 11, 2024
a0dd61f
Merge pull request #52 from MarcosND/main
MarcosND Mar 11, 2024
bca6b58
feat: implemented remove test
biaferre Mar 11, 2024
cf5ee69
impl
biaferre Mar 11, 2024
f58add2
feat/main: adjusted update name validation
MarcosND Mar 11, 2024
8f32a25
Merge pull request #53 from MarcosND/main
MarcosND Mar 11, 2024
a42a094
fix merge
biaferre Mar 11, 2024
da34788
feat: added clear test for cart
biaferre Mar 11, 2024
e55ad56
feat: quantity test for cart
biaferre Mar 11, 2024
597ea15
began cart-order integration
biaferre Mar 11, 2024
ab4944a
Merge branch 'claraabk:main' into feat/cart
biaferre Mar 11, 2024
9cb5f04
Merge remote-tracking branch 'upstream/main' into feat/cart
biaferre Mar 11, 2024
37298b6
Merge pull request #45 from kurapixa/feat/cart
pccql Mar 11, 2024
7a8205e
fix: dependecy
pccql Mar 11, 2024
5c9d285
Merge pull request #54 from pccql/main
pccql Mar 11, 2024
d6e57e4
fix: order test and bottom bar navigation
caiolbarreto Mar 11, 2024
e5db206
Merge pull request #55 from caiolbarreto/fix/test-and-bottom-bar
caiolbarreto Mar 11, 2024
33f085f
feat all cart tests done
biaferre Mar 11, 2024
a6a432a
all tests
biaferre Mar 11, 2024
fccaf52
refactor: menu api
biaferre Mar 13, 2024
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
__pycache__/

*.log
*.swp
*.swp
.env
node_modules/*
1 change: 1 addition & 0 deletions backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
12 changes: 12 additions & 0 deletions backend/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false
4 changes: 4 additions & 0 deletions backend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## DATABASE
DATABASE_USER=
DATABASE_PASSWORD=
DATABASE_URL=
25 changes: 25 additions & 0 deletions backend/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir : __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
};
4 changes: 4 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
.env
dist
yarn-error.log
4 changes: 4 additions & 0 deletions backend/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint
4 changes: 4 additions & 0 deletions backend/.husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run test
5 changes: 5 additions & 0 deletions backend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"trailingComma": "all",
"endOfLine": "auto"
}
3 changes: 3 additions & 0 deletions backend/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"editor.tabSize": 2
}
13 changes: 13 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:alpine3.16

WORKDIR /app

COPY package*.json ./

RUN yarn install

COPY . .

EXPOSE 3333

CMD npx prisma generate && yarn dev
67 changes: 67 additions & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<p align="center">
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="200" alt="Nest Logo" /></a>
</p>

[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
[circleci-url]: https://circleci.com/gh/nestjs/nest

<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
<p align="center">
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="yarnVersion" /></a>
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="yarnDownloads" /></a>
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
<a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a>
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
</p>
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
[![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->

## Description

[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.

## Installation

```bash
$ yarn install
```

## Running the app

```bash
# development
$ yarn start

# watch mode
$ yarn dev

# production mode
$ yarn start:prod
```

## Test

```bash
# unit tests
$ yarn test

# e2e tests
$ yarn test:e2e

# test coverage
$ yarn test:cov
```

## Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).

## License

Nest is [MIT licensed](LICENSE).
26 changes: 26 additions & 0 deletions backend/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: "3"

services:
server:
build: .
command: yarn dev
env_file: .env
environment:
DATABASE_URL: "postgresql://${DATABASE_USER}:${DATABASE_PASSWORD}@db:5432/${DATABASE_USER}?schema=public"
ports:
- "3333:3333"
volumes:
- .:/app
restart: unless-stopped
depends_on:
- db

db:
image: postgres
restart: unless-stopped
env_file: .env
environment:
- POSTGRES_USER=${DATABASE_USER}
- POSTGRES_PASSWORD=${DATABASE_PASSWORD}
ports:
- "5432:5432"
82 changes: 82 additions & 0 deletions backend/docs/architecture-pattern.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Architecture Pattern

The base project was created to give a quick "start" to the discipline's team projects. But, at the same time, we didn't want to give up a certain level of organization that helps to develop features safely and makes it easier to create tests.

## Table of Contents

1. [Layered architecture](#layered-architecture)
2. [What is the Model for?](#what-is-the-model-for)
3. [Dependency Injection](#dependency-injection)
4. [Database](#database)
5. [Routes](#routes)
6. [Conclusion](#conclusion)

---

# Layered architecture

Layered architecture is a software design approach where the software is separated into different layers (functional areas), each with a specific role and responsibility. In a typical layered architecture, you will find the following layers:

## Entities Layer

This layer represents the business data and the rules or logic that govern access to and updates of this data. These are typically the business objects (like Users, Products, Orders, etc.) and are independent of any specific technological choice (database, external services, etc.). They just contain data and methods to manipulate this data.

## Repository Layer

This layer acts as a bridge between the entities (business data) and the database. It is responsible for all database operations like create, read, update, and delete (CRUD). It basically interacts with your database or any other storage system.

## Service Layer

This layer contains the business logic of your application. It uses the repository layer to persist or retrieve the business data, performs necessary processing and passes the data to the controller. The service layer acts as an intermediary between the web layer (controllers) and the data access layer (repositories).

## Controller Layer

This layer is responsible for handling user requests and controlling the flow of the application. It interacts with the service layer to perform business operations and sends back the responses to the client. In a web application, these are typically the endpoints of your API.

The layered architecture approach helps in separating concerns, making the software solution scalable, and also promotes high cohesion and low coupling. This design pattern is beneficial because it aligns with the Single Responsibility Principle (SRP), which is a key aspect of SOLID principles in software design and architecture. Each layer has a specific role and does not need to concern itself with the responsibilities of any other layer. This makes each layer independently modifiable and testable, leading to a software design that is easier to maintain and expand.

---

# What is the Model for?

Models here are not absolutely essential, but are primarily used as a final representation of returned data. Unlike entities, which we can think of as a direct representation of a database table in code, we use models to represent what we could return in an endpoint.
For example, when retrieving a user from the database, we might not want to return its password. In this case, the model could represent a user excluding the password field.

But we can follow for example the idea of [​​DTOs](https://www.okta.com/identity-101/dto/), which would also be a good idea.
Feel free to explore alternatives for representing these data operations.

# Dependency Injection

Is a design pattern that allows a system to be more flexible, testable, and modular. It's a form of Inversion of Control (IoC) which means that the control is inverted - instead of an object controlling its own dependencies, it's controlled by an outside party.

In our case, we came up with a "homemade" solution that, overall, works very well. We use the Injector class, which is in charge of controlling our application's dependencies through its methods: registerService, getService, registerRepository and getRepository. The use of this class can be seen in the index.ts file, located in the **src/di folder**.

# Database

The idea of ​​a base project may seem complex when it proposes to cover many possibilities of use. Considering a practical and simple case, in this base project we are using the idea of ​​a "database" at runtime. In the **src/database/index.ts** file, we can observe the implementation of a simple interface for a database, where each "table" would be a set of key-values. Please don't see this as a limiter. If you prefer, you can choose to use a real database, be it SQL or NoSQL. By maintaining a similar level of project organization, the benefits will be the same.

To manipulate our database with base methods, we have a class called BaseRepository. This will be extended by other repositories, thus allowing the inheritance of these methods and the reuse of our code's logic.

# Routes

Worth mentioning is our backend routes/endpoints definition file located at **src/routes/index.ts**. Its idea is simple: for each new controller, you can configure it inside 'export default' using **'app.use'**.

```
export default (app: Express) => {
app.use(
prefix,
new TestController(router, di.getService(TestService)).router
);
app.use(
prefix,
new ExampleController(router, di.getService(ExampleService)).router
);
};

```

There is already an example in the file and the approach would be the same for all controllers. Thus, the controllers and their endpoints are registered and recognized in the application.

# Conclusion

Certainly, there are more details about the functionalities that are used in the project. However, the **Test** example case already covers many aspects, including testing. The base project is designed to make it easy, not to limit your preferences. What needs to be emphasized is that the main idea is the architecture used, which clearly distributes code responsibilities, thus facilitating maintenance and testing.
9 changes: 9 additions & 0 deletions backend/ess-docs/bruno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"version": "1",
"name": "ess-docs",
"type": "collection",
"ignore": [
"node_modules",
".git"
]
}
19 changes: 19 additions & 0 deletions backend/ess-docs/categories/create.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
meta {
name: create
type: http
seq: 1
}

post {
url: http://localhost:3333/categories
body: json
auth: none
}

body:json {
{
"name" : "entradas",
"description": "good",
"restaurantId":"e318dd08-543f-488f-9983-7689f5009d14"
}
}
20 changes: 20 additions & 0 deletions backend/ess-docs/restaurant/create.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
meta {
name: create
type: http
seq: 1
}

post {
url: http://localhost:3333/restaurants
body: json
auth: none
}

body:json {
{
"name": "Teste",
"address": "rua",
"closingTime": "2024-03-10T16:40:25.553Z",
"type": "sushi"
}
}
5 changes: 5 additions & 0 deletions backend/nest-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://json.schemastore.org/nest-cli",
"collection": "@nestjs/schematics",
"sourceRoot": "src"
}
Loading