Database for Anki Decks with reviewer functionality in the future
dev (todos)
docker compose build
docker compose up -d && docker compose logs -f
(frontend:localhost:8081
, backend:localhost:8080
)- (debugging the frontend: in
frontend/
executeflutter run -d web-server --dart-define=API_URL="localhost:8080"
)
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
.
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.