Complete API reference and guides for the MOBIUS Wiki backend.
- New to the API? Start with Getting Started
- Understanding Permissions? Read ACL System Guide ⭐
- Need API Reference? See individual endpoint docs below
- Want Examples? Check Complete Workflows
MOBIUS Wiki is a collaborative documentation platform and secure content delivery system for the MOBIUS Library Consortium. It features:
- Flexible Access Control - 5 rule types with inheritance
- Full-Text Search - PostgreSQL FTS with ACL filtering
- Version History - Complete audit trail for every page
- File Management - Upload and link files to content
- Analytics - Track page views and popular content
- Session-Based Auth - Secure, instant permission revocation
- Getting Started
- Prerequisites and installation
- Environment configuration
- Database setup
- Running the server
- Test accounts
-
- Session-based authentication
- Login/logout endpoints
- Session management
- Security features
-
ACL System ⭐ START HERE FOR PERMISSIONS
- What is ACL?
- The 5 rule types (public, role, library, user, link)
- Inheritance logic explained
- File access ("most restrictive wins")
- Role hierarchy
- Link sharing with tokens
- Quick reference tables
- Testing your ACL rules
-
- Wikis API (6 endpoints)
- Sections API (5 endpoints)
- Pages API (8 endpoints)
- CRUD operations
- Soft delete behavior
- Slug generation
-
- How versioning works
- Version history API
- Retrieving specific versions
- Full-snapshot storage
-
- File upload (multipart/form-data)
- File download
- Polymorphic linking (wikis/sections/pages/users)
- File access control
- Storage locations
-
- Full-text search API
- Query parameters
- ACL filtering
- Relevance ranking
- Metadata enrichment
- Link-shared content exclusion
-
- Automatic page view tracking
- Page statistics
- Popular pages
- Platform statistics
- Time-based filtering
- Daily aggregations
-
- HTTP status codes
- Error response format
- Common error scenarios
- Debugging tips
-
- End-to-end workflows
- Creating a full wiki
- File attachment workflow
- Private content + link sharing
- Analytics dashboard
- Full lifecycle example
- Framework: NestJS 10.x with TypeScript
- Database: PostgreSQL 15+ with raw SQL (pg library)
- Sessions: PostgreSQL storage (connect-pg-simple)
- File Upload: Multer
- Validation: class-validator
- Password: bcrypt (12 rounds)
- API Prefix:
/api/v1 - Port: 10000 (default)
- Authentication: 3 endpoints
- Wikis: 6 endpoints
- Sections: 5 endpoints
- Pages: 8 endpoints
- Files: 8 endpoints
- Access Rules: 4 endpoints
- Search: 1 endpoint
- Analytics: 4 endpoints
- Health: 1 endpoint
Total: 50+ endpoints
http://localhost:10000/api/v1
Most write operations require authentication:
- Session-based (not JWT)
- Cookies automatically included in browser requests
- Use
-b cookies.txtin curl commands
Success (Single Resource):
{"data": {...}}Success (Collection):
{"data": [...], "meta": {"total": 42}}Error:
{"statusCode": 404, "message": "...", "error": "Not Found"}cd mobius-wiki/backend
npm install
npm run db:setup
npm run start:devcurl -c cookies.txt -X POST http://localhost:10000/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "admin@mobius.org", "password": "admin123"}'# Create wiki
curl -b cookies.txt -X POST http://localhost:10000/api/v1/wikis \
-H "Content-Type: application/json" \
-d '{"title": "My Wiki"}'
# Make it public
curl -b cookies.txt -X POST http://localhost:10000/api/v1/wikis/31/access-rules \
-H "Content-Type: application/json" \
-d '{"ruleType": "public"}'curl "http://localhost:10000/api/v1/search?q=welcome" | jqcurl http://localhost:10000/api/v1/analytics/stats | jqGoal: Build Angular/React app that consumes this API
Start with:
- Authentication - Login flow
- Content Management - Display wikis/pages
- Search - Search functionality
Goal: Programmatic access for scripts/integrations
Start with:
- Authentication - Get session cookie
- Examples - Copy-paste workflows
Goal: Configure who can see what
Read: ACL System Guide - Complete permission system explained
Q: Is this a REST API? A: Yes, follows REST principles with standard HTTP methods (GET, POST, PATCH, DELETE).
Q: Does it use JWT tokens? A: No, uses session-based authentication with PostgreSQL storage for instant revocation.
Q: Can I use this with any frontend? A: Yes, it's framework-agnostic. CORS is configured for frontend on port 4200.
Q: Is there rate limiting? A: Not yet implemented (future enhancement for auth endpoints).
Q: Where are files stored?
A: Locally in backend/uploads/ directory (can migrate to S3/CDN for production).
Q: How does search work? A: PostgreSQL Full-Text Search with tsvector + GIN index, filtered by ACL.
Q: Can I see analytics for private pages? A: Yes, analytics endpoints are public (only track views, don't expose content).
Q: How do I contribute? A: See project CLAUDE.md for development guidelines and standards.
Issues: Report bugs at
Questions:
Documentation Updates: Submit PRs to improve these docs
After reading this documentation:
- Setup - Follow Getting Started
- Understand ACL - Read ACL Guide
- Try Examples - Run workflows from Examples
- Build UI - Create frontend app using this API
- Deploy - Setup production environment
Last Updated: December 19, 2025 API Version: v1 Backend Version: 1.0.0
- Getting Started - Setup and configuration
- Authentication - Session management
- ACL System - Access control explained ⭐
- Content Management - Wikis, sections, pages
- Page Versioning - Version history
- File Management - Upload and linking
- Search - Full-text search
- Analytics - Page views and stats
- Error Handling - Status codes and errors
- Examples - Complete workflows