A mini message board is built using HTML, CSS, and JavaScript.
A Node.js + Express server renders views with EJS and handles message storage using PostgreSQL.
🔗 A preview is available here
- Post messages with an optional display name
- Input validation using
express-validator
- Automatic moderation via Azure AI Content Safety (free tier)
- Persistent messages storage using a PostgreSQL database
- Timestamps are formatted client-side based on user timezone
- Real-time updates using WebSocket: all connected clients receive message list updates instantly
- WebSocket connection is suspended when the tab is inactive to conserve resources
- Server broadcasts are event-driven and debounced — only triggered on actual DB changes
- Node.js – JavaScript runtime for the server
- Express – Web framework for routing and server logic
- EJS – Embedded JavaScript templating for HTML rendering
- PostgreSQL – Relational database for persistent message storage
- pg – Node.js client for PostgreSQL
- express-validator – Input validation middleware
- express-async-handler – Simplifies async route handlers
- @azure-rest/ai-content-safety – Connects to Azure AI Content Safety API for content moderation
- ws – WebSocket implementation for real-time message broadcasting
- dotenv – Loads environment variables from
.env
files - Vanilla JavaScript / HTML / CSS – Frontend logic and layout
Follow these steps to run the app locally:
-
Clone the repository
git clone git@github.com:frarosset/mini-message-board.git cd mini-message-board
-
Install dependencies
npm install
-
Initialize the database
Initialize a PostgreSQL database and obtain its connection URI
postgresql://your_user:your_password@host:port/your_db
-
Configure environment variables
Create a
.env
file in the root directory (use.env.example
as a reference) -
Start the server
node app.js