ariviv is an application built with Kotlin, Ktor & GraphQL. The data is stored in-memory, without the use of a database.
export TIME_TO_WAIT_BEFORE_CHECKING_IF_REMINDER_TO_EXERCISE_SHOULD_BE_SENT_IN_MS=3000
export REMINDER_TO_EXERCISE_DELAY_IN_MS=3000
./gradlew run
To start the application, simply run the following commands to configure the environment variables and build up the container:
docker-compose up --build
- visit the GraphQL playground endpoint
- create a user with the
registerUser
mutation and fetch its ID from the response - with the ID from the previously created user, send a
markExerciseSessionAsFinished
mutation - take a look at the log printed to the console or to the log file. After 3 seconds (assuming the
.env
file has been sourced, otherwise you will have to wait for the time period defined in the application), a reminder to exercise for the previously created user will be displayed
- a user needs to register first
- every registered user is automatically enrolled in a so called exercise routine (except for the users that were automatically seeded in the application)
- their exercise routine only starts after they have marked their first exercise session as complete
- if they have not marked an exercise routine as complete recently, a reminder to exercise is "sent" to them (in the form of a log message being displayed on the console and written to the disk).
- a request comes in via the GraphQL API
- the application calls the service required to handle the request
- the application service fetches the necessary domain model from a repository, updates it, and send it back to the repository to be "saved"
- finally, one or severals domain events are appended to a list of all current domain events that happened in the past
./gradlew test
Status | Task |
---|---|
✔️ | Automated tests |
✔️ | GraphQL Schema documentation generated with graphdoc available offline here or online here |
✔️ | Containerisation with Docker and docker-compose |
✔️ | Logs written to a file (see logback config) |