https://github.com/learn-co-curriculum/python-p4-project-template
-
Flask/Python API
-
SQLAlchemy
-
Models
-
4 models
- ? Roles
- ? one to many User Roles (a user can have one role, a role type can have many users)
- ? many to many User Roles (a user can have many roles, a role type can have many users)
- Product
- ? Product Metadata (one to one with Product)
- ? User Products
- ? Review (rating & review info)
- ? Purchase (date purchased, price paid)
- Reviews (many to many between Users & Products)
- User
- Validations & Constraints
- email column
- NOT NULLABLE
- UNIQUE
- REGEX to match email pattern
- phone number column
- NOT NULLABLE
- UNIQUE
- REGEX to match phone number pattern
- email column
- Validations & Constraints
- ? Roles
-
1 many to many relationship
-
1 model has all CRUD actions
- Follows REST routes
- CREATE
- GET /resources/new
- POST /resources/new
- READ
- GET /resources (index or show all)
- GET /resources/<id / name parameter> (get 1)
- GET /resources/ (get some)
- UPDATE
- PATCH /resources
- DELETE
- DELETE /resources
-
User can do at least one or some of all CRUD actions on a resource
-
-
User Auth
- Validations & Constraints here
- email looks email
- phone number looks like phone number for (fake) multi factor auth
- strong password
- 8+ characters
- includes symbol
- includes number
- includes upper case letters
- includes lower case letters
- password and password confirmation match
- bcrypt
- password hashing
- don't store plain text passwords!
- Routes
- GET & POST /sign-up
- upon success
- redirect to /login
- create cookie with email
- or /dashboard
- create session with auth
- redirect to /login
- upon success
- GET & POST /login
- upon success
- create session
- redirect to /dashboard
- upon success
- POST (?GET) /logout
- upon success
- redirect to home page /
- delete auth session
- upon success
- GET & POST /sign-up
- Validations & Constraints here
-
-
React Frontend
-
connect client and server with fetch()
-
3 client-side Routes
- with React Router
- /sign-up
- fetch GET .com/api/v1/sign-up
- fetch POST .com/api/v1/sign-up
- /login
- fetch GET .com/api/v1/login
- fetch POST .com/api/v1/login
- /dashboard
- fetch GET .com/api/v1/dashboard
- /sign-up
- with React Router
-
Components
-
Nav Bar
-
User Auth
-
register form
- [ ] Use Formik library - [ ] email regex & required - [ ] phone number regex & required - [ ] strong password - [ ] Validations on Forms - [ ] matching password confirmation - [ ] use the right input type - [ ] use regex for right data types - [ ] correctly handle error handling - [ ] on individual inputs - [ ] on entire form
-
login form
- email regex & required
- password matches
- Validations on Forms
- Use Formik library
- use the right input type
- use regex for right data types
- correctly handle error handling
- on individual inputs
- on entire form
- Use Formik library
-
-
logged in views
- dashboard
-
-
Validations & Constraints
- Validations on Forms
- Use Formik library
- use the right input type
- check input is right data type (string/number(int))
- string/number FORMAT validation
- maybe use regex or built in matchers
- correctly handle error handling
- on individual inputs
- on entire form
- Use Formik library
- Validations on Forms
-
- implement something new
- ? react bootstrap or MaterialUI component library
- implement useContext or Redux
- fully deploy and host your project
MVP: As a user, I can:
Sign up for an account,
Log in to the site & remain logged in,
Log out,
View a list of all available products and their respective reviews,
Create a review for one specific product,
Modify or delete a review that I left,
Create a new product listing.
Stretch: As a user, I can:
View products
Search products based on their name/category/price
Filter products based on their average rating.