# Pink Punk

---
# Demo (T)

---
# Planning (T)
- Miro
- Kanban included specific jobs not user stories
- Quite a lot of mobbing
- Mobbed the file structure right at the beginning
- Deployed to heroku at the beginning
---

---

---
# Techy stuff
---
## Schema (I)
```sql
CREATE TABLE users (
id SERIAL PRIMARY KEY,
username VARCHAR(225) NOT NULL
);
CREATE TABLE blog_posts (
id SERIAL PRIMARY KEY,
author_id INTEGER REFERENCES users(id),
post TEXT NOT NULL,
post_date DATE NOT NULL DEFAULT CURRENT_DATE
);
```
---
## Putting date in database (A)
`post_date DATE NOT NULL DEFAULT CURRENT_DATE`
-but parsing from database and actually displaying it was another story
---
## Complications from schema (V)
Adding author to author table, then getting their id and adding it to posts table with post
```JavaScript
function newPost(message) {
return db
.query("INSERT INTO users(username) VALUES($1)", [message.username])
.then(() => {
return db
.query(`SELECT id FROM users where username=($1)`, [message.username])
.then(item => {
return item.rows.map(obj => obj.id);
})
.then(idArr => {
return db.query(
"INSERT INTO blog_posts(author_id, post) VALUES($1, $2)",
[idArr[0], message.post_text]
);
});
});
}
```
*Not the best way to do this
---
## Heroku set up (A)

`const db = new pg.Pool({connectionString: process.env.DATABASE_URL})`
---
## Delete function + Async problems (I)
- Challenge of trying to match up client side request/response to serverside handling so that the server sends DELETE response at right time and the client reloads the page after that

---
# Group stuff

---
## Group dynamics
- Generally we were effective as a team
- Sometimes we got lost in ruminations/went down rabbit holes/lost sight of the deadline - (Vatsal loved this)
---
## What we did well
- moderate mobbing
- planning
- early deployment and database set-up
- work as a team
---
## What we did really really well
- No Unit testing
- No server testing
- No database testing
- Have an awesome brand name
- AND IT WORKS (kind of)
-
---
# What we learnt?
- Good things
- Things take time (more than 10 mins)
---
# Great communication
lol
yo!
I had to restart
are we going for lunch ?
I think we're done right?
Yeah
yeah
let's go man
See you al laters
kk
---
{"metaMigratedAt":"2023-06-15T06:03:56.725Z","metaMigratedFrom":"Content","title":"Pink Punk","breaks":true,"contributors":"[{\"id\":\"15813e8a-4a82-4c1f-a14a-8d0c01639173\",\"add\":977,\"del\":450},{\"id\":\"89613c1e-a1b5-4e82-9c3e-7813a336c5a6\",\"add\":429,\"del\":0},{\"id\":\"ae8469a7-16c2-4aaa-9ad3-48227eb54cd9\",\"add\":1552,\"del\":319},{\"id\":\"3c970cbc-e792-4aab-bd26-9f18c46b45b6\",\"add\":708,\"del\":36}]"}