Coder Social home page Coder Social logo

detleph / server Goto Github PK

View Code? Open in Web Editor NEW
1.0 0.0 0.0 409 KB

Server component of the Detleph event management system

License: MIT License

TypeScript 96.68% Dockerfile 0.56% Shell 2.75%
api docker event-management event-management-system nodejs web

server's People

Contributors

flexla54 avatar github-actions[bot] avatar stefan-5422 avatar stephan418 avatar

Stargazers

 avatar

server's Issues

Update the prisma schema to reflect the most recent needs

The schema should allow for:

  • Adding roles to disciplines (with a schema describing the result)
  • Storing results in the database
  • Differentiation between campaigns and links (links are assigned to a specific group)
  • Adding leaders to team (The person who receives join requests)
  • Defining an optional description and (maybe) images to
    • Events and
    • Disciplines

Other requirements can and most likely will be added in the future, however, the outlined schema would be a solid baseline for future improvements.

Suggestions welcome

@Stefan-5422 @Flexla54 @michael5031

Server responds with wrong error messages

How the server responds (falsely) at the following requests:

  • GET api/events/"nonexistingPid"
    • 500: Try again later
  • GET api/disciplines/"nonexistingPid"
    • 500: Server code
  • GET api/role-schemas/"nonexistingPid"
    • 500: Server Code
  • GET api/roles/"nonexistingPid"
    • 404: Role not found [OK]
  • GET api/organisations/"nonexistingPid"
    • 500: Server Code
  • GET api/groups/"nonexistingPid"
    • 500: Try again later
  • GET api/teams/"nonexistingPid"
    • 500: Server Code
  • GET api/participants/"nonexistingPid"
    • 404: Endpoint not implemented
  • GET api/media/"nonexistingPid"
    • 404: Endpoint not implemented

The right response should be from the NotFoundError
The requested "Resource-Name" with PID "nonexistingPID" could not be found!

First stable release

TODO:

  • Select all the relevant routes
  • Test all the relevant routes
  • Merge into the dev branch

This release should include all the routes in order to predeploy the app (For a simple website without sign up)

Duplicate code

Due to merging in weird ways, without double checking what is going on. We have duplicate code, please fix

Create informational files for the server repo

The server shoud have information for people who (somehow) happen to find the repo

Furhter info: https://dev.to/github/how-to-create-the-perfect-readme-for-your-open-source-project-1k69

As always, this should stay rather PII-free (so no constributors or production link or anything)

Files:

  • CONTRIBUTING.md (short and simple)
  • README.md (General stuff like installation guidance, description, maybe stack)
    • This should also contain information about Docker and other things that might be a hassle to set up (depending on the machine) -> Especially what email protocols will be used when deploying, ...

Routes are non-standard

teamRouter.patch<"/:pid/participant/", { pid: string }>(

The PID is specified after /teams but represents a participant?
Wouldn't /participants/:pid or /teams/:teamPid/participants/:pid make more sense?

Also: please use participants instead of participant (collections are always plural)

Add update controllers

It is currently not possible to update most of the resources. This is functionality that should be extended (Maybe @Flexla54 for experimenting with express)

Add validation logic for scores

Admins can currently update scores to their liking, but there should be some sort of validation (based on the schema prodivded in the RoleSchema)

Create coherent documentation for common APIs

Using OpenAPI, a usable API documentation should be created for the most important API routes.

The API routes which should be tackled by this task are:

  • Events (CRUD)

  • Everything relating to user sign up

  • Test different strategies for writing the docs

Update

https://www.npmjs.com/package/express-oas-generator seems to fit most of our requirement

Todo:

  • Assess ways thorugh which our authentication strategy (bearer) can be included in the docs (possibly even manually)
  • Define a standard for restructuring the code so that all code paths in all handlers end in a call to next()
    • Idea: Extend the default .send() functionality in order to also call next()

Complete CRUD functions

While testing I saw that some funktions weren't implemented.

Not implemented functions are:

  • DELETE Role Schema
  • UPDATE Role Schema
  • GET Participant
  • GET All Participants
  • GET Participants with parameter
  • UPDATE Participant needs an update (change Teamleader)
  • DELETE Admin

Some of these functions are listed only mandatory.

Tick the box, in case a function is obsolete or done!
This references 5696952 (feature-endpoints)

Format repository

The repository's formatting doesn't conform to the format layed out in the .prettierrc file

Create a usable production build

And merge it into the main branch for deployment

Please make sure that:

  • Everything is working as expected (Docker, FS and so on)
  • Logging code is turned to production mode (With the NODE_ENV variable)
  • #97
  • The default admin is removed from app.ts (!!)
  • The minimum required features are working (Tho CRUD should be working for all of them except if something went terribly wrong)
  • #49
  • There is no confidential information in the build (As the whole code could be made public)
  • Make sure that everything but reads is currently only available to admins
  • Review the authorization code and the media code again (As those are likely the most vulnerable)
  • Add CORS

(The prod server should be able to be deployed with this release tomorrow)

Minium feature requirement for the release (C for Create, R for Read, U for Update, D for Delete):

  • Auth (C)
  • Events (R)
  • Disciplines (R)
  • RoleSchemas (R)
  • Organisation (R)
  • Group (R)

Team registrations are often not relateable

It's hard to interpret registrations as failed or real. I'm convinced that

  • adding a registration time to the table and
  • outsourcing a pending registration to redis (a failed registration, due to eg mail not working, shouldn't be in the postgres db)

would make the life of the registration validators just easier.

I know that it might be a bit late for this, however this site is planned to run for other events too.

Add error handling and logging

After testing and researching some time, I noticed that the current version of the server is quite buggy, especially regarding errors.

For example, the user can currently crash the server simply by sending an ill-formated UUID string. There has also been a case where there was simply no response returned (Which is also sub-optimal)

For these reasons, I think we should focus even more on handling all possible errors and devise tests (with humans at best) to ensure reliable operation (As already discussed during planning)

It might also be a good idea to revise our zero-log policy in a way that we at least store errors that could not be handled (Without any PII so that there aren't as high standards of security to be upheld)

Request for comments: @Stefan-5422 @Flexla54

Which testing environment

We have not set out to use a certain testing environment for this project which one should we use

Add default admin logic

Currenty there is no admin when the system is first deployed (-> No way to set the server up), so the server administrator has to manually add an admin to the database using SQL.

There should be a possibility to gain default credentials for an admin (maybe through a reandomly generated name, pw or through an env variable)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.