A simple message board built with Express, EJS, and PostgreSQL where users can post short messages.
- Add new messages via a simple form
- View messages on the home page
- Persistent storage with PostgreSQL (no data loss on server restart)
- Express routing with EJS templates
- Node.js & Express for the backend
- express-validator for server side validation
- EJS for server-side templates
- Lucide Icons for inline SVG icons
- dotenv for loading environment variables
- PostgreSQL for data storage
- node-postgres PostgreSQL client for Node.js
This project uses PostgreSQL for message storage.
-
Create a new database (e.g.
mini_message_board):CREATE DATABASE mini_message_board;
-
Add your PostgreSQL credentials to a
.envfile in the project root:PGUSER=your_username PGPASSWORD=your_password PGHOST=localhost PGPORT=5432 PGDATABASE="mini_message_board"
A helper script db/seedDB.js is included to create the table and insert initial data.
Run it with your Postgres connection string as the argument:
node db/seedDB.js "postgresql://user:password@localhost:5432/mini_message_board"-
Install dependencies:
npm install
-
Start the app:
npm run start
-
Open http://localhost:3000 in your browser.
Icons used in this project are sourced from Lucide Icons and embedded as raw SVG for and customization.
This project is licensed under the MIT License.