No description
- JavaScript 47.5%
- EJS 26.8%
- CSS 25.7%
|
|
||
|---|---|---|
| assets | ||
| config | ||
| db | ||
| middleware | ||
| models | ||
| public | ||
| routes | ||
| views | ||
| .env.example | ||
| .gitignore | ||
| fix-admin-password.js | ||
| generate-hash.js | ||
| innoit-blog.service | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
| reset-password.js | ||
| server.js | ||
| styleguide.md | ||
InnoIT. Blog & CMS
A custom blog platform with a built-in CMS, built with Node.js, Express, PostgreSQL, and EJS.
Features
- Public blog — home page, blog listing with pagination, individual post pages, about page
- Custom CMS — full admin panel with dashboard, post editor, category and user management
- Markdown editor — write posts in Markdown with toolbar and live preview
- Image uploads — upload images inline or as featured images
- Categories & tags — organise posts by topic
- Draft/publish workflow — save drafts and publish when ready
- Multi-author support — admin and author roles
- Session-based auth — secure email/password login
- Responsive design — works on all screen sizes
- Style guide compliant — Darker Grotesque font, #fff / #000 / #ff4136 colour scheme
Requirements
- Node.js 18+
- PostgreSQL 14+
Setup
1. Install dependencies
npm install
2. Create the database
CREATE DATABASE innoit_blog;
CREATE USER innoit WITH PASSWORD 'password';
GRANT ALL PRIVILEGES ON DATABASE innoit_blog TO innoit;
3. Configure environment
cp .env.example .env
# Edit .env with your database credentials and session secret
4. Run migrations and seed data
npm run setup
This creates all database tables and adds:
- An admin user (
admin@innoit.dev/changeme123) - Sample categories, tags, and a welcome post
5. Start the server
# Development (with auto-reload)
npm run dev
# Production
npm start
The site will be running at http://localhost:3000.
Admin Panel
Access the admin panel at /admin. Log in at /auth/login.
| Feature | Path |
|---|---|
| Dashboard | /admin |
| Manage posts | /admin/posts |
| New post | /admin/posts/new |
| Categories | /admin/categories (admin only) |
| Users | /admin/users (admin only) |
Roles
| Role | Permissions |
|---|---|
| Admin | Full access — manage all posts, categories, tags, and users |
| Author | Create and manage own posts only |
Project Structure
├── server.js # Express app entry point
├── config/
│ └── database.js # PostgreSQL connection pool
├── db/
│ ├── migrate.js # Database migrations
│ └── seed.js # Seed data
├── middleware/
│ ├── auth.js # Authentication guards
│ └── upload.js # Multer image upload config
├── models/
│ ├── User.js # User model
│ ├── Post.js # Post model
│ ├── Category.js # Category model
│ └── Tag.js # Tag model
├── routes/
│ ├── public.js # Home, About pages
│ ├── blog.js # Blog listing & post pages
│ ├── auth.js # Login / Logout
│ ├── admin.js # CMS admin panel
│ └── api.js # API (image upload)
├── views/ # EJS templates
│ ├── partials/ # Header, footer, admin layout
│ ├── blog/ # Blog views
│ ├── admin/ # Admin panel views
│ ├── auth/ # Login page
│ └── errors/ # 404, 500
├── public/
│ ├── css/ # Stylesheets
│ ├── js/ # Client-side JavaScript
│ └── uploads/ # Uploaded images
└── assets/ # InnoIT. logos
Deployment
For VPS deployment:
- Install Node.js and PostgreSQL on your server
- Clone the repo and run
npm install --production - Set
NODE_ENV=productionand a strongSESSION_SECRETin.env - Run
npm run setupto initialise the database - Use a process manager like PM2:
pm2 start server.js --name innoit-blog - Set up Nginx as a reverse proxy for port 3000
- Configure SSL with Let's Encrypt / Certbot
Changing the Admin Password
After first login, change the default password. You can also update it directly:
node -e "
require('dotenv').config();
const User = require('./models/User');
User.updatePassword(1, 'your-new-secure-password').then(() => {
console.log('Password updated');
process.exit();
});
"
License
UNLICENSED — InnoIT.