Skip to content
James Foss, jamesfoss.me home
P.02Private system· Internal tool

LWS Dashboard

A centralized application for managing websites, business workflows, content automation, and connected services.

Category
Operations platform
Status
Private system
Core stack
Next.js · React · TypeScript · JavaScript · Tailwind CSS
Fig. 02 — Illustrative cover artwork, not a product screenshot
01

Overview

LWS Dashboard is the private operations console behind Linear Web Solutions. It brings the agency's recurring work into one authenticated application: publishing content, generating and managing leads, tracking clients, invoicing, and storing business documents.

It is also where automation lives. Scheduled jobs and dedicated background workers generate and publish content across connected platforms, and an agent and workflow layer manages AI-driven tasks.

  • 01JWT sessions with rotating refresh tokens, CSRF protection, and rate-limited login
  • 02Publishing integrations for Facebook, Instagram, YouTube, and Google Business Profile
  • 03Google Places lead generation with deduplication, filters, and CSV export
  • 04Invoicing with PDF generation, client records, and document storage
02

Objective

Run the agency's operations, from content to invoicing, from one self-hosted application under the agency's own control.

03

Technical approach

  1. A.

    Security first

    JWT authentication in HTTP-only cookies with rotating refresh tokens, double-submit CSRF tokens on every write route, Zod validation, rate limiting, Cloudflare Turnstile, and admin-managed roles.

  2. B.

    Integrations as modules

    Facebook, Instagram, YouTube, and Google Business Profile publishing, Google Places lead search, and language model providers each sit behind their own service module.

  3. C.

    Background work, out of band

    A scheduler bootstrapped through Next.js instrumentation, plus dedicated PM2 workers, run recurring jobs such as content campaigns and video rendering outside the web process.

  4. D.

    Relational data

    PostgreSQL through Prisma, with migrations written to be idempotent so every deploy can safely re-apply them.

04

Architecture

  1. Interface

    • Next.js App Router
    • Protected multi-page console
  2. Application

    • REST route handlers
    • Zod validation
    • JWT + refresh rotation + CSRF
  3. Services

    • node-cron scheduler
    • PM2 workers
    • Social and Google integrations
    • Model provider layer
  4. Data

    • PostgreSQL
    • Prisma ORM
    • Document and media storage
  5. Platform

    • Linux guest on Proxmox
    • PM2 process management

Internal endpoints and hosts are intentionally omitted.

05

Technologies

  • Next.js
  • React
  • TypeScript
  • JavaScript
  • Tailwind CSS
  • HTML
  • CSS
  • Responsive UI Engineering
  • Node.js
  • REST APIs
  • Application Integrations
  • Database-driven Applications
  • PostgreSQL
  • Prisma
  • AI Agent Workflows
  • AI Automation
  • Linux
  • Proxmox
  • SSH
  • Bash
06

Visuals

Private system. Interface screenshots are not published.

The artwork above is an illustration of the system, not an interface capture.

07

Challenges & solutions

  1. Challenge 01

    A deploy script that could report success while nothing had changed.

    Solution

    Deploys run in a strict bash -euo pipefail shell, so the first failing step stops everything and reports failure, and each deploy confirms the running commit matches the one that was pushed.

  2. Challenge 02

    A migration history that drifted after some tables were created outside the migration tool.

    Solution

    Migrations are applied as guarded, idempotent SQL scripts, so re-running the full list on every deploy is safe and the schema converges.

  3. Challenge 03

    Long-running rendering and publishing jobs competing with interactive traffic.

    Solution

    Each pipeline runs as its own PM2 worker process, so video rendering and publishing never run inside the web server.

Have a system like this in mind?

Get in touch