This repository is code for the Unit 6 Review for the DevMountain Web Development program.
It involves reviewing concepts from units 5 and 6, including routing usingreact-router-dom
, connecting to a database usingmassive
, handling user sessions usingexpress-session
, hashing passwords usingbcryptjs
, and state management usingredux
/react-redux
.
git fork
andgit clone
npm i
- Build component tree/server file structure - it should mostly be done for you
- Make a schema: what each table holds and how they relate to each other
- Create the tables in SQLTabs
- Create SQL files and write queries for all of them
- Add
.env
in your.gitignore
- Add
CONNECTION_STRING
in your.env
file
- Add
SERVER_PORT
andSESSION_SECRET
in your.env
. - Build out
index.js
:- Import packages.
- Import controllers.
- Top-level middleware.
- Auth endpoints.
- Post endpoints.
- Build out all the corresponding functions in
authController
- Test with Postman.
- Build out
routes.js
Landing.js
,Register.js
,Dashboard.js
,Profile.js
routes.import routes from './routes'
inApp.js
- Build ternary to toggle between
Header.js
andAuthHeader.js
depending on route - Bring in
withRouter
and explain its use (bothHeader.js
andAuthHeader.js
don't getprops.match
,props.location
, orprops.history
without it) - Build out
Landing.js
- Build out
Register.js
- Build out
getUser
andlogout
inreducer.js
- Bring
getUser
intoLanding.js
andRegister.js
- Bring
logout
intoProfile.js
- Add functionality to
Dashboard.js
:- Build out handler functions to hit 'post' endpoints.
- Add functionality to
controller.js
andindex.js
- Build out the endpoints and corresponding functions
- Test with Postman or on the front end