InkForge is a fullstack publishing & blogging platform engineered for technical writers, software architects, and developer communities. Featuring automated LLM-powered content moderation, dual-mode feed pagination, instant admin publishing, and glassmorphic light design system.
- Dual-Token System: Short-lived Access Tokens (15-minute expiry) paired with HttpOnly,
SameSite=StrictRefresh Tokens (7-day expiry). - Automated Refresh Queue: Client-side Axios interceptors automatically capture
401 Unauthorizedresponses and silently refresh access tokens without disrupting user flow. - Stateful Revocation: Database-backed
refresh_tokenstable enables token family rotation, multi-device tracking, and instant security revocation.
- Asynchronous Processing: Non-blocking
setImmediateexecution inspects submitted articles out-of-band via OpenRouter (meta-llama/llama-3.3-70b-instruct). - Structured JSON Moderation: AI evaluates posts for code safety, offensive language, spam, and technical relevance, returning structured JSON flags (
severity,issues,suggestedContent). - Automated Routing: Safe posts transition to
published, while flagged posts route toneeds_reviewfor human admin inspection.
- Role-Based Access Control (RBAC): Secure
/adminroute guard protecting privileged platform operations. - Moderation Inspector Modal: Interactive side-by-side diff modal comparing original post content against AI-suggested modifications.
- Admin Direct Publish: Admins bypass moderation queues using an Instant Publish action for immediate article distribution.
- Home Feed (
/): Cursor-based infinite scrolling feed optimized for real-time content discovery. - Explore Search (
/explore): Offset-paginated full-text search grid supporting query filters, tag browsing, and jump-to-page navigation (< 1 2 3 4 5 >).
- Secure Signatures: Server generates short-lived SHA-256 HMAC upload signatures (
/api/v1/upload/signature), allowing client browsers to upload images directly to Cloudinary CDN. - Progress Tracking: Drag-and-drop file upload UI with real-time percentage upload progress bars and instant preview thumbnails.
- Nested Comment Trees: Self-referencing PostgreSQL relation (
parentCommentId) supporting multi-level nested discussion threads. - Saved Posts Gallery: Instant bookmarking functionality with dedicated personal gallery view (
/saved).
- Design System: Curated color palette featuring Plus Jakarta Sans headlines, Inter body typography, Slate-50 background canvas (
#f8fafc), and indigo accent primary tokens. - Micro-Interactions: Glassmorphic white cards (
.glass-card), soft borders, smooth hover animations, and toast notification alerts.
InkForge utilizes Neon PostgreSQL managed via Drizzle ORM with 6 relational tables:
users: UUID Primary Key, email (unique, indexed), bcrypt password hash, role (user,admin), status (active,suspended,banned), avatar URL, bio.posts: UUID Primary Key, FK ->users.id, title, content, slug (unique, indexed), status (draft,pending,needs_review,approved,rejected,published),aiFlags(JSONB),aiSuggestedContent,publishedAt.comments: UUID Primary Key, FK ->posts.id, FK ->users.id, content,parentCommentId(Self-referencing FK for nested threads), status (visible,flagged,deleted).saved_posts: Composite PK (userId,postId), savedAt timestamp.refresh_tokens: UUID Primary Key, FK ->users.id, tokenHash, expiresAt, revoked status, deviceInfo.notifications: UUID Primary Key, FK ->users.id, type, message, isRead.
- Runtime Engine: Node.js ES Modules (v22+)
- Web Framework: Express v5 (
express) - Database & ORM: PostgreSQL (Neon Serverless) + Drizzle ORM (
drizzle-orm,drizzle-kit) - Security & Auth: JWT (
jsonwebtoken), Bcrypt (bcryptjs), Helmet (helmet), Rate Limiting (express-rate-limit), CORS (cors) - Validation: Envalid (
envalid), Zod (zod) - Media & Email: Cloudinary SDK (
cloudinary), Nodemailer (nodemailer)
- Framework & Compiler: React 19 + Vite (
@vitejs/plugin-react) - Styling: Tailwind CSS v4 (
@tailwindcss/vite) + Lucide React Icons (lucide-react) - Routing & HTTP: React Router v7 (
react-router-dom), Axios (axios)
- Node.js v20+ installed
- Neon PostgreSQL connection string (or local PostgreSQL database)
- Cloudinary Account & API credentials (optional for image uploads)
- OpenRouter API Key (optional for AI moderation)
git clone https://github.com/SgAtjiit/InkForge.git
cd InkForgecd backend
npm installCreate a .env file in backend/:
PORT=5000
NODE_ENV=development
CORS_ORIGIN=http://localhost:5173
# Database Connection (Neon PostgreSQL)
DB_URL=postgresql://neondb_owner:your_password@ep-example.us-east-2.aws.neon.tech/neondb?sslmode=verify-full
# Default Admin Credentials
ADMIN_EMAIL=admin@inkforge.dev
ADMIN_PASSWORD=AdminPass123
# JWT Authentication Secrets
JWT_ACCESS_SECRET=your_jwt_access_secret_min_32_chars
JWT_ACCESS_EXPIRY=15m
JWT_REFRESH_SECRET=your_jwt_refresh_secret_min_32_chars
JWT_REFRESH_EXPIRY=7d
# Cloudinary Credentials
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
# OpenRouter AI Moderation
OPENROUTER_API_KEY=sk-or-v1-your_openrouter_api_key
OPENROUTER_MODEL=meta-llama/llama-3.3-70b-instructRun database schema setup and seed 50 technical articles:
npm run db:seed
npm run devIn a new terminal window:
cd frontend
npm installCreate a .env file in frontend/:
VITE_API_URL=http://localhost:5000/api/v1Start the Vite development server:
npm run devOpen http://localhost:5173 in your browser.
| Domain | Method | Endpoint | Description | Auth Required |
|---|---|---|---|---|
| Auth | POST |
/api/v1/auth/signup |
Register new user account | β No |
| Auth | POST |
/api/v1/auth/login |
Authenticate user & receive HttpOnly cookies | β No |
| Auth | POST |
/api/v1/auth/refresh |
Rotate access & refresh tokens | π Cookie |
| Auth | POST |
/api/v1/auth/logout |
Revoke refresh token & clear cookies | π Yes |
| Posts | GET |
/api/v1/posts/feed |
Cursor-based infinite scroll feed | β No |
| Posts | GET |
/api/v1/posts/explore |
Offset-paginated search grid | β No |
| Posts | GET |
/api/v1/posts/:slug |
Get single post details by slug | β No |
| Posts | POST |
/api/v1/posts |
Create new post (triggers AI moderation) | π Yes |
| Upload | GET |
/api/v1/upload/signature |
Generate signed Cloudinary upload signature | π Yes |
| Comments | POST |
/api/v1/comments |
Add comment or reply to thread | π Yes |
| Saved | POST |
/api/v1/saved-posts/:postId |
Toggle post bookmark | π Yes |
| Admin | GET |
/api/v1/admin/pending |
List posts pending AI/Admin moderation | π Admin |
| Admin | PATCH |
/api/v1/admin/posts/:id/decide |
Approve or reject post content | π Admin |
Distributed under the ISC License. See LICENSE for more information.