Platform Architecture Overview
Understand Postion's multi-tenant architecture, routing system, and core technical infrastructure. A technical deep-dive for developers and advanced users.
Technical Foundation
Postion is built on a modern, high-performance technology stack designed for scalability, security, and developer experience. This document provides an overview of our platform architecture.
This document is intended for developers, technical users, and those curious about how Postion works under the hood.
Core Technology Stack
Our platform leverages industry-leading technologies:
| Layer | Technology | Purpose |
|---|---|---|
| Framework | Next.js 14 | Full-stack React framework with App Router |
| Language | TypeScript | Type-safe development |
| Database | PostgreSQL + Prisma | Relational data with type-safe ORM |
| Payments | Stripe | Subscriptions & Connect payouts |
| Storage | AWS S3 / R2 | Media file storage |
| Resend + Mailgun | Transactional & marketing emails | |
| AI | Google Gemini | AI-powered writing assistance |
Multi-Tenant Architecture
Postion uses a multi-tenant architecture where each user can create multiple independent sites (publications). This is the foundation of our "User → Site → Content" hierarchy.
How It Works
┌─────────────────────────────────────────────────────┐
│ User Account │
│ (Billing, Profile, Global Settings) │
├─────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Site A │ │ Site B │ │ Site C │ │
│ │ (Tech Blog) │ │ (Portfolio) │ │ (Newsletter)│ │
│ ├─────────────┤ ├─────────────┤ ├─────────────┤ │
│ │ • Posts │ │ • Posts │ │ • Posts │ │
│ │ • Pages │ │ • Pages │ │ • Pages │ │
│ │ • Templates │ │ • Templates │ │ • Templates │ │
│ │ • Subs │ │ • Subs │ │ • Subs │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │
└─────────────────────────────────────────────────────┘
Key Characteristics
🌐 Independent Domains
Each site can have its own subdomain (blog.postion.app) or custom domain (yourblog.com).
👥 Separate Subscribers
Subscriber lists are isolated per site. A user subscribing to Site A is not automatically subscribed to Site B.
💳 Unified Billing
While sites are separate, billing and Stripe Connect settings are managed at the user account level.
🎨 Unique Branding
Each site has its own templates, colors, fonts, and appearance settings.
Routing Architecture
Our middleware-based routing system intelligently handles requests based on the hostname.
Request Flow
flowchart TD
A[Incoming Request] --> B{Check Hostname}
B -->|postion.app| C[Main Platform Routes]
B -->|Other Domain| D[Tenant Site Routes]
C --> E{Path Check}
E -->|/dashboard, /login, /site, /post| F[Authenticated Routes]
E -->|/sso-bridge, /sso-logout| G[SSO Handling]
E -->|Other| H[Rewrite to /home/*]
D --> I[Rewrite to /domain/*]
I --> J[Render Tenant Site]Route Categories
| Category | Paths | Description |
|---|---|---|
| Authenticated | /dashboard, /site/*, /post/* | Require user login |
| SSO | /sso-bridge, /sso-logout | Single sign-on handling |
| Public Platform | /home/*, /blog, /pricing | Marketing & public pages |
| Tenant Sites | *.postion.app, custom domains | User-created publications |
Content Security
We take content protection seriously. Postion includes built-in anti-piracy features to protect your paid content.
Security Features
Watermarking: Dynamic watermarks can be applied to premium content, displaying the viewer's identity.
Copy Protection: Optional copy/paste and right-click protection for sensitive content.
Screenshot Deterrent: Visual indicators that discourage screenshot sharing.
Access Logging: Track who views your content and when.
Note: Content security features are available on Premium plans. They can be enabled per-post or site-wide in your settings.
Database Architecture
Our database is designed around 42+ models organized into logical domains:
Core Domains
| Domain | Key Models | Purpose |
|---|---|---|
| User System | User, Account, Session, UserProfile | Authentication & profiles |
| Site System | Site, Template, TemplatePricing | Multi-tenant publications |
| Content | Post, Page, Tag, Series | Content management |
| Subscriptions | Plan, Subscription, Transaction | Monetization |
Subscribe, EmailCampaign, EmailSend | Marketing automation | |
| CRM | FanRelationship, FanTag, FanSegment | Fan management |
| API | ApiKey, ApiUsage, Webhook | Developer platform |
Data Relationships
erDiagram
USER ||--o{ SITE : owns
SITE ||--o{ POST : contains
SITE ||--o{ PLAN : offers
PLAN ||--o{ SUBSCRIPTION : has
SUBSCRIPTION ||--o{ TRANSACTION : generates
POST ||--o| POST_PRICING : has
POST ||--o{ POST_PURCHASE : has
USER ||--o| STRIPE_ACCOUNT : connectsStripe Integration
Payment processing is handled entirely through Stripe, using two key features:
Stripe Subscriptions
For recurring revenue from your subscribers:
- Monthly and annual billing cycles
- Automatic payment retry
- Subscription management portal
Stripe Connect
For creator payouts:
- Direct deposits to creator bank accounts
- Automatic platform fee deduction (5%)
- Global payout support
- Tax form generation
Learn more about setting up payments in our Stripe Connect Guide.
Storage Infrastructure
Media files are stored using cloud object storage:
- Primary: AWS S3 for reliable, scalable storage
- CDN: Global content delivery for fast load times
- Formats: Support for images, videos, documents, and more
Storage quotas vary by plan. Check our Storage Quotas documentation for details.
Performance & Scalability
Postion is built for performance at scale:
⚡ Edge Runtime
Middleware runs at the edge for minimal latency worldwide.
📦 Smart Caching
Intelligent caching of static content and API responses.
🔄 Auto Scaling
Infrastructure scales automatically with traffic demands.
Need More Technical Details?
- Public API Documentation: Build integrations with our REST API
- Webhooks Guide: Receive real-time event notifications
- Custom Domains: Connect your own domain