Project 3
- Mark Albom
- Mohammad Badruzzaman
- Luke McDonald
Description: MVP for this is an app for
Full user stories & task can be found Here! On the projects tab Phase1
- UserStory: As a user I want to see all the beers on the main site.
- UserStory: As a developer I need to have the frontent connected to the backend
- UserStory: As a user I would like to add beers to list.
- UserStory: As a user I would like to display/edit the beer details.
- UserStory: As a user I would like to display/edit the beer details.
- UserStory: As a user I would like to delete beers off of the list.
- UserStory: As a user I would like the site to look visually appealing
- UserStory: As a product owner I would like my product deployed publicly. MVP Met
Phase2
- UserStory: As a user I would like to save beers as favorite.
- UserStory: As a user I would like to filter by my Favorites
- UserStory: As a user I would like to cycle from one single beer to the next.
- UserStory: As a user I would like to filter beers by Type
- UserStory: As a user I would like to filter by Country
- UserStory: As a user I would like to filter by Seeting.
- UserStory: As a product owner I would like my product deployed publicly. Done
Phase3
- UserStory: As a user I would like to Search for beers from a public API.
- UserStory: As a user I would like to save the public beers as my favorites.
Phase4
- UserStory: As a product owner I would like multiple users to be able to use the site.
- UserStory: As a admin I would like to edit user information.
- UserStory: As a user I would like to edit my user information.
- Heroku docs
- React docs
- React-Router docs
- High order functions tutorials- How to use map, filter, reduce
- Summary Table, Array.agg - PostGres
- Alias syntax - Postgres
-
React
-
Express
- List
- Description
- React-Router
- React-Dom,
- React Switch
- React Component
- React Router code
<Switch>
<Route path="/" exact component={Home} />
{(this.state.beersLoaded)
? <Route path="/BeersList" render={props =>
(<BeersList {...props} beersList={this.state.beersData} />)}
exact beersList={this.state.beerList} />
: <p> Loading... </p> }
<Route path="/BeersList/BeerDetails" render={props => (<BeerDetails {...props}
beer={this.state.beersData} /> )} />
<Route path="/BeersList/BeerEdit" render={props => (<BeerForm {...props} beer={this.state.beersData} /> )} />
<Route path="/" component={NotFound} />
</Switch>
- Code for making our Summary Table
findAllBeers() {
return db.many(`
SELECT DISTINCT x_ref_table.beer_id AS id, beer.name, beer.brewery, array_agg(type.name) AS type, beer.description FROM x_ref_table INNER JOIN type ON type.id = x_ref_table.style_type_id INNER JOIN beer on beer.id = x_ref_table.beer_id GROUP BY x_ref_table.beer_id, beer.name, beer.brewery, beer.description ORDER BY x_ref_table.beer_id;
`);
},
Using array_agg(type.name) AS type merges the duplicate entries and turns them into an array.
- Install files
- Fork
- Clone
- NPM install
-
Create local database
- create database called 'top_shelf'
- run migration file from /Project3/db/migration.sql
- run seed from file /Project3/db/seed.sql
-
Create .env file
DB_HOST=localhost
DB_PORT=5432
DB_NAME=top_shelf
DB_USER=name
-
Setup - Open new terminal window
- CD into project3
- npm run dev
-
Setup - In a second terminal window
- CD into project3
- npm run watch