A simple message board built with Node.js, Express, and EJS. Users can view messages, add new ones through a form, and open individual message pages. This project was created to practice Express routing, form handling, and server-side rendering.
| Technology | Purpose |
|---|---|
| Node.js | JavaScript runtime |
| Express.js 5 | Web framework |
| EJS | Templating engine |
| Neon | Serverless Postgres hosting |
| @neondatabase/serverless | Neon's serverless driver |
| Render / Vercel | Deployment |
- Create Messages - Post new messages with your name
- View Message Details - Click the eye icon to see full message details
- Responsive Design - Fully responsive on all devices
- Serverless Database - Powered by Neon's serverless PostgreSQL
mini-msg-board/
├── app.js # Express application entry point
├── vercel.json # Vercel deployment configuration
├── package.json # Dependencies and scripts
│
├── db/
│ └── pool.js # Neon database connection
│
├── routes/
│ └── index.js # All route handlers (GET /, GET /new, POST /, GET /message/:id)
│
├── views/
│ ├── index.ejs # Main message board page
│ ├── form.ejs # New message form page
│ └── message.ejs # Message detail page
│
├── public/
│ ├── styles.css # All CSS styles
│ ├── favicon.ico # Favicon files
│ └── ... # Other favicon sizes
- Node.js (v18+)
- A Neon PostgreSQL database
-
Clone the repository
git clone https://github.com/roshhi/mini-msg-board.git cd mini-msg-board -
Install dependencies
npm install
-
Set up environment variables
Create a
.envfile in the root directory:DATABASE_URL=postgresql://username:password@your-neon-host/database?sslmode=require
-
Create the database table
Run this SQL in your Neon console:
CREATE TABLE messages ( id SERIAL PRIMARY KEY, user_name VARCHAR(20) NOT NULL, text VARCHAR(200) NOT NULL, added TIMESTAMP DEFAULT NOW() );
-
Start the server
node app.js
-
Open in browser
http://localhost:3000
Through building this project, I learned:
- EJS Templating - Dynamic HTML rendering with embedded JavaScript
- Neon Serverless - Using Neon's serverless driver for edge-compatible database connections
- MVC Architecture - Separating concerns with routes, views, and database logic
Contributions are welcome! Feel free to open an issue or submit a pull request.
This project is open source and available under the MIT License.
- The Odin Project for the curriculum
- Neon for serverless PostgreSQL