Skip to content

About

Sourceplane UI

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

9 Commits

Folders and files

Repository files navigation

Sourceplane UI Platform

Modern SaaS monorepo for Sourceplane - Git-native control plane for cloud-native platforms.

πŸ“¦ Project Structure

sourceplane-ui/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ landing-page/          # Marketing landing page (Static HTML)
β”‚   └── auth-frontend/         # Authentication console (React + Vite)
β”œβ”€β”€ services/
β”‚   └── auth-worker/           # OAuth worker (Cloudflare Workers)
β”œβ”€β”€ packages/
β”‚   └── auth-lib/              # Shared authentication library
β”œβ”€β”€ package.json               # Root monorepo config
β”œβ”€β”€ wrangler.toml              # Multi-app deployment
β”œβ”€β”€ deploy.sh                  # Deployment automation
β”œβ”€β”€ build.sh                   # Build automation
β”œβ”€β”€ dev.sh                     # Development startup
└── README.md                  # This file

πŸš€ Quick Start

Development

# Install dependencies
npm install

# Start all services
./dev.sh

# Services available at:
# - Landing Page: http://localhost:3001
# - Auth Frontend: http://localhost:3000
# - Auth Worker: http://localhost:8787

Build

# Build all apps
./build.sh

# Or build individual apps
npm run build:landing
npm run build:auth-frontend
npm run build:auth-worker

Deploy

# Deploy to staging (default)
./deploy.sh

# Deploy to production
ENVIRONMENT=production ./deploy.sh

# Deploy specific apps
npm run deploy:landing
npm run deploy:auth

🌐 Applications

Landing Page (apps/landing-page/)

Tech Stack: Static HTML, Tailwind CSS, Vanilla JavaScript

Features:

  • Modern SaaS UI with dark theme
  • Navigation with login link
  • Hero section with CTAs
  • Feature showcase
  • Responsive design

Deployment: Cloudflare Pages

Links to Console:

  • Navigation: "Login to Console" button
  • Hero: "Access Console" CTA
  • CTA Section: "Start Building Now" button

Auth Frontend (apps/auth-frontend/)

Tech Stack: React 18, Vite, TypeScript, Tailwind CSS

Features:

  • OAuth2 OIDC authentication
  • Protected routes
  • Session management
  • Multi-provider support (Google, GitHub)

Deployment: Cloudflare Pages

Auth Worker (services/auth-worker/)

Tech Stack: TypeScript, Cloudflare Workers, D1 Database, KV Storage

Features:

  • OAuth2 authorization endpoint
  • Session management
  • Tenant isolation
  • JWT token generation

Deployment: Cloudflare Workers

πŸ“Š Architecture

Landing Page (sourceplane.ai)
β”œβ”€β”€ Login Links β†’ Auth Frontend (console.sourceplane.ai)
└── CTA Buttons β†’ GitHub

Auth Frontend (console.sourceplane.ai)
β”œβ”€β”€ OAuth Flow β†’ Auth Worker (auth.sourceplane.ai)
β”œβ”€β”€ Session Management β†’ KV Storage
└── Dashboard β†’ Protected Routes

πŸ› οΈ Available Scripts

Development

./dev.sh                        # Start all services
npm run dev                     # Alternative

npm run dev -w @sourceplane/landing-page    # Landing page only
npm run dev -w @sourceplane/auth-frontend   # Auth frontend only

Build

./build.sh                      # Build all apps
npm run build                   # Alternative

npm run build:landing           # Landing page only
npm run build:auth-frontend     # Auth frontend only
npm run build:auth-worker       # Auth worker only

Deploy

./deploy.sh                     # Deploy to staging
ENVIRONMENT=production ./deploy.sh   # Deploy to production

npm run deploy:landing          # Landing page only
npm run deploy:auth             # Auth services only

πŸ“ Environment Variables

Landing Page

No environment variables required (static HTML).

Auth Frontend (.env.local)

VITE_API_URL=https://auth.sourceplane.ai
VITE_FRONTEND_URL=https://console.sourceplane.ai

Auth Worker (wrangler.toml)

[env.production]
vars = { 
  ENVIRONMENT = "production",
  GOOGLE_CLIENT_ID = "your-client-id",
  GOOGLE_CLIENT_SECRET = "your-secret",
  GITHUB_CLIENT_ID = "your-client-id",
  GITHUB_CLIENT_SECRET = "your-secret",
  FRONTEND_URL = "https://console.sourceplane.ai",
  API_URL = "https://auth.sourceplane.ai"
}

πŸ” Prerequisites for Deployment

  1. Cloudflare Account with:

    • Cloudflare Pages projects
    • Cloudflare Workers access
    • D1 Database
    • KV Namespace access
  2. Wrangler CLI

    npm install -g wrangler@latest
    wrangler login
  3. OAuth Credentials

    • Google OAuth Client ID/Secret
    • GitHub OAuth Client ID/Secret (optional)

πŸ“‹ Deployment Checklist

Before deploying:

  • All code committed to main branch
  • npm install runs without errors
  • npm run build completes successfully
  • Environment variables configured
  • Wrangler authenticated (wrangler whoami)
  • D1 database created and migrations complete
  • KV namespaces created with correct IDs
  • OAuth credentials configured

Verify after deployment:

  • Landing page accessible at domain
  • Auth console reachable
  • Login flow works end-to-end
  • Error logs show no critical issues
  • All CTAs link correctly

πŸ› Troubleshooting

"npm: command not found"

Install Node.js from https://nodejs.org

"concurrently: command not found"

Run npm install to install dev dependencies.

Wrangler authentication fails

wrangler logout
wrangler login

Pages deployment fails

  • Check project name in wrangler.toml matches Cloudflare Pages
  • Ensure Pages project is created in Cloudflare Dashboard
  • Verify build command output has dist files

Worker deployment fails

  • Verify KV namespace IDs in services/auth-worker/wrangler.toml
  • Check D1 database ID is correct
  • Ensure environment variables are set

OAuth flow fails

  • Verify redirect URIs in OAuth provider settings match deployment URL
  • Check environment variables for client ID/secret
  • Review Worker logs in Cloudflare Dashboard

πŸ“Š Performance

  • Landing Page: < 50KB total
  • Auth Frontend: Code-split with lazy loading
  • Auth Worker: Edge computing with KV caching

πŸ”’ Security

  • All secrets stored in environment variables
  • Never commit .env files
  • OAuth secrets rotated regularly
  • CORS headers properly configured
  • Rate limiting enabled on Workers
  • Database access restricted

πŸ“š Development Workflow

  1. Create feature branch

    git checkout -b feat/your-feature
  2. Make changes in relevant app directory

  3. Test locally

    npm run dev
  4. Build and verify

    npm run build
  5. Commit and push

    git add .
    git commit -m "feat: description"
    git push origin feat/your-feature
  6. Create pull request and get review

  7. Merge and deploy

    ENVIRONMENT=production ./deploy.sh

πŸ“ž Support

For issues:

  1. Check error logs in application
  2. Review Cloudflare Dashboard logs
  3. Verify environment configuration
  4. Check this README's troubleshooting section

πŸ“„ License

MIT - Sourceplane Team

πŸ”— Links

About

Sourceplane UI

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages