An app for food and drinks recommendations around Finsbury Park!
As a user I want to be able to:
- View existing recommendations for restaurants/cafes/pubs in the area
- Add my own recommendation for a restaurant/cafe/pub in the area
- Review/comment on existing recommendations
clone this repo
npm i
npm test to see tests if you're into that (this might not work actually because of authentication)
npm start to run server
open localhost:5000
party 👽
- How to reference primary keys and foreign keys
USERS TABLE
id SERIAL PRIMARY KEY
POSTS TABLE
user_id INTEGER REFERENCES users(id)
- When you CREATE DATABASE - it will automatically turn any upper case chars into lower case!!! So you may need to go and change that in your config.env and other places
- SQL files are grey in Github!
1.With our real database and our test database, we needed to know how to switch between the two:
"test": "node src/test/test_server.js | tap-spec && NODE_ENV=test node src/test/test_db.js | tap-spec",
An environment variable!
-
How to add a new column to table. Amended the build.js file
-
You can't export your dbBuilder function if it has this:
// console.log("connection closed");
// });
we think??
-
Usability: Should redirect back to homepage after submitting form.
How we fixed:
res.writeHead(302, { Location: "http://localhost:5000" }); res.end();
-
Security vulnerability: script injections!
How we fixed (maybe?):
<input pattern="^[^<>]+$"......./>
-
Would be nice to display the review of the restaurant to the user?
How we fixed: Just handled that data. Did the same for image url!
-
Make a call to the Google Maps API when user selects a recommendation and show on map
-
Click and be taken to website/Directly make booking to the specific restaurant/cafe/pub
-
Link SQL tables - use the posts table in order to link between unique restaurants and unique users
-
This would give us loads of amazing functionality - like filtering recommendations by user, or recognising users that already exist or places that have already been submitted, and not creating duplicates in our tables...