Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/fachschaftmathphysinfo/cards
- Owner: FachschaftMathPhysInfo
- License: gpl-3.0
- Created: 2024-01-11T13:43:16.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-19T11:04:59.000Z (8 months ago)
- Last Synced: 2024-03-26T21:34:02.335Z (8 months ago)
- Topics: anki, database, fachschaft, flutter, gqlgen, graphql, university
- Language: Dart
- Homepage: https://stapel.mathphys.info
- Size: 26.6 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
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.