# DENK Tarot
*"It's going to be so easy once it's all done."*
Georgia (12:47 on Wednesday)
*"Have you ever used Google?"*
*Christine (10:34 on Friday)
---
## Goals
---
### MVP
* Get functionality / database interaction
* Focus on backend express and what we have recently learned
* Second focus on getting more familiar with SVG's
---
## Stretch Goals
* Two way conversation with Database
* Travis CI
---
## Lady Denk the Tarot Reader

---
## User Journey
User visits a page and chooses his ~~fate~~ card, clicking on it.
User is then transferred to a tarot reading side and can see the card and the description.
---

---
## Tech Stack used
- Express.js - server
- Handlebars - template engine ๐ดโ
- Postgres - database
- Tape, Supertest - testing ๐งช
- GitHub Project, Wiki
---
### How to use Whimsical to create flows
---

---
### That svg's are haaarrd
...& figma is life
---

---
### How to wireframe
---

---
### How to use Github Project

---
### How to use GitHub Wiki
https://github.com/fac-17/DENK/wiki
---
## Snippets & Things we discovered
---
### Get Random Colour
```javascript=
const getRandomColor = () => {
return "rgb(" + [0, 0, 0].map(getRandomByte).join(",") + ")";
}
const getRandomByte = () => {
return Math.floor(Math.random() * 256)
}
```
---
### Output raw HTML on Handlebars with {{{}}}
Aka the Triple-Mustache-Trick, to output SVGs as HTML code to the layouts.
```html=
<section class="card-container">
{{{tarot.tarot_image}}}
<p class="tarot-description">{{tarot.tarot_description}}</p>
</section>
```
---
### Use TEXT in Postgres for unlimited chars
Works like VARCHAR but without limiting length.
```sql=
tarot_heading VARCHAR(50) NOT NULL UNIQUE,
tarot_description TEXT NOT NULL UNIQUE,
```
---
### Get random card from the Database
```js=
const getRandomCard = () => {
return connection.query
("select * from tarot_cards ORDER BY RANDOM() limit 1")
}
```
---
---
{"metaMigratedAt":"2023-06-14T23:32:26.540Z","metaMigratedFrom":"Content","title":"DENK Tarot","breaks":true,"contributors":"[{\"id\":\"f4dbbfdb-23d9-45e5-b500-a9d1c32a9ce4\",\"add\":1573,\"del\":1868},{\"id\":\"c49e8a40-eed9-405a-9829-9349b5de5d8b\",\"add\":14245,\"del\":13319},{\"id\":\"f64c50bb-53de-417a-8ba0-d7f2afdf9ad9\",\"add\":1315,\"del\":9},{\"id\":\"cf144ea1-4066-44bc-bd51-00eb01874280\",\"add\":328,\"del\":1}]"}