https://github.com/mickeymarse/tarmarapi
An API for the classic Tarot de Marseille built with Bun.
https://github.com/mickeymarse/tarmarapi
api api-rest bun drizzle-orm elysia tarot turso
Last synced: 5 months ago
JSON representation
An API for the classic Tarot de Marseille built with Bun.
- Host: GitHub
- URL: https://github.com/mickeymarse/tarmarapi
- Owner: mickeymarse
- License: agpl-3.0
- Created: 2024-04-02T09:21:20.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-07T21:57:58.000Z (over 1 year ago)
- Last Synced: 2025-06-26T09:47:13.172Z (7 months ago)
- Topics: api, api-rest, bun, drizzle-orm, elysia, tarot, turso
- Language: TypeScript
- Homepage: https://tarmarapi.fly.dev/
- Size: 152 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TarMarAPI
## What is TarMarAPI
TarMarAPI stands for _**Tar**ot de **Mar**seille **API**_.
It is a simple API to fetch essential data on the classic [Marseille cards](https://en.wikipedia.org/wiki/Tarot_of_Marseilles), and old deck/pattern that precedes the more common and known Rider-Waite Smith.
Although I partially moved away from it, I'm still very fond of it. I connect more deeply with any version of it than I've ever done with any RWS. But, like anything else, is a matter of choice, and I'm just offering one.
## Why making TarMarAPI
Although there are some very good tarot API ou there (which also inspired mine), none of them is dedicated to the Marseille deck. Moreover, most of them serve the card data following a way of seeing the card itself that doesn't align with my preference/style.
One thing, for example, is the reversed card meaning. I don't believe in that. I think every card has _x_ meanings within it independently from how they are picked from the deck. Then, it's up to the reader and the querent to weave a story based on the spread they're using. That's also linked to the fact that I don't believe in _negative meanings_ per se, but this will be the argument of a blog post perhaps.
## Onto the tech side
I've built this app using the new JS runtime [Bun](https://bun.sh/) together with the [ElysiaJS](https://elysiajs.com/) framework. The data rest in a [Turso](https://turso.tech/) edge SQLite database and requests are dealth with the help of [Drizzle ORM](https://orm.drizzle.team/). The app is deployed using [Fly](https://fly.io/).
Why using tech that is barely production ready?
~~Because they all have cute mascots.~~
Because they are all new, powerful and promising technology that pushed me to learn more about JS/TS while also having fun with them. Also, despite everything, they're delivering.
## Card sample
Example of data fetched from the API:
```json
[
{
"name": "Nine of Pentacles",
"type": "minor arcana",
"rank": "9",
"suit": "pentacles",
"element": "earth",
"planet": "venus",
"sign": ["virgo"],
"meaning": ["luxury, self-sufficiency, independence"]
}
]
```
## Usage
There are only two routes available so far and the data/cards will need some updates and reworking, but with some extra work, it can already be used for simple readings. I aim to update soon in order to avoid the needed extra work for the user.
### `GET /tarots/all` [[try]](https://tarmarapi.fly.dev/tarots/all)
Fetch all the cards in the deck/db.
### `GET /tarots/random` [[try]](https://tarmarapi.fly.dev/tarots/random)
Fetch one random card from the deck.
## Build
You can copy this repo locally and then run `bun install`.
After that, you can follow the steps listed in [this tutorial](https://orm.drizzle.team/learn/tutorials/drizzle-with-turso) in order to setup your Turso db and Drizzle commands. They both use very useful and easy-to-use CLI.
Finally, run `bun run dev` and you're good to go!
## Roadmap
- More `GET` requests.
- Improve and expand cards dataset.
- Improve README and HTML landing page.
- ...