We're going to build a twitter clone in Express and Mongo. It won't be stylish, but it will have most of the trimmings of a full app, otherwise.
First we need to setup our overall environment, including installing packages:
- express
- body-parser
- method-override
- ejs
- express-ejs-layouts And creating directories for ejs templates, and the public views.
Next we need to:
-
Add in mongoose, and create a model for the Tweets
-
Setup our routes and pages for Create & Read All:
- GET
tweets/new
should be a form for new tweets - POST
tweets
should create a new tweet - GET
tweets
should show every tweet made
Next up we should allow:
- Deleting a tweet
- Editing a tweet
Lastly we would like to:
- Viewing all tweets by author name
Finally we would like to:
- Use sessions to set an author, and allow the app to use that persistent author rather than asking your name for each new tweet.