Skip to content

Commit

Permalink
Merge branch 'develop' into loginView
Browse files Browse the repository at this point in the history
  • Loading branch information
andrrsin authored Mar 9, 2024
2 parents 557258a + a2d8be8 commit 506ecd1
Show file tree
Hide file tree
Showing 21 changed files with 970 additions and 39 deletions.
23 changes: 15 additions & 8 deletions docs/src/08_concepts.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,26 @@ image::08-Crosscutting-Concepts-Structure-EN.png["Possible topics for crosscutti
See https://docs.arc42.org/section-8/[Concepts] in the arc42 documentation.
****

=== _Domain model and terminology_

=== _<Concept 1>_

_<explanation>_


=== _Microservice based system_

=== _<Concept 2>_
Different business functionallities will be developed in different independent services.
This will ensure that if one of them fails, the rest are still working (For example,
if the rankings go down that will not affect the main game) as they have their own deployment
as well.
Other benefits are increased maintainability due to separation in small, more readable modules
and the possibillity of using different languages or technologies for each module if needed/prefered
without colliding with the rest.

_<explanation>_

...
=== _Gateway service routing_

=== _<Concept n>_

_<explanation>_
We will use a speciallized service that will route the requests to the corresponding service, acting as
a single entry point for the application. Requests to the services are much simpler as only the api base
endpoint and the action needs to be known and the gateway can also act as a filter to manage requests
conditionally if needed. This approach also favors security as we can control which requests are actually
sent based on its content or the context of the app.
11 changes: 11 additions & 0 deletions docs/src/11_technical_risks.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,14 @@ List of risks and/or technical debts, probably including suggested measures to m
See https://docs.arc42.org/section-11/[Risks and Technical Debt] in the arc42 documentation.
****

[options="header", cols="1,1,1,1"]
|===
|Risk |Why it exists |Severity - Explanation |Possible solutions

|Use of wikibase-sdk version 8 (not final)
|It is the last version that supports 'require', which is needed to use express in the same module
|Low - The difference is, a priori, merely functional, but retains the needed characteristics
|Upgrade only if a newer version supports 'require'

|===
8 changes: 4 additions & 4 deletions docs/src/12_glossary.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ See https://docs.arc42.org/section-12/[Glossary] in the arc42 documentation.
|===
|Term |Definition

|<Term-1>
|<definition-1>
|Microservice
|Small and independent component that performs a specific business function

|<Term-2>
|<definition-2>
|API
|Set of endpoints exposed by the backend server whose purpose is interacting with the client-side
|===
11 changes: 10 additions & 1 deletion gatewayservice/gateway-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ app.get('/flags/answer', async (req, res) => {
}
});


app.get('/self', async (req, res) => {
try {
// Forward the self request to the user service
Expand All @@ -75,7 +76,15 @@ app.get('/self', async (req, res) => {

res.status(200).json(userResponse.data);
} catch (error) {

res.status(error.response.status).json({ error: error.response.data.error });
}
});
app.get('/rankings', async (req, res) => {
try {
// Forward the request to the user service
const userResponse = await axios.get(userServiceUrl+'/rankings', req.body);
res.json(userResponse.data);
} catch (error) {
res.status(error.response.status).json({ error: error.response.data.error });
}
});
Expand Down
21 changes: 21 additions & 0 deletions gatewayservice/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions gatewayservice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"homepage": "https://github.com/arquisoft/wiq_en1a#readme",
"dependencies": {
"axios": "^1.6.5",
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
"express": "^4.18.2",
"express-prom-bundle": "^7.0.0"
Expand Down
Loading

0 comments on commit 506ecd1

Please sign in to comment.