Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fachschaftmathphysinfo/cards

Database for Anki Decks with reviewer functionality in the future
https://github.com/fachschaftmathphysinfo/cards

anki database fachschaft flutter gqlgen graphql university

Last synced: 4 days ago
JSON representation

Database for Anki Decks with reviewer functionality in the future

Awesome Lists containing this project

README

        

# cards
Database for Anki Decks with reviewer functionality in the future

## dev ([todos](https://github.com/FachschaftMathPhysInfo/cards/issues/1))
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](https://flutter.dev/).
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](https://graphql.org/) instance, which is generated by [gqlgen](https://gqlgen.com/) 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](https://www.mongodb.com/) 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 `.`.
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.