Light bulbPostion MVP is now LIVE! Claim Your Founder's Perks & Join Now

Docs
Technical Architecture & Stack

Technical Architecture & Stack

A look under the hood at Postion. Explore our system architecture, modern tech stack, and the core design principles that ensure speed, scale, and security.

1. System Architecture Diagram

Core Flow:

  1. A user accesses a site ([username].postions.app or a custom domain) via the Next.js frontend.
  2. The Cloudflare Edge Network processes the request, providing global CDN acceleration.
  3. API requests are sent to the backend services via Next.js API Routes.
  4. The backend service interacts with the PostgreSQL database using Prisma ORM to fetch content data.
  5. The payment process is handled by the Stripe API, and subscription statuses are synced via Webhooks.
  6. AI-related features (e.g., writing assistant, summary generation) are implemented by calling the OpenAI/Gemini API.
  7. newsletter features (use mailgun to implemented)
  8. workflow features (use n8n to implemented)

2. Technology Stack

  • Frontend: Next.js 15 (React), Tailwind CSS, BuouUI
  • Backend: Next.js API Routes (Serverless Functions), TypeScript
  • Database: PostgreSQL
  • ORM: Prisma
  • Payments: Stripe
  • Domain: Cloudflare
  • AI Services: OpenAI API (GPT-4/GPT-3.5),Gemini API, Vercel AI SDK
  • Deployment/Hosting: Deployment
  • Authentication: NextAuth.js
  • Content Delivery: Cloudflare Edge Network (CDN)
  • Workflow: n8n

[Info] Rationale: We chose a full-stack TypeScript solution centered on Cloudflare and Next.js to achieve maximum development efficiency, outstanding performance (especially for SEO), and seamless serverless scalability—a perfect fit for a content platform's needs.

3. Core Data Schema

  • User: Stores user information and authentication details.
  • Site: Stores configurations for each creator's site (subdomain, custom domain, template, branding, etc.). A User can own multiple Sites.
  • Post: Stores article content, metadata, and publication status. Linked to a Site.
  • Subscription: Stores user subscription relationships, linked to a Stripe Subscription.
  • WebhookEvent: Logs webhook events from external services like Stripe to ensure data consistency.

4. Key Design Principles

  • Multi-tenancy: Content and configurations for different creators are isolated at the database level using a siteId.
  • Performance First: We utilize Incremental Static Regeneration (ISR) and CDN caching to ensure content pages load in milliseconds.
  • Security & Reliability: All payment information is handled by Stripe; we do not store sensitive payment data. We leverage platform-native security features (like Cloudflare's firewall) to prevent common attacks.
  • Scalability: The serverless architecture allows for automatic scaling based on traffic, eliminating the need for server management.