A basic chat app built to demonstrate the full stack π₯ (client, server, database).
With the following features:
- People can send a message
- People can see all the message that have been posted
- π Diagram the Full Stack
- π Differentiate between Client and Server
- β¨οΈ Get user input on the Client
- [*] β‘οΈ Send user input from the client with fetch to the server
- [*] π Store data in a database
- [*] π Retrieve data from a database on the Server
- [*] β¬ οΈ Retrieve data from a server on the client using Fetch
- [*] π Hide/Show elements on the client
- [*] β¨ Add elements to the page on the client
- [] β¨ Page navigation and search
- [] π Deploy the client with now.sh
- [*] π Deploy the database with mlab
- [] π Deploy the server with now.sh
- Create client folder
- Setup index.html
- Bring in Skeleton CSS
- Create Header
- Create form
- Name
- Chat room
- Content
- Log In
- [*] Listen for form submit
- Hide the form
- Show loading spinner
- Get data from form and log it
- β Get user input on the Client
- β Hide/Show elements on the client
- [*] Create server folder
- [*] npm init -y
- [*] npm install express morgan
- [*] Setup index.js
- [*] Add GET / route
- [*] Add POST /messages route
- log out req.body
- [*] fetch POST /messages with form data
- [*] See the CORS error and revel in this moment
- β Send user input from the client with fetch to the server
- [*] npm install cors
- [*] Make sure the server is receiving the data
- [*] Add JSON body parser middleware
- Validate name, content and topic
- [*] Must be a string
- [*] Cannot be empty
- [*] If not valid
- [*] Error code 422
- [*] Invalid messageP, must be logged in, contain name and content
- [*] Setup DB Connection
- [*] npm install monk
- [*] connect to db
- [*] create document collection (messages)
- [*] If Valid
- [*] Create messageP object with
- [*] name, content, created_date
- [*] Insert into DB
- [*] Respond with created mew object
- [*] Create messageP object with
- β Store data in a database
- [*] Log out created messages after POST request
- [*] Show the form
- [*] Hide loading spinner
- [*] GET /messages
- [*] Respond with messages from DB
- β Retrieve data from a database on the Server
- [ *] fetch GET /messages
- [*] Iterate over array
- [*] Append each to page
- [*] Reverse before appending
- [*] Show the form
- [*] Hide loading spinner
- [*] fetch GET /messages after creating a messageP
- β Retrieve data from a server on the client using Fetch
- β Hide/Show elements on the client
- β Add elements to the page on the client
- [*] npm install bad-words
- [*] Use filter before inserting into DB
- [*] npm install express-rate-limit
- [*] Limit to 1 request every 15 seconds
- β
Deploy server with now
- Setup environment variables
- Database connection
- process.env.MONGO_URI
- Database connection
- β Show mlab
- Deploy with environment variable
- now -e MONGO_URI=@evolveUMs-
- Add alias
- Setup environment variables
- β
Deploy client folder with now
- Set API_URL based on hostname
- [] Pagination
- Server
- [] Message endpoints
- [] Skip and limit from query params
- [] Defaults: skip - 0, limit - 7
- [] Include total count in response
- [] Sort messages by date
- Server
- Add comments/replies to a messageP
- User Accounts
- Don't just have the user enter their name
- Sign up/Login
- User Profiles
- Only show messages from a given user
- Search messages
- Hashtags
- User @mentions
- Realtime feed of messages
- Photo by Volodymyr Hryshchenko at https://unsplash.com/photos/V5vqWC9gyEU