(Phase 1)
This Mini Message Board project was developed to strengthen my skills in Express and EJS.
For more details on the project assignment, please visit The Odin Project - Mini Message Board.
(Phase 2)
This phase focuses on refactoring the project to implement a PostgreSQL database using node-postgres (pg) in order to deepen my understanding of working with relational databases in a Node.
For more details on the project assignment, plese visit The Odin Project - Assignment 3.
The project was developed following these main guidelines:
- Install Express and EJS.
- Prepare two routes -
/for index page,/newfor the new message form page. - Add sample
messagesdata in the index route file. - Render the
messagesdata in the index EJS template using iteration. - Create a message form with:
- Heading
- Two input fields: one for the author’s name and one for the message text
- Submit button
- Configure the
/newroute to handle form submissions using router.post() and an HTML POST request. - Set up the application flow for form submission:
- Submit the form
- Decode the form data using express.urlencoded()
- Push the submitted data to the messages array
- Redirect to the index page
- Display the new message on the index page
- Add an Open button next to each message that links to a detailed view of the selected message.
- Persist messages across visits by integrating PostgreSQL using a PaaS database service.
- Create a
messagestable and optionally occupy it with sample data using node-postgres (pg). - Refactor Phase 1 route handlers to interact directly with the PostgreSQL database instead of temporary in-memory data.
- HTML
- CSS
- JavaScript
- Express
- EJS
- Dotenv
- pg
- ESLint
- Prettier