This project is intended to be a playground for a microservice architecture in the domain of a recipe collection.
As part of the exercise, I want to try as many different programming languages, frameworks and methods as possible.
This README is still a work in progress...
Required for running anything:
- Node.js >= 18
- docker or comparable container builder
- docker compose
Run npm run generate-docker-compose
and docker compose up
. The project will be available on http://localhost. Traefik is listening on http://localhost:8080. Apollo GraphQL is available on http://localhost/graphql.
Required for development:
- pnpm (
npm i -g pnpm
) - @devcontainers/cli (
npm i -g @devcontainers/cli@latest
) - VSCode
After project checkout, run pnpm install
. This will generate all necessary files for development (config files for prettier and docker as well as VSCode devcontainers).
The project is organized in a mono repo. All individual projects provide docker images that can be built independently.
Every aspect in the Recipe DB is bundled in a microservice. Traefik is used to glue everything together. All individual backend services are made available to the frontend via Apollo GraphQL. For building all of the projects in the mono repo, Docker is used as a programming language agnostic builder.
Even though the frontend parts have access to a unified GraphQL API, I want to implement the different parts with different solutions.
Parts with limited interaction (frontend
)
For pages that are mostly static, Astro is a perfect implementation solution for speedy serving and caching.
Astro offers plugins for different languages for components, which I want to try all.
As most parts of any Astro page can be pre-rendered and cached and rerendered when the data changes, I plan on adding a cache purging solution from backend to frontend later. (Message Que, Websocket)
Parts with heavy interaction like the pages for adding and editing recipes will be implemented in a different solution.
Recipe Adding and Editing (recipes-edit
)
Implemented in Vaadin via Kotlin. with Gradle build tool and Spring Boot for app startup.
Image Adding and Editing (images-edit
)
Implemented in Elm using elm-graphql for GraphQL integration.
If possible, consistent styling with Tailwind CSS.
The backend is organized in a variety of services where the only one actually necessary is the one holding recipe data. Each service exposes a REST API which is tested with a different integration testing framework.
Recipes (recipes
, recipes-test
)
Implemented using Golang, web framework Gin and Clover as document database.
Still open: versioning of recipe data and rollback of edits.
Integration testing done in Venom.
Ratings (ratings
, ratings-test
)
Implemented in IO with SQLite as relational database.
Integration testing in Karate.
Images (images
)
Image server implemented in Julia using Genie and JuliaImages. Testing is part of the precompile/warm-up process.
Inspiration (inspirations
, inspirations-test
)
Sources of inspiration web links for this recipe. Implemented in Lua using Milua for setting up REST API. Data stored as plain JSON File.
Testing is done using Venom with Tavern Executor
Services with utility character.
Link Extract (link-extract
)
Extracts favicon, title, description and canonical link of URL.
Implemented in Deno using Denorest and AloeDB document database.
Image Inline (image-inline
)
Convert an Image URL to an inlined image. Implemented in Perl using Dancer2 for the REST API setup.
TBA, maybe graph database?
Specific tags for:
- Country
- Vegetarian/Vegan/Pescetarian
- Main/Side/Appetizer/Dessert
graph-like data structure
User can track when he had a certain recipe.
- Variant of
- Side dish
Add recipes to collections (public and private)
(should really be part of recipe data)
- public
- draft
- idea
Probably Google oAuth via traefik.
Maybe with OpenSearch or Quickwit.
- by name
- by rating for user
- recipes containing ingredient/tag
Message queue notify on update -> pre-render and cache page again.
Maybe later.
- VSCode devcontainers for easy setup
- custom precommit
- prettier as formatter for general
- testing with integration test projects
- demo-data project
- https://github.com/brooklynDev/airborne
- https://github.com/martinmaher/jcache-chat-citrus
- https://citrusframework.org/citrus/reference/3.4.0/html/index.html#http-rest
- https://gettaurus.org/
- https://github.com/svanoort/pyresttest
- https://rest-assured.io/
- https://www.baeldung.com/cucumber-rest-api-testing