zpi-2023 / sensobackend Goto Github PK
View Code? Open in Web Editor NEWBackend of the application made for the Team Project course taken in the last semester of BSc studies. Built in ASP.NET. ๐ด๐ฑ
Backend of the application made for the Team Project course taken in the last semester of BSc studies. Built in ASP.NET. ๐ด๐ฑ
We need API versioning to ensure we can later make breaking changes without major problems.
Useful links:
Blocked by:
POST /api/v1/account/profiles/senior
204 No Content
and creates a senior profile if this account doesn't have it already409 Conflict
if this account already has a senior profileGET /api/v1/account/profiles/senior
- used to display QR code as a senior
200 OK
with { "encodedSeniorId": string }
if this account has a senior profile, this response should be encoded the same way as POST /api/v1/account/profiles/caretaker
404 Not Found
if this account doesn't have a senior profilePOST /api/v1/account/profiles/caretaker
- called after scanning a senior's QR code
{ "encodedSeniorId": string, "seniorAlias": string }
- account ID of senior which you want to pair with, encoded with a symmetric algorithm and a secret key204 No Content
and creates the caretaker profile if the encodedSeniorId
matches an existing senior in the DB403 Forbidden
if the encodedSeniorId
is invalidNOTE: GET /api/v1/account/profiles/caretaker
should not exist, since we always pair starting with senior for safety/security reasons
See full medication specification here: https://github.com/zpi-2023/thesis/issues/25
SeniorIdRepo
SeniorIdRepo
testsHasPermission
middlewareDateTime
to DateTimeOffset
for SeniorDataToEncode
Discovered during #20.
The tests using Moq are pretty ugly, don't interplay with FluentAssertions and require a lot of boilerplate. Check if NSubstitute would be any better.
Tests, code formatter, artifacts?
Kind of blocked by https://github.com/zpi-2023/thesis/issues/24, which will decide which tables are up to deletion.
We can use for example: Husky.Net
We should have rule that does not allow to commit to main
and to commit only correctly formatted code by csharpier
GET /api/v1/dashboard/:seniorId
PUT /api/v1/dashboard/:seniorId
Example response (up to consideration):
{
"gadgets": ["games", "medication"]
}
Helpful links:
Tasks:
We need a public deployment of the app to have it actually work. We should probably use Azure or FlyIO.
A lot of things can go wrong with the frontend<->backend communication: server down, configuration issues, invalid auth, etc. We can rule out many of such failure causes using a healthcheck route. It would be a simple endpoint which returns a 200 OK status code if the server is ready and other status codes for failures.
We can then call this endpoint from frontend at the start of an app and display an error in case of failure to easily detect issues with invalid backend setup. Without this, if we for instance get errors on the login screen, we cannot be immediately sure whether it is bug in the app or an issue with connection, hosting, CORS, etc.
Additionally, Dockerfiles support HEALTHCHECK instructions which can help us detect regressions.
GET /api/v1/health
See full medication specification here: https://github.com/zpi-2023/thesis/issues/25
Blocked by:
GET /api/v1/account/profiles
Example response:
{
"profiles": [
{ "type": "caretaker", "seniorId": 2137, "seniorAlias": "John" },
{ "type": "caretaker", "seniorId": 123, "seniorAlias": "Kate" },
{ "type": "senior", "seniorId": 789 }
]
}
type
senior
per account.seniorId
is unique within the list and required on each entry.
type
caretaker
, seniorId
of senior taken care of should be returned and their seniorAlias
set by this caretaker.type
senior
, seniorId
should be this account's ID.Since the ERD diagram is complete, we can add all of the entities as classes to the backend, to make it easier to work on future capabilities.
See full medication specification here: https://github.com/zpi-2023/thesis/issues/25
Preferably via JWT.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.