Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 26 additions & 7 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,24 +1,38 @@
# Database
# ──────────────────────────────────────────────
# Teos AI Engine — Unified Environment Config
# Consolidated from Teos-AI-Engine + x-teos-pro
# ──────────────────────────────────────────────

# ── Database ────────────────────────────────────
DATABASE_URL="postgresql://user:password@localhost:5432/teos?schema=public"

# Session
# ── Session / Auth ──────────────────────────────
NEXTAUTH_SECRET=""
NEXTAUTH_URL="http://localhost:3000"

# Admin
# Google OAuth (from x-teos-pro)
# GOOGLE_CLIENT_ID=""
# GOOGLE_CLIENT_SECRET=""

# ── Admin ───────────────────────────────────────
ADMIN_EMAIL="admin@example.com"
# ADMIN_EMAILS="admin@example.com,other@example.com"

# AI
# ── AI Providers ────────────────────────────────
# OpenAI (Teos-AI-Engine)
OPENAI_API_KEY=""
# OPENAI_MODEL="gpt-4o-mini"
# GEMINI_API_KEY=""

# Email (Resend)
# Anthropic / Claude (from x-teos-pro)
# ANTHROPIC_API_KEY=""

# ── Email (Resend) ──────────────────────────────
# RESEND_API_KEY=""
# EMAIL_FROM="Teos AI Engine <support@example.com>"

# Payments
# ── Payments ────────────────────────────────────
# Dodo Payments (Teos-AI-Engine)
# NEXT_PUBLIC_DODO_PRO_LINK=""
# NEXT_PUBLIC_DODO_AGENCY_LINK=""
# NEXT_PUBLIC_DODO_LIFETIME_LINK=""
Expand All @@ -27,5 +41,10 @@ OPENAI_API_KEY=""
# NEXT_PUBLIC_PAYPAL_ME=""
# DODO_WEBHOOK_SECRET=""

# Founder Login
# Tap Payments (from x-teos-pro)
# TAP_WEBHOOK_SECRET=""
# TAP_PRO_INVOICE_LINK=""
# TAP_AGENCY_INVOICE_LINK=""

# ── Founder Login ───────────────────────────────
# FOUNDER_SECRET=""
15 changes: 14 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI - Build Check
name: CI - Build & Deploy

on:
push:
Expand Down Expand Up @@ -42,3 +42,16 @@ jobs:
NEXTAUTH_URL: "http://localhost:3000"
OPENAI_API_KEY: "sk-test-ci"
ADMIN_EMAIL: "ci@test.com"

# Vercel deploy (uncomment and set secrets in GitHub to enable)
# deploy:
# if: github.ref == 'refs/heads/main' && github.event_name == 'push'
# needs: build
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: vercel/action@v34
# with:
# vercel-token: ${{ secrets.VERCEL_TOKEN }}
# vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
# vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
139 changes: 85 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# 🏺 Teos AI Engine
**AI Content Engine for Builders, Creators, and Agencies**
**AI Content Engine for Builders, Creators, and Agencies**
Powered by Elmahrosa International

---
Expand All @@ -21,22 +21,49 @@ Built for founders, creators, and agencies who want to **automate content creati

- ✍️ AI-generated posts (prompt → ready content)
- 📊 Daily & lifetime usage tracking
- 🔒 Secure authentication (NextAuth)
- 🧠 Plan-based feature gating
- 🔒 Secure authentication (JWT + NextAuth support in pro-extension)
- 🧠 Plan-based feature gating (Starter / Pro / Agency / Lifetime)
- 💾 Persistent database (Prisma + PostgreSQL)
- 🛠 Admin dashboard (manual activation + billing control)
- 💳 Payment-ready (Dodo / PayPal / Crypto / Pi)
- 💳 Payment-ready (Dodo, PayPal, Crypto, Pi, Tap)
- 🧩 Pro Extension module for legacy compatibility

---

## 🧠 SaaS Logic (NEW)
## 📦 Repository Structure (Post-Merge)

This repo consolidates **Teos-AI-Engine** (core) and **x-teos-pro** (legacy MVP).

```
Teos-AI-Engine/
├── app/ # Next.js App Router pages & API routes
├── components/ # Shared React components
├── lib/ # Core library (auth, AI, limits, payments)
├── prisma/ # Schema, migrations, seed
├── public/ # Static assets
├── test/ # Vitest test suite
├── pro-extension/ # x-teos-pro assets (legacy compatibility)
│ ├── lib/ # Legacy lib modules (access, tap, rate-limit, etc.)
│ ├── types/ # NextAuth type extensions
│ ├── components/ # Providers.tsx, plans.ts
│ ├── app/ # Privacy & Terms pages
│ ├── scripts/ # Git sync / dev workflow scripts
│ ├── config/ # Legacy Vercel/Next configs
│ └── docs/ # Audit & QA docs
├── .env.example # Unified env config (all providers)
└── .github/workflows/ # CI + optional Vercel deploy
```

This version includes a **fully integrated usage engine**:
---

## 🧠 SaaS Logic

- Starter → 5 posts lifetime
- Pro → 50 posts/day
- Agency → 200 posts/day
- Lifetime → 100/day (limited offer)
| Plan | Price | Daily Limit | Platforms |
|-----------|-------------|------------------|------------------------------------|
| Starter | Free | 5 posts lifetime | X |
| Pro | $19/mo | 50 posts/day | X, Facebook, Instagram, LinkedIn |
| Agency | $49/mo | 200 posts/day | X, Facebook, Instagram, LinkedIn |
| Lifetime | $149 (once) | 100 posts/day | X, Facebook, Instagram, LinkedIn |

Features:
- Daily reset system
Expand All @@ -46,70 +73,76 @@ Features:

---

## 💰 Pricing (Launch Model)

| Plan | Price | Features |
|----------|------|--------|
| Starter | Free | 5 posts total |
| Pro | $19/mo | 50 posts/day |
| Agency | $49/mo | 200 posts/day + LinkedIn |
| Lifetime | $149 (limited) | 100/day forever |

🔥 **First 100 users get Lifetime access**

---

## 💳 Payments

Supports:

- Dodo Payments (primary checkout)
- PayPal (manual approval)
- USDC (Solana)
- Pi Network (discount model)

Admin dashboard controls:
- Activation
- Plan upgrades
- Billing validation
| Method | Source |
|-----------------|-------------------|
| Dodo Payments | Teos-AI-Engine |
| PayPal | Teos-AI-Engine |
| USDC (Solana) | Teos-AI-Engine |
| Pi Network | Teos-AI-Engine |
| Tap Payments | x-teos-pro (legacy)|

---

## 🧪 Development

```bash
# Install dependencies
npm install

# Generate Prisma client
npx prisma generate

# Run migrations
npx prisma migrate dev
npm run dev -- --webpack
````

# Start dev server
npm run dev
```

---

## 🏗️ Architecture

* Next.js 16 (App Router)
* Prisma ORM
* PostgreSQL (Neon recommended)
* NextAuth authentication
* Claude/OpenAI (AI layer)
| Layer | Technology |
|---------------|-------------------------------|
| Framework | Next.js 14 (App Router) |
| Database | PostgreSQL (Neon) + Prisma |
| Auth | JWT (core) / NextAuth (ext) |
| AI Providers | OpenAI, Gemini, Claude |
| Testing | Vitest |
| Styling | Tailwind CSS |
| CI/CD | GitHub Actions |

---

## 🧠 Project Status
## 🔀 Merge History

✅ Core SaaS engine implemented
✅ Usage + billing system integrated
✅ Ready for production testing
🚀 Launch-ready after final payment + UI polish
This repo is the result of consolidating two repositories:

---
| Repository | Role | Status |
|-----------------|-------------------------|----------|
| Teos-AI-Engine | Primary SaaS engine | Active |
| x-teos-pro | MVP extension layer | Merged → `/pro-extension` |

**Strategy**: Option B — x-teos-pro rebuilt as a dedicated module (`/pro-extension`) inside Teos-AI-Engine.

## ⚠️ Notes
### What was merged from x-teos-pro:
- **Library modules**: access control, Claude AI client, rate limiting, Tap payments, trial logic, validation schemas, constants, plan config
- **Types**: NextAuth type extensions (`next-auth.d.ts`)
- **Components**: Session Provider wrapper, plan definitions
- **Pages**: Privacy Policy, Terms of Service
- **Scripts**: Git sync/launch workflow
- **Configs**: Vercel deploy config, .vercelignore, legacy next.config
- **Docs**: Audit verdict, pre-launch QA checklist

* This repo is private during stabilization
* Public release will follow after launch validation
* Old version (x-teos-pro) has been deprecated
### What was kept from Teos-AI-Engine (base):
- Full SaaS engine with auth, AI generation, limits, admin dashboard
- Prisma schema, migrations, seed data
- Payment integrations (Dodo, PayPal, Crypto, Pi)
- CI pipeline, test suite
- All existing API routes and pages

---

Expand All @@ -122,7 +155,5 @@ Vision: Build sovereign AI-powered systems for global scale

## 📜 License

Proprietary Elmahrosa International
Proprietary Elmahrosa International
Not for redistribution without permission

````
60 changes: 60 additions & 0 deletions pro-extension/MIGRATION_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Migration Notes — x-teos-pro → Teos-AI-Engine

**Date**: 2026-05-12
**Strategy**: Option B — Dedicated module (`/pro-extension`)

## What happened

The `x-teos-pro` repository (124 commits) was rebuilt as a module inside `Teos-AI-Engine` (133 commits). `Teos-AI-Engine` is the primary base; `x-teos-pro` assets live under `/pro-extension/`.

## File mapping

| x-teos-pro path | Merged to |
|---|---|
| `lib/access.ts` | `pro-extension/lib/access.ts` |
| `lib/claude.ts` | `pro-extension/lib/claude.ts` |
| `lib/constants.ts` | `pro-extension/lib/constants.ts` |
| `lib/origin.ts` | `pro-extension/lib/origin.ts` |
| `lib/plans.ts` | `pro-extension/lib/plans.ts` |
| `lib/rateLimit.ts` | `pro-extension/lib/rateLimit.ts` |
| `lib/tap.ts` | `pro-extension/lib/tap.ts` |
| `lib/trial.ts` | `pro-extension/lib/trial.ts` |
| `lib/validation.ts` | `pro-extension/lib/validation.ts` |
| `types/next-auth.d.ts` | `pro-extension/types/next-auth.d.ts` |
| `components/Providers.tsx` | `pro-extension/components/Providers.tsx` |
| `components/plans.ts` | `pro-extension/components/plans.ts` |
| `app/privacy/page.tsx` | `pro-extension/app/privacy/page.tsx` |
| `app/terms/page.tsx` | `pro-extension/app/terms/page.tsx` |
| `scripts/git-sync-launch.sh` | `pro-extension/scripts/git-sync-launch.sh` |
| `AUDIT.md` | `pro-extension/docs/AUDIT.md` |
| `PRELAUNCH_QA.md` | `pro-extension/docs/PRELAUNCH_QA.md` |
| `vercel.json` | `pro-extension/config/vercel.json` |
| `.vercelignore` | `pro-extension/config/vercelignore` |
| `next.config.mjs` | `pro-extension/config/next.config.mjs` |
| `page.tsx` (dashboard) | `pro-extension/app/dashboard-og.tsx` |

## Config alignment

| Config | Teos-AI-Engine (base) | x-teos-pro (merged) |
|---|---|---|
| TypeScript strict | `true` | `false` (legacy) |
| `allowJs` | `false` | `true` |
| `jsx` | `preserve` | `react-jsx` |
| Next.js version | 14.x | 16.x (legacy config) |
| Test framework | Vitest | None |
| Auth | JWT | NextAuth (legacy) |

The base `tsconfig.json` already covers `pro-extension/` via `**/*.ts` and `**/*.tsx` globs.

## Env vars added from x-teos-pro

- `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET` — OAuth
- `ANTHROPIC_API_KEY` — Claude AI
- `TAP_WEBHOOK_SECRET`, `TAP_PRO_INVOICE_LINK`, `TAP_AGENCY_INVOICE_LINK` — Tap Payments

## Next steps

1. Migrate any active x-teos-pro deployments to this unified repo
2. Archive the original `x-teos-pro` repo on GitHub
3. Update Vercel project to point to this repo
4. Run `npm install` and verify build
Loading
Loading