Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
283 commits
Select commit Hold shift + click to select a range
48d6048
feat(shopping_cart): 2 new failure scenarios for shopping_cart.feature
luanjaardim Nov 26, 2023
b605932
fix(shopping_cart): fix bad double quotes format
luanjaardim Nov 26, 2023
25eab79
feat(shopping_cart): new scenario for shopping_cart.feature
luanjaardim Nov 26, 2023
607ff46
feat(shopping_cart): remove item scenario for shopping_cart.feature
luanjaardim Nov 26, 2023
c65df19
merge branch dev - solve conflicts
luanjaardim Nov 26, 2023
36972f7
fix(shopping_cart): fix 'clean shopping cart' scenario
luanjaardim Nov 26, 2023
e307b06
Merge pull request #3 from luanjaardim/masterLuan
luanjaardim Nov 26, 2023
c3ad14b
feat: creation of the loginclient feature
caiovmfc Nov 26, 2023
dc38d79
feat(shopping_cart): add feature description for shopping_cart
luanjaardim Nov 27, 2023
69e9579
Merge pull request #4 from luanjaardim/masterLuan
luanjaardim Nov 27, 2023
4765917
scenario descriptions
caiovmfc Nov 27, 2023
45ece06
feat(loginclient): scenario descriptions
caiovmfc Nov 27, 2023
a9d89ca
feat(shopping_cart): login query scenario for shopping_cart.feature
luanjaardim Nov 27, 2023
e988ef4
feat(loginclient):more scenario descriptions
caiovmfc Nov 27, 2023
17a1075
feat(shopping_cart): adding service scenario to shopping_cart.feature…
luanjaardim Nov 27, 2023
1b56048
feat(loginclient): extra scenario Q3d
caiovmfc Nov 27, 2023
df3c022
feat(loginclient): extra scenario Q7d
caiovmfc Nov 27, 2023
82510ed
feat(loginclient): extra step last scenario Q7e
caiovmfc Nov 27, 2023
eef95b2
feat(loginclient): extra scenario Q7f
caiovmfc Nov 27, 2023
0b287bb
feat(loginclient): final commit Q7j
caiovmfc Nov 27, 2023
b4a6c44
feat(loginclient): fix last scenario Q8
caiovmfc Nov 27, 2023
b338e76
feat: creation of the <client_registration.feature> feature
Cleber-Victor Nov 27, 2023
a17ad93
feat(loginclient): final commit scenarios Q9c
caiovmfc Nov 27, 2023
947b683
Merge pull request #5 from caiovmfc/main
luanjaardim Nov 27, 2023
89fe27a
Merge pull request #6 from luanjaardim/masterLuan
luanjaardim Nov 27, 2023
d504f50
feat(loginclient): commit teste main Q13
caiovmfc Nov 28, 2023
f15cba6
feat(loginclient): commit teste dev Q13
caiovmfc Nov 28, 2023
a4152be
feat(loginclient): commit intermediario Q13
caiovmfc Nov 28, 2023
2367caa
feat(loginclient): final commit Q13
caiovmfc Nov 28, 2023
8fb5bf9
feat: adding Q14 test scenario to loginclient.feature
caiovmfc Nov 28, 2023
063d6e5
fix: fixing Q14 test scenario of loginclient.feature
caiovmfc Nov 28, 2023
2b6c0a4
feat: adding Q14 test scenario to loginclient.feature after correction
caiovmfc Nov 28, 2023
5320ba1
feat: add return to main menu scenario to Order Cancellation feature
HugoZig Nov 29, 2023
d9ffa86
Added 'client_registration.feature'
Cleber-Victor Nov 29, 2023
2ad6d4c
login_restaurant.feature
Nov 30, 2023
290f060
fix Client_Registration GUI scenario
Cleber-Victor Nov 30, 2023
2206bc9
Added 2 scenarios to client_registration
Cleber-Victor Nov 30, 2023
439e51b
Added new scenario to clients_registration
Cleber-Victor Dec 1, 2023
a3d6203
Fixing a scenario in clients_registration
Cleber-Victor Dec 1, 2023
976ec08
Added 1 scenario to client_registration
Cleber-Victor Dec 1, 2023
6c72d2d
Merge branch 'dev'
Cleber-Victor Dec 1, 2023
26eb924
fixing clients_registration
Cleber-Victor Dec 1, 2023
effb069
Merge remote-tracking branch 'upstream/main'
Cleber-Victor Dec 1, 2023
7ecc247
addicting scenarios
Dec 1, 2023
5f6edce
adding a new scenario in clients_registration
Cleber-Victor Dec 1, 2023
49fce07
fix: diversify scenario parameters
HugoZig Dec 3, 2023
5177bf8
feat: add service scenario for access to main menu from orders in pro…
HugoZig Dec 3, 2023
9c6db28
feat: add service scenario for cancellation failure
HugoZig Dec 3, 2023
d0b262e
feat: add service scenario for cancellation reason record
HugoZig Dec 3, 2023
772cfbc
Merge pull request #8 from Cleber-Victor/main
luanjaardim Dec 4, 2023
3a45b74
fix: fix service scenario for successful cancellation
HugoZig Dec 4, 2023
f2ec670
fix: fix service scenario for unsuccessful cancellation
HugoZig Dec 4, 2023
2ba1e49
fix: remove unnecessary scenarios
HugoZig Dec 4, 2023
124dba5
feat(restaurant_registration): add unsuccessful restaurant registrati…
cebms Dec 4, 2023
d2cd49b
feat(restaurant_registration): add currently registered restaurants r…
cebms Dec 4, 2023
5d1e874
feat(restaurant_registration): add restaurant update GUI scenarios
cebms Dec 4, 2023
69ab607
fix(restaurant_registration): fix restaurant_registration.feature for…
cebms Dec 4, 2023
0847c3d
fix(restaurant_registration): fix successful restaurant registration …
cebms Dec 4, 2023
820f3c5
fix(restaurant_registration): add improvement to restaurant deletion …
cebms Dec 4, 2023
fec7945
Merge pull request #9 from cebms/main
luanjaardim Dec 5, 2023
cbdbcb3
feat: add service scenario for getting all orders from backend
HugoZig Dec 8, 2023
d0f40e7
refactor: rename <Pedidos em Andamento> to <Pedidos>
HugoZig Dec 8, 2023
197ac19
fix(shopping_cart): fix bad scenario formatation
luanjaardim Dec 8, 2023
d38b919
refactor(shopping_cart): swap scenarios positions
luanjaardim Dec 8, 2023
2393bf9
feat(shopping_cart): new succesful scenario for shopping_cart.feature
luanjaardim Dec 8, 2023
bf8deb2
fix(shopping_cart): change backend route for shopping_cart.feature
luanjaardim Dec 8, 2023
0a2f745
feat: initial commit + GUI scenarios
caiovmfc Dec 9, 2023
bc0406a
successful login service scenario
caiovmfc Dec 9, 2023
289bd48
incorrect password service scenario
caiovmfc Dec 9, 2023
48a50eb
incorrect email service scenario
caiovmfc Dec 9, 2023
8810f3c
feat: blank field service scenario
caiovmfc Dec 9, 2023
474718c
feat(mainmenu): initial commit
caiovmfc Dec 9, 2023
265b4e4
feat(mainmenu): description
caiovmfc Dec 9, 2023
b5489f3
feat(mainmenu): GUI and Service scenarios for loginclient
caiovmfc Dec 9, 2023
a57a57b
feat(mainmenu): GUI and Service scenarios for registerclient
caiovmfc Dec 9, 2023
45b4af1
feat(mainmenu): GUI and Service scenarios for loginrestaurant
caiovmfc Dec 9, 2023
9a27faf
feat(mainmenu): GUI and Service scenarios for registerrestaurant
caiovmfc Dec 9, 2023
c57978f
Merge pull request #10 from caiovmfc/feat/loginclient
luanjaardim Dec 9, 2023
6ec058d
Merge pull request #12 from luanjaardim/masterLuan
luanjaardim Dec 11, 2023
e801366
Merge pull request #13 from HugoZig/main
luanjaardim Dec 11, 2023
e7f8e1c
Adding scenario:Leitura de cliente do sistema to client_registration
Cleber-Victor Dec 12, 2023
be3a964
Adding scenario: Remober Conta (GUI) to client_registration
Cleber-Victor Dec 12, 2023
29cec45
Adding scenario: Cadastro bem sucedido (GUI) to client_registration
Cleber-Victor Dec 12, 2023
7c05342
Adding scenario: Cadastro mal sucedido por e-mail repetido (GUI) to c…
Cleber-Victor Dec 12, 2023
6b3e4cf
Adding scenario: Cadastro mal sucedido por CPF repetido (GUI) to clie…
Cleber-Victor Dec 12, 2023
caeb22a
Adding scenario: Atualização de cadastro (GUI) to client_registration
Cleber-Victor Dec 12, 2023
ee2a506
Adding scenario: Atualização de cadastro mal sucedida, email já usado…
Cleber-Victor Dec 12, 2023
d182377
Merge pull request #14 from Cleber-Victor/main
luanjaardim Dec 12, 2023
5faab84
Excluding a wrong scenario in client_registration
Cleber-Victor Dec 12, 2023
c95c283
Editing scenarios in client_registration
Cleber-Victor Dec 12, 2023
7546164
Merge pull request #15 from Cleber-Victor/main
luanjaardim Dec 12, 2023
6dbbe04
fix: fix typos in scenarios
HugoZig Dec 13, 2023
bcb7967
Merge pull request #16 from HugoZig/main
luanjaardim Dec 13, 2023
f6abe31
fix(mainmenu): get to post service scenarios
caiovmfc Dec 13, 2023
aec94ca
fix(main): get to post service scenarios
caiovmfc Dec 13, 2023
13f0002
Merge pull request #11 from caiovmfc/feat/mainmenu
luanjaardim Dec 13, 2023
8035da8
fix: adjust order cancellation scenarios
HugoZig Dec 13, 2023
f6ac50c
addicting new scenarios on login restaurant
Dec 13, 2023
9879b92
refactor: change parammeters for order cancellation scenarios
HugoZig Dec 13, 2023
8bcbffa
addicting the descrisptions' feature
Dec 13, 2023
7b06764
Merge pull request #19 from HugoZig/main
luanjaardim Dec 13, 2023
93c933e
add new scenarios on login restaurant
Dec 13, 2023
1032078
Merge pull request #21 from emillycn/dev
luanjaardim Dec 13, 2023
4eba20c
fix: remove husky package
cebms Dec 19, 2023
0431f2e
build(backend): remove boilerplate code
cebms Jan 17, 2024
fef86a3
feat(restaurant_registration): create controllers and use prisma ORM
cebms Jan 20, 2024
19697ec
feat: add docker suport for backend and database
cebms Jan 20, 2024
0769ec7
feat: add volume mapping to enable live reload
cebms Jan 20, 2024
e405c1e
feat: add command to package.json to use within docker
cebms Jan 20, 2024
6860685
Update README.md
cebms Jan 21, 2024
6912f78
Merge pull request #1 from cebms/feat/docker-infrastructure
cebms Jan 21, 2024
d230a14
feat(restaurant_registration): add duplicate email/cnpj verification …
cebms Jan 21, 2024
39d5b45
refactor(restaurant_registration): improve error handling with Duplic…
cebms Jan 21, 2024
9d8d3fa
feat(restaurant_registration): add fields validation
cebms Jan 21, 2024
9f955b3
feat(restaurant_registration): store hashed password in database
cebms Jan 21, 2024
e611ebd
fix: fix README.md instructions
cebms Jan 21, 2024
0355804
feat(restaurant_registration): add new migration
cebms Jan 21, 2024
33d60f9
feat(restaurant_registration): create restaurant delete endpoint
cebms Feb 1, 2024
05e0ee8
feat(restaurant_registration): create restaurant update endpoint
cebms Feb 1, 2024
f02de19
Merge pull request #22 from cebms/main
luanjaardim Feb 2, 2024
eeff309
fix(docker): fix volume mapping error
Feb 3, 2024
88c9647
Feat: Add Client, Item and Order Table
luanjaardim Feb 4, 2024
62f4a52
Feat: Adding backend support for ShoppingCart Feat
luanjaardim Feb 5, 2024
c124ea2
Fix: fix DATABASE_URL example
luanjaardim Feb 5, 2024
d82d5ce
Feat: Adding migrations for new tables
luanjaardim Feb 5, 2024
faaf43a
Merge pull request #23 from luanjaardim/masterLuan
luanjaardim Feb 5, 2024
9ef9a34
Merge pull request #2 from cebms/dev
cebms Feb 6, 2024
333ded1
Refac: Renaming quantity Order
luanjaardim Feb 7, 2024
e98301c
Wip: Updating communication functions with the DB
luanjaardim Feb 7, 2024
020c4ba
Wip: Improving controller and routing for Cart
luanjaardim Feb 7, 2024
f409a85
Merge branch 'main' into main
luanjaardim Feb 8, 2024
e4a490a
Merge pull request #24 from cebms/main
luanjaardim Feb 8, 2024
94b3242
Merge branch 'masterLuan'
luanjaardim Feb 9, 2024
df26d46
fix: fix migrations not running
cebms Feb 9, 2024
69aedd4
fix: exposing prisma studio port
cebms Feb 9, 2024
60ffdc9
Merge branch 'luanjaardim:main' into main
cebms Feb 9, 2024
6963e14
Merge pull request #25 from cebms/main
luanjaardim Feb 9, 2024
9a1ae68
Update README.md
cebms Feb 11, 2024
a19622e
refactor(restaurant_registration): reorganize restaurant_registration…
cebms Feb 11, 2024
6f0b34b
feat(restaurant_registration): add new services scenarios
cebms Feb 11, 2024
291eed5
Feat: Mock Prisma communication for Testing
luanjaardim Feb 11, 2024
7791498
Merge pull request #26 from luanjaardim/masterLuan
luanjaardim Feb 11, 2024
f260a48
Merge remote-tracking branch 'origin/main' into dev
cebms Feb 11, 2024
f341b61
Feat: Changing Models, Adding Orders Table
luanjaardim Feb 11, 2024
d9e0120
Merge pull request #27 from luanjaardim/masterLuan
luanjaardim Feb 11, 2024
ead43bc
feat: Order Cancellation and Orders Model, Controller and Index creation
HugoZig Feb 11, 2024
01c39e7
Merge pull request #28 from HugoZig/main
luanjaardim Feb 11, 2024
cd6f0d9
Feat: Adding OrderItemEntity class
luanjaardim Feb 12, 2024
588bacc
Wip: Changes on ShoppingCartModel for the new DB
luanjaardim Feb 12, 2024
4fa8920
Feat: Adding functions to communicate with Model
luanjaardim Feb 12, 2024
3f297a7
Wip: Controller using new service functions
luanjaardim Feb 12, 2024
35f29f9
Fix: new ShoppingCartController routes setup
luanjaardim Feb 12, 2024
a8189a9
Feat: Adding Unit Tests for ShoppingCart Feature
luanjaardim Feb 12, 2024
c5b7bc0
Merge pull request #29 from luanjaardim/masterLuan
luanjaardim Feb 12, 2024
44be320
Feat: Adding tests for OrderItem quantity changing
luanjaardim Feb 12, 2024
bdc9521
test(restaurant_registration): Implement first test using prismaMock
cebms Feb 12, 2024
6bf6689
Feat: Adding test for removing items from DB
luanjaardim Feb 12, 2024
16c1cf0
Fix: Temporarily removing '/users' from Cart Tests
luanjaardim Feb 12, 2024
0f9128f
test(restaurant_registration): add reuse to scenario step functions
cebms Feb 12, 2024
cd6a1c3
test(restaurant_registration): initial scenarios tests implementation
cebms Feb 12, 2024
e1036dd
feat: adding docker suport
caiovmfc Feb 12, 2024
e6fa91e
Merge branch 'main' of https://github.com/caiovmfc/Projeto-ESS
caiovmfc Feb 12, 2024
fa26d97
Merge branch 'feat/mainmenu' of https://github.com/caiovmfc/Projeto-E…
caiovmfc Feb 12, 2024
c3fbbc9
Merge branch 'feat/loginclient' of https://github.com/caiovmfc/Projet…
caiovmfc Feb 12, 2024
e070c02
feat: adding new attributes to client on Database
Cleber-Victor Feb 13, 2024
b2375f9
Feat: creating ClientModel
Cleber-Victor Feb 13, 2024
a3d6668
Feat: create ClientController
Cleber-Victor Feb 14, 2024
83b98a1
Fix: Fixing a feature in Client registration
Cleber-Victor Feb 14, 2024
a107ea0
Merge branch 'feat/mainmenu' into feat/loginclient
caiovmfc Feb 14, 2024
7e87bcf
Merge pull request #30 from Cleber-Victor/develop
luanjaardim Feb 14, 2024
65d4e97
Merge pull request #3 from cebms/fix-documentation
cebms Feb 14, 2024
62cf374
feat : Creating client_registration.feature and client_registration.s…
Cleber-Victor Feb 14, 2024
063516f
feat : Creating route for client
Cleber-Victor Feb 14, 2024
11881cf
Merge branch 'main' of https://github.com/caiovmfc/Projeto-ESS
caiovmfc Feb 14, 2024
634cb6c
Merge branch 'main' into feat/loginclient
caiovmfc Feb 14, 2024
2621b94
Merge pull request #31 from cebms/main
luanjaardim Feb 14, 2024
80c0bf0
Merge pull request #32 from Cleber-Victor/develop
luanjaardim Feb 14, 2024
d893238
Fix: Client Update with Restaurants methods
luanjaardim Feb 14, 2024
6697d1d
Merge branch 'main' into masterLuan
luanjaardim Feb 14, 2024
25160b8
refactor(restaurant_registration): change duplicate restaurant error …
cebms Feb 15, 2024
e56f3ba
test(restaurant_regitration): create fail scenario test case
cebms Feb 15, 2024
69e07d2
feat(loginclient): model file
caiovmfc Feb 15, 2024
239304b
test(restaurant_registration): add and clause to last test created
cebms Feb 15, 2024
1d7b7bf
test(restaurant_registration): create successful email edit test scen…
cebms Feb 15, 2024
0285416
test(restaurant_registration): add unsuccessful restaurant creation (…
cebms Feb 15, 2024
51efc10
feat(restaurant_registration): add new error verifications to restaur…
cebms Feb 16, 2024
c2e8506
test(restaurant_registration): add new test scenarios
cebms Feb 16, 2024
d5d6a6d
feat(loginclient):initial controller file
caiovmfc Feb 16, 2024
83d9bfc
feat(loginclient):initial routes
caiovmfc Feb 16, 2024
0e5dc2d
feat: create OrderCancelation service test files
HugoZig Feb 16, 2024
4515eed
feat(loginclient): routes finished and working
caiovmfc Feb 16, 2024
98c8c2d
fix(loginclient): new files added (model and controller)
caiovmfc Feb 16, 2024
ae689a4
feat: add new tests for OrderCancellation failures
HugoZig Feb 16, 2024
41fc610
feat(loginclient): migration.sql loginclient deleted
caiovmfc Feb 16, 2024
996992d
feat: Prisma db review and modifications
HugoZig Feb 16, 2024
194147a
Merge pull request #34 from HugoZig/main
luanjaardim Feb 16, 2024
5bd4ac1
Merge branch 'main' into feat/loginclient
luanjaardim Feb 16, 2024
094e4c8
Merge pull request #33 from caiovmfc/feat/loginclient
luanjaardim Feb 16, 2024
b183674
refactor: backend tests folders rearrangments
HugoZig Feb 16, 2024
46ebbb2
Fix: Fixing Client Model
Cleber-Victor Feb 16, 2024
7d1f5ff
Merge branch 'main' of https://github.com/Cleber-Victor/Projeto-ESS
Cleber-Victor Feb 16, 2024
431228a
Merge pull request #35 from HugoZig/main
luanjaardim Feb 16, 2024
00bcdbf
Merge branch 'main' into masterLuan
luanjaardim Feb 16, 2024
0e91d5a
Feat: New Test for ShoppingCart Feature
luanjaardim Feb 16, 2024
cfba697
test(restaurant_controller): add unsuccessful restaurant data (existi…
cebms Feb 17, 2024
9d1a2d8
Feat: BD Update for Model Item
luanjaardim Feb 17, 2024
80cc410
Merge pull request #36 from luanjaardim/masterLuan
luanjaardim Feb 17, 2024
711a6ef
feat(loginclient): authentication token service scenarios
caiovmfc Feb 17, 2024
6251c7b
test(restaurant_registration): apply test steps modularization when p…
cebms Feb 17, 2024
00e3d73
style(restaurant_registration): fix .feature and .steps code formatting
cebms Feb 17, 2024
5c0c80c
tests(restaurant_registration): standardize scenarios cnpj and email …
cebms Feb 17, 2024
1149dac
Merge branch 'main' into feat/loginclient
caiovmfc Feb 17, 2024
01317d5
feat(loginclient): tests files created
caiovmfc Feb 17, 2024
ed6ba40
refactor: replace orders status names
HugoZig Feb 17, 2024
7ac0e37
feat: create new scenarios for order cancellation services tests and …
HugoZig Feb 17, 2024
d958b11
feat: create new services tests for order cancelation feature
HugoZig Feb 17, 2024
b8d5229
feat: add order status and time check in order cancellation
HugoZig Feb 17, 2024
8962072
feat: add new scenarios for all orders requests (success and failures)
HugoZig Feb 17, 2024
a67d879
feat: orders requests tests creation
HugoZig Feb 17, 2024
743f964
feat: global feature file update
HugoZig Feb 17, 2024
06b5672
fix: fix a typo in order canllation tests
HugoZig Feb 17, 2024
61c8680
Merge pull request #38 from HugoZig/main
luanjaardim Feb 17, 2024
d75a443
Merge pull request #4 from cebms/dev
cebms Feb 17, 2024
1bf0380
feat(loginclient): first tests implemented
caiovmfc Feb 17, 2024
417b301
Merge pull request #39 from cebms/main
luanjaardim Feb 17, 2024
2390347
feat(loginclient): aspas corrigidas no arquivo .feature de testes
caiovmfc Feb 17, 2024
34a0c46
Feat: Update ShoppingCartModel access to models
luanjaardim Feb 17, 2024
6baae5d
Fix: Chaging price format of shopping_cart.feature
luanjaardim Feb 17, 2024
0b1ad96
fix(loginclient): tests now running
caiovmfc Feb 17, 2024
6234b51
Feat: Updating tests for ShoppingCart Feature
luanjaardim Feb 17, 2024
fabaa8a
Merge pull request #40 from luanjaardim/masterLuan
luanjaardim Feb 17, 2024
5d654a6
fix(loginclient): 3 basic login tests accepted + fixed errors in clie…
caiovmfc Feb 18, 2024
58892e2
feat(loginclient): new service scenarios added for forgotten password…
caiovmfc Feb 18, 2024
68fd5a9
fix(loginclient): fixed http response status in blank field service s…
caiovmfc Feb 18, 2024
096a243
feat(loginclient): new tests created for token authentication
caiovmfc Feb 18, 2024
f69f8f5
feat(loginclient): 4/6 tests working | need fix token at get header p…
caiovmfc Feb 18, 2024
3e26ac0
fix(loginclient): fixed controller and model files + fixed successful…
caiovmfc Feb 18, 2024
5e9cc0b
fix(loginclient): all tests passed! :D
caiovmfc Feb 18, 2024
44c4452
Merge branch 'luanjaardim:main' into feat/loginclient
caiovmfc Feb 18, 2024
2ecd6b9
fix: service folder deleted
caiovmfc Feb 18, 2024
c4afecf
fix: client_registration.steps.ts file recreated
caiovmfc Feb 18, 2024
803b028
Merge pull request #41 from caiovmfc/feat/loginclient
luanjaardim Feb 18, 2024
2a2da95
fix: .env.test.example file created
caiovmfc Feb 19, 2024
9d7f6d6
Merge pull request #42 from caiovmfc/feat/loginclient
luanjaardim Feb 19, 2024
d105a66
All tests created
Cleber-Victor Feb 19, 2024
b0df75b
Merge branch 'main' of https://github.com/luanjaardim/Projeto-ESS
Cleber-Victor Feb 19, 2024
4196f20
Updating my fork
Cleber-Victor Feb 19, 2024
6234afe
Fix: Excluding old 'client_registration'
Cleber-Victor Feb 19, 2024
409aa7c
Fix: Fixing tests for CLient_registration
Cleber-Victor Feb 19, 2024
59d880f
Merge pull request #43 from Cleber-Victor/main
Cleber-Victor Feb 19, 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
9 changes: 9 additions & 0 deletions backend/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#Configuracoes para defini os parametros do editor de texto, Ex tamanho do espacamento dentre outros.
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace =
2 changes: 2 additions & 0 deletions backend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#3306 is the default port for mysql
DATABASE_URL="mysql://user:password@localhost:3306/mydb"
10 changes: 10 additions & 0 deletions backend/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"parser": "@typescript-eslint/parser",
"plugins": ["no-unused-expressions"],
"rules": {
"no-unused-expressions": [
"warn",
{ "allowShortCircuit": true, "allowTernary": true }
]
}
}
39 changes: 39 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
coverage/

# Dependency directories
node_modules/

# Optional npm cache directory
.npm

# TypeScript cache
*.tsbuildinfo

# System files
.DS_Store
Thumbs.db

# Editor files
.vscode/

# Build files
dist/
lib/

# Env
.env
.env.test
.env.dev
.env.prod

# Deploy
.vercel

# Database
data/
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
4 changes: 4 additions & 0 deletions backend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "es5"
}
9 changes: 9 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:lts-iron
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY ./prisma prisma
COPY ./src src
RUN npx prisma generate
EXPOSE 5001
CMD ["npm", "run", "start:docker"]
143 changes: 143 additions & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# ESS Back-end Node.js

This is the Back-end base project in Node.js for the Software and Systems Engineering discipline, offered by the Informatics Center (CIn) of the Federal University of Pernambuco (UFPE).

## Table of Contents

1. [Getting Started](##getting-started)
2. [Scripts](#scripts)
3. [Dependencies](#dependencies)
4. [Architecture](#architecture)

## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

## Option 1 (Recommended) - Running with Docker

### Prerequisites

In order to run the project with a Docker infrastructure, make sure Docker is installed on your system.
If it is not, you can follow <a href="https://docs.docker.com/engine/install/">these steps</a> for an Ubuntu-based system

### Running the server

In order to run the server, open up a terminal in the backend root directory and run

```
docker compose up
```

<b>Now, it is necessary to run the migrations. To do so, open a terminal and run: </b>

```
docker exec -it backend-ibreno-1 sh -c "npx prisma migrate dev"
```

<b>Every time the prisma schema file is altered, the database must be updated with:</b>

```
docker exec -it backend-ibreno-1 sh -c "npx prisma migrate dev"
```

### Prisma studio
If you wish to manage the databaese in a graphical way, you can use Prisma Studio. To do so, run:

```
docker exec -it backend-ibreno-1 sh -c "npx prisma studio"
```

Now, from your browser, access http://localhost:5555

## Option 2 - Running without Docker

### Prerequisites

To run this project, you'll need to have the following software installed on your system:

- Node.js
- npm (Node Package Manager)
- MySQL

### Installing

Clone the repository and install the dependencies by running the following command in the project directory:

```

npm install

```

### First time running ?

Run the follow scripts

```

chmod +x .husky/pre-commit
chmod +x .husky/pre-push

```

```

npm run

```

### Environment

This project uses `.env` files to manage environment variables. You can create a `.env.dev` file in the project directory and set the environment variables in the file (You can create it from .`env.example`). The `env` script in the `package.json` file uses the `env-cmd` package to load the environment variables from the `.env.dev` file.

One crucial step is to correctly configure MySQL connection URL into the `.env` file. If you don't know how to do so, make sure to check <a href="https://www.prisma.io/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/connect-your-database-typescript-mysql">this post</a>

### Running the Server

To start the server, run the following command:

```

env=dev npm run start

```

This command will run the TypeScript compiler in watch mode and start the server using nodemon.

### Executing Migrations

If it is the first time the server is being executed. To do so, open a terminal and run:

```

npx prisma migrate dev

```

## Scripts

The following scripts are available in the `package.json` file:

- `start`: Runs the TypeScript compiler in watch mode and starts the server using nodemon.
- `build`: Compiles the TypeScript code.
- `test`: Runs the Jest tests for the project.
- `prettier`: Formats the code using Prettier.
- `lint`: Lints the code using ESLint.

## Dependencies

The following dependencies are used in the project:

- [env-cmd](https://github.com/toddbluhm/env-cmd): A simple way to manage your environment variables in npm scripts.
- [express](https://github.com/expressjs/express): Fast, unopinionated, minimalist web framework for Node.js.
- [typescript](https://github.com/microsoft/TypeScript): A typed superset of JavaScript that compiles to plain JavaScript.
- [jest](https://github.com/microsoft/TypeScript): Jest is a delightful JavaScript Testing Framework with a focus on simplicity.
- [pino](https://github.com/pinojs/pino): Very low overhead Node.js logger.

## Architecture

To understand and learn more details about the structure of the project, click [here](./docs/architecture-pattern.md) to be redirected to the README that contains this information.

```

```
29 changes: 29 additions & 0 deletions backend/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: '3.9'
services:
ibreno:
build: .
depends_on:
- db
environment:
ENV: DEV
PORT: 5001
DATABASE_URL: 'mysql://root:admin@db:3306/ibreno_db'
volumes:
- .:/app
- /app/node_modules
ports:
- '5001:5001' # for the application
- '5555:5555' # for prisma studio

db:
image: mysql:latest
container_name: db_ibreno
environment:
MYSQL_ROOT_PASSWORD: admin
MYSQL_DATABASE: ibreno_db
MYSQL_USER: user
MYSQL_PASSWORD: user_passwd
ports:
- '6033:3306'
volumes:
- ./data/db:/var/lib/mysql
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.
12 changes: 12 additions & 0 deletions backend/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
moduleFileExtensions: ['js', 'json', 'ts'],
rootDir: '',
testRegex: ['.steps.ts$'],
transform: {
'^.+\\.(t|j)s$': 'ts-jest',
},
setupFilesAfterEnv: ['./setupTests.ts'],
};

Loading