Online demo: SSL CoffeeDir | No-SSL CoffeeDir
The problem: I've always wanted to keep a detailed track of the coffees I tried, and started keeping coffee bags in hopes that I'll record them into a nice leather bound journal. So I've just kept all the coffee bags I've bought... but never got to the journal part. Hence, the solution, Coffee Dir. All the coffee, none of the baggage!
Font-end:
Create-react-app, React Router v6, Axios, Sass
Back-end:
NodeJs, JSON Web Tokens (JWT), BCrypt, MongoDB, Mongoose
npm i
cd client && npm i
cd .. && cd server && npm i
PORT=*PORT NUMBER HERE*
DB_CONNECTION=*DB CONNECTION STRING*
Secret for the JWT token generation (takes any string, but I suggest using openssl rand -hex 25
in terminal to generate a quick random key key)
TOKEN_KEY=*SECRET TOKEN*
To run the project locally, write npm run dev
in root directory of the project
/user/register - takes a user object
{
username: "username string",
email: "email string",
password: "password string"
}
/user/login - takes a user object and sends back a JWT token to be added to sessionStorage in the browser to be used for user authentication
{
email: "email string",
password: "password string"
}
/coffee - takes a large object with all the coffee information that includes user id, so the coffee can be tied to the user
{
name: "coffee name",
roaster: "roaster name",
origin: "country of origin",
farm: "coffee farm",
description: "a large string with description",
flavours: ["array of strings"],
price: number,
link: "https url string",
score: number,
user_id: req.params.userId
}
/coffee/:id - takes a large object with all the coffee information and uses request params to identify coffee to update
{
name: "coffee name",
roaster: "roaster name",
origin: "country of origin",
farm: "coffee farm",
description: "a large string with description",
flavours: ["array of strings"],
price: number,
link: "https url string",
score: number,
}
Hope you enjoy my project and collect some amazing brew, if you have any questions you can find me on Twitter and LinkedIn
https://linkedin.com/in/pavelisp
Background image:
Coffee branch vector created by rattanachomphoo - www.freepik.com
Support and guidence (BrainStation Educators and TAs):
Patrick McCullough: https://github.com/pgmccullough
Ernie Hsiung: https://github.com/ErnieAtLYD
Nigel D'Souza: https://github.com/glitcher93
Ben Wanless: https://github.com/BenWanless