At Founders and Coders coding bootcamp we are tasked every week with a different project. A MVP is built in 1.5 days by 4 developers that follow the Agile methodology.
Week 5 topic: Database (PostgreSQL)
See week 5 schedule.
A website where the user to search through posts for things that they need or allows a user to post about surplus items they have.
If you have any spare things to give, just FAKM.com!
To install the project:
npm install
to setup package dependenciesnpm run wipedb
to init or reset your production dbnpm test
to run testsnpm start
to startCREATE TABLE users (
id SERIAL PRIMARY KEY,
username VARCHAR(255) NOT NULL,
postcode VARCHAR(8)
);
CREATE TABLE category (
id SERIAL PRIMARY KEY,
category VARCHAR(20)
);
id SERIAL PRIMARY KEY,
title VARCHAR(255) NOT NULL,
time TIMESTAMPTZ,
category INTEGER,
post TEXT NOT NULL,
user_id INTEGER
Users
id | name | postcode |
---|---|---|
INT | TXT | TXT |
Posts | id | user_id | title | post | timestamp | category |
---|---|---|---|---|---|---|
INT | INT | "Spare loo roll" | "10 rolls total, 2 per caller, Call Barry on 0725466765" | 2pm 20/Sep/2020 | 2 |
Categories | id | category |
---|---|---|
1 | "Food" | |
2 | "Toiletries" | |
3 | "Household" | |
4 | "Other" |
:duck:
The object our listings page sends to /getposts whenever search or one of the checkboxes/buttons are clicked, or enter is pressed
{
search: string
food: bool
toiletries: bool
household: bool
other: bool
}
The object /getposts returns to the listings page
{
listing_id: number (the id from the listings table)
name: string
title: string
date: datestamp
postcode: string
body: string
}
/
Title : Text
Mission statement : Image with overlaid text
Offer something : Link to /form
View offers : Link to /listings
/list
Header
Search bar and button
Filter by: Food, Toiletries, Household, Other
Checkboxes styled as toggle buttons.
All greyed by default but acting as if all on
Clicking each ungreys and activates filtering
The list of things on offer
Item X
Date/Time
Username
Title
Postcode
Post
Delete button
/form
Header
Explanation
Title
Category
Food
Toiletries
Household
Other
Username
Postcode
Post
/public /public/home.html /public/form.html /public/listings.html /public/listings.js /public/styles.css .gitignore .env (each need to add our own)
GET / public POST /processform POST /getposts DELETE /delete
insert getlistings Inesert form data
Co-authored-by: Joepock123 joe.m.jackson@live.co.uk Co-authored-by: glrta to.gio@pm.me Co-authored-by: itsina96 itsina96@gmail.com Co-authored-by: Roger-Heathcote github@technicalbloke.com
.gitignore