Skip to content

About

Enterprise SaaS platform for multi-agent AI codebase architecture review, security auditing, Stripe billing & Prometheus

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CodeCouncil AI – Enterprise SaaS Platform πŸš€

Your on-demand AI engineering workforce. Architecture reviews, security audits, and product analysisβ€”delivered instantly.

Status: βœ… PRODUCTION READY with 6 Enterprise Features (51/51 tests passing)

🎯 What's Implemented

βœ… Core Features

  • OAuth 2.0 Authentication – Google login with JWT tokens (7-day expiration)
  • Stripe Subscriptions – 4 tiers (Startup/Enterprise Γ— Monthly/Annual)
  • Credit-Based Billing – Tiered plans with automatic allocation (300-1200 credits/month)
  • BYOK Support – Users bring their own Gemini key for unlimited access
  • Admin Dashboard – User management, analytics, suspension, reactivation
  • Per-User Rate Limiting – Database-backed by subscription tier
  • Audit Logging – Compliance-ready with severity levels
  • PostgreSQL Backups – Automated daily with 30-day retention
  • Monitoring Stack – Prometheus + Grafana + AlertManager (11 metrics, 6 alerts)
  • Email Service – SendGrid integration for transactional emails
  • Error Tracking – Sentry for real-time error monitoring

πŸ“š Documentation

Start here for your use case:

Document Purpose Time
GETTING_STARTED.md 10-step launch guide 5 min
LAUNCH_CHECKLIST.md Pre-launch verification 5 min
QUICKSTART.md Quick reference (5 commands) 2 min
ENTERPRISE.md Complete feature guide 30 min
IMPLEMENTATION_SUMMARY.md Technical architecture 20 min
LAUNCH_STATUS_REPORT.md Full implementation status 10 min

πŸš€ Quick Start (5 minutes)

Option 1: Automated Setup

chmod +x setup.sh
./setup.sh

Option 2: Manual Setup

# 1. Copy environment template
cp backend/.env.example backend/.env.local

# 2. Fill in your credentials (see GETTING_STARTED.md)
# STRIPE_SECRET_KEY, GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, DATABASE_URL

# 3. Install dependencies
cd backend && npm install && cd ..
cd codecouncil-ai && npm install && cd ..

# 4. Setup database
cd backend && npm run db:migrate && npm run db:seed && cd ..

# 5. Start services
# Terminal 1: cd backend && npm run dev
# Terminal 2: cd codecouncil-ai && npm run dev

πŸ—οΈ Project Structure

CodeConcilAI/
β”œβ”€β”€ codecouncil-ai/           # Frontend (React 19 + Vite 6)
β”‚   β”œβ”€β”€ components/           # UI components
β”‚   └── services/             # API, Gemini, GitHub services
β”œβ”€β”€ backend/                  # Node.js + Express API
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ routes/           # 13 API endpoints
β”‚   β”‚   β”œβ”€β”€ services/         # 8 business logic services
β”‚   β”‚   β”œβ”€β”€ middleware/       # Auth, rate limit, metrics
β”‚   β”‚   └── prisma/          # Database schema & migrations
β”‚   └── scripts/             # Backup, restore, setup
β”œβ”€β”€ monitoring/              # Prometheus + Grafana configs
β”œβ”€β”€ docker-compose.yml       # Full stack (local)
└── docker-compose.monitoring.yml  # Monitoring stack

πŸ’³ Billing Plans

Plan Price Credits/mo Requests/day Analyses/day Support
Startup Monthly $49/mo 300 1,000 20 Basic
Startup Annual $499/yr 350 1,000 20 Basic
Enterprise Monthly $149/mo 1,000 10,000 500 Priority
Enterprise Annual $1,499/yr 1,200 10,000 500 Priority
Trial Free 400 – – Community

πŸ”Œ API Endpoints (13 New)

Subscriptions (5)

GET    /api/subscriptions/plans               List all plans
GET    /api/subscriptions/current             Get user's subscription
POST   /api/subscriptions/create              Create subscription
POST   /api/subscriptions/cancel              Cancel subscription
POST   /api/subscriptions/change-plan        Upgrade/downgrade

Admin Dashboard (6)

GET    /api/admin/stats                       Dashboard metrics
GET    /api/admin/audit-logs                  Query audit logs
GET    /api/admin/users/:userId              User details
POST   /api/admin/users/:userId/suspend      Suspend user
POST   /api/admin/users/:userId/reactivate   Reactivate user
GET    /api/admin/analytics                   Usage analytics

Monitoring (2)

GET    /metrics                               Prometheus metrics
GET    /api/rate-limit/usage                 User rate limits

πŸ” Security Features

βœ… Authentication & Authorization

  • OAuth 2.0 with PKCE
  • JWT tokens (7-day expiration)
  • Role-based access (admin flag)
  • Refresh token rotation

βœ… API & Data Protection

  • Per-user rate limiting (database-backed)
  • Request validation & sanitization
  • CORS restricted to allowed domains
  • CSP headers in frontend
  • Stripe webhook signature verification
  • PostgreSQL with encrypted connections
  • API keys stored only in backend

βœ… Compliance & Monitoring

  • Audit logging with severity levels
  • Real-time error tracking (Sentry)
  • Security event alerts
  • GDPR-ready (user data export)
  • PII protection in logs
  • Automated daily backups

πŸ“Š Monitoring (11 Metrics)

HTTP:                    Request duration, total requests, error rate
Business:                Subscriptions created/canceled, payment success
System:                  DB pool, memory, rate limit events
Alerts:                  6 rules (errors, latency, pool, memory, disk, payments)

View dashboards: http://localhost:3001/grafana (admin/admin)

βœ… Verify Installation

chmod +x verify.sh
./verify.sh

Should show 51/51 tests PASSING βœ“

πŸš€ Deployment Options

Railway (Recommended)

railway login && railway init
railway variables set STRIPE_SECRET_KEY=...
railway up

Render

Connect GitHub β†’ Create Web Service β†’ Auto-deploy

Heroku

heroku create codecouncil-ai
heroku addons:create heroku-postgresql:hobby-dev
git push heroku main

Docker Local

docker-compose up -d

See GETTING_STARTED.md for platform-specific instructions.

πŸ“‹ Pre-Launch Checklist

Before going live (1 hour):

  • Create 4 Stripe products with price IDs
  • Setup Google OAuth credentials
  • Configure PostgreSQL database
  • Fill backend/.env.local with all credentials
  • Run ./pre-launch.sh (interactive setup)
  • Run ./verify.sh (confirm 51/51 tests pass)
  • Test locally with npm run dev (backend + frontend)
  • Deploy to chosen platform
  • Configure Stripe webhook: https://your-app.com/api/webhooks/stripe
  • Promote admin user to access dashboard
  • Setup Slack/PagerDuty alerts (optional)

Full checklist: LAUNCH_CHECKLIST.md

πŸ†˜ Troubleshooting

Problem Solution
Backend won't start Check Node.js >= 18, npm install, database connection
OAuth fails Verify GOOGLE_CLIENT_ID matches frontend & backend
Stripe not working Confirm credentials and webhook registered
Database error Run npm run db:migrate, check DATABASE_URL
Rate limit issues Check user tier with GET /api/rate-limit/usage

Full troubleshooting: See ENTERPRISE.md

πŸ“ž Need Help?

🎯 Key Metrics

Production readiness verified:

βœ“ 51/51 verification tests PASSING
βœ“ TypeScript compiles cleanly
βœ“ All migrations ready to deploy
βœ“ 13 API endpoints working
βœ“ 8 database models with 7 indexes
βœ“ 11 Prometheus metrics collecting
βœ“ 6 alert rules configured
βœ“ Daily backup automation ready

πŸ“¦ Tech Stack

Frontend: React 19.2 + Vite 6.2 + TypeScript 5.8
Backend: Node.js + Express 4.18 + TypeScript 5.8
Database: PostgreSQL 15 + Prisma ORM 5.7
Billing: Stripe 14.8 (subscriptions, webhooks)
Monitoring: Prometheus + Grafana + AlertManager
Email: SendGrid
Error Tracking: Sentry
Authentication: Google OAuth 2.0 + JWT
Containerization: Docker + Docker Compose

πŸŽ‰ Ready?

  1. First time? β†’ Read GETTING_STARTED.md
  2. Ready to launch? β†’ Follow LAUNCH_CHECKLIST.md
  3. Need details? β†’ Check ENTERPRISE.md
  4. Verify setup? β†’ Run ./verify.sh

Status: βœ… Production-Ready
Version: 1.0.0
Last Updated: 2025

πŸš€ Good luck with your launch!

About

Enterprise SaaS platform for multi-agent AI codebase architecture review, security auditing, Stripe billing & Prometheus

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages