Skip to content

FachschaftMathPhysInfo/cards

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cards

Database for Anki Decks with reviewer functionality in the future

dev (todos)

  1. docker compose build
  2. docker compose up -d && docker compose logs -f (frontend: localhost:8081, backend: localhost:8080)
  3. (debugging the frontend: in frontend/ execute flutter run -d web-server --dart-define=API_URL="localhost:8080")

frontend

This app is build upon the framework Flutter. All frontend code is located inside the frontend/lib/ folder and is structured in modules (big, outsourced parts of pages), pages, utils (helper functions) and views (reusable elements). All used constant values, as well as the queries and mutations to communicate to the backend can be found at lib/constants.dart.

backend

The API is a GraphQL instance, which is generated by gqlgen and located in server/. The important files to look at are server/graph/schema.graphqls and server/graph/schema.resolvers.go. Former contains the datastructure to store metadata of deckfiles in a MongoDB database. The latter holds all logic to handle queries and mutations, requested by the frontend. All uploaded deckfiles are stored within deckfiles/ and are automatically named by their sha256 hash like <hash>.<apkg/colpkg>. In production, make sure to secure the login route e.g. via reverse proxy in front of GraphQL. The backend awaits the header X-Username and puts the given string inside the jwt-token.