-
Open up your terminal/command prompt.
-
Navigate to your desktop in your terminal:
cd Desktop
-
Then, navigate to the
Express-Course
directory in your terminal:cd Express-Course
Create an Express application with the Express generator
- This application should be named
L10HandsOn
and should live within yourExpress-Course
directory - Install all needed dependencies
- This application should use Sequelize as its ORM
Create a new MySQL database called bulletinboard
Run migrations to create two new tables: users
and posts
- These tables should have the following structure:
- users:
UserId
: integer, autoincrement, primary key, not nullFirstName
: stringLastName
: stringUsername
: string, uniquePassword
: stringEmail
: string, uniqueAdmin
: boolean, default value is false, not nullcreatedAt
: date, not nullupdatedAt
: date, not null
- posts:
PostId
: integer, autoincrement, primary key, not nullPostTitle
: stringPostBody
: stringUserId
: integer, foreign key to UserId in users tablecreatedAt
: date, not nullupdatedAt
: date, not null
- users:
Update models to reflect the create table migrations
- Don't forget the associations
Users should be able to Signup/Login/Logout
- Use JWT for secure login (hashing and salting passwords)
Users should be able to create, edit, and delete
- Be able to click on a post to update or delete it
- Run a migration to add a
Deleted
column - After the post has been deleted, redirect the user to their profile page
- Run a migration to add a
Users should be able to view their profile page. Their profile page should render the following:
- Their full name
- Their username
- The posts they have written
Admin users should be able to see a list of all users that have not been deleted by the user's first and last name
- Run another migration to add a
Deleted
column - Render a different hbs file for the Admin profile page, which should list all users
- Every Admin should see the same page. Use the route
/users/admin
Admin users should be able to click on a user and view their information, but not edit their information
- Use the route
/users/admin/editUser/:id
Admin users should be able to Delete users and their posts, but not edit them
Add some styling to your application so it is unique to your taste