Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
ba7bca4
Improve setup.js Windows compatibility
paulmerz Aug 22, 2025
74ea134
Add i18n support and migrate pages to locale routing
paulmerz Aug 25, 2025
567627f
Add adaptive AI prompt generation and i18n improvements
paulmerz Aug 26, 2025
7988e01
Integrate AI web search for competitor discovery
paulmerz Aug 27, 2025
1d3511c
Refactor routing, branding, and error handling
paulmerz Sep 12, 2025
85259d7
Add docs section, pricing refactor, and new utilities
paulmerz Sep 22, 2025
690a0fb
chore: remove package-lock, regen pnpm-lock, ignore package-lock
paulmerz Sep 22, 2025
14996c6
fix: corrige import useSearchParams et lazy init Autumn SDK dans API
paulmerz Sep 22, 2025
60a2d6a
ci: add GitHub Actions workflow to run DB migrations and i18n check f…
paulmerz Sep 22, 2025
3a101a9
Simplify and enhance db-and-i18n workflow
paulmerz Sep 22, 2025
12ce82b
ci: setup pnpm in workflow to fix missing pnpm error
paulmerz Sep 22, 2025
f0524af
ci: run pnpm/action-setup before setup-node cache (fix pnpm not found)
paulmerz Sep 22, 2025
469139c
Delete ci.yml
paulmerz Sep 22, 2025
4a97811
ci: move pgcrypto creation into setup.js; remove psql step from workflow
paulmerz Sep 22, 2025
7f49416
ci: allow DATABASE_URL from env; skip .env.local requirement and npm …
paulmerz Sep 22, 2025
6b13941
ci: use GitHub Environment secrets (preview/production) for DATABASE_URL
paulmerz Sep 22, 2025
332f7e7
Add Terms of Service and analysis UI translations
paulmerz Sep 22, 2025
ccebd8e
Ensure pnpm store directory exists in CI workflow
paulmerz Sep 22, 2025
fdfbe6b
Refactor docs to use markdown files and add logger
paulmerz Sep 23, 2025
96fcb49
Update guided examples and scoring details in i18n files
paulmerz Sep 23, 2025
2cef043
Add guided example titles to French translations
paulmerz Sep 23, 2025
6bb359f
Add Vercel deploy hook and update trusted origins
paulmerz Sep 23, 2025
6753830
Add CORS handling for API routes in middleware
paulmerz Sep 23, 2025
9a28541
Add vercel.json configuration file
paulmerz Sep 23, 2025
d2675b9
fix: specify pnpm version for Vercel compatibility
paulmerz Sep 23, 2025
05f399d
fix: update pnpm version in GitHub Actions to match package.json
paulmerz Sep 23, 2025
a4c0579
Enable email verification only in development
paulmerz Sep 23, 2025
6a2ae74
Add better-auth-localization and update locale handling
paulmerz Sep 24, 2025
214418a
Redirect logged-in users from login to brand-monitor
paulmerz Sep 24, 2025
eec8629
Add email verification page and update registration flow
paulmerz Sep 24, 2025
52762d9
Add brand detection API and sources tab, refactor analyses
paulmerz Sep 29, 2025
c82dce7
Fix all linting errors
google-labs-jules[bot] Sep 30, 2025
8f8bac4
Improve type safety and source handling across app
paulmerz Oct 7, 2025
5295297
Enhance brand detection and credits handling
paulmerz Oct 7, 2025
e04be86
Resolve merge conflicts and update brand detection logic
paulmerz Oct 7, 2025
afb33bd
Refactor and clean up brand monitor and AI utils
paulmerz Oct 7, 2025
3565fdf
Refactor brand variation handling and cleanup hooks
paulmerz Oct 7, 2025
81c161d
Revamp pricing plans and brand detection logic
paulmerz Oct 8, 2025
7e70840
Add Open Graph images and enhance metadata
paulmerz Oct 8, 2025
4a28bce
Add dynamic SEO/GEO config, robots and sitemap
paulmerz Oct 9, 2025
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
Empty file added .cursor/commands/dashboard.md
Empty file.
86 changes: 86 additions & 0 deletions .github/workflows/db-and-i18n.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: DB migrations & i18n (minimal)

on:
push:
branches: [ dev, main ]
workflow_dispatch:

permissions:
contents: read

jobs:
preview:
if: github.ref == 'refs/heads/dev'
runs-on: ubuntu-latest
environment: preview
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
steps:
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.17.1
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Ensure pnpm store exists (for caching)
run: mkdir -p "$(pnpm store path)"
- run: corepack enable
- run: pnpm install --no-frozen-lockfile
- name: Lint
run: pnpm lint
# pgcrypto is ensured inside setup.js using node-postgres
- name: Run migrations
run: node setup.js
- name: i18n check
run: pnpm run i18n:check
- name: Brand detection tests
run: pnpm run test:brand-detection
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- name: Trigger Vercel Deploy Hook
if: ${{ success() }}
run: curl -X POST "$VERCEL_DEPLOY_HOOK_URL"
env:
VERCEL_DEPLOY_HOOK_URL: ${{ secrets.VERCEL_DEPLOY_HOOK_URL }}

production:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment: production
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
steps:
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.17.1
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Ensure pnpm store exists (for caching)
run: mkdir -p "$(pnpm store path)"
- run: corepack enable
- run: pnpm install --no-frozen-lockfile
- name: Lint
run: pnpm lint
# pgcrypto is ensured inside setup.js using node-postgres
- name: Run migrations
run: node setup.js
- name: i18n check
run: pnpm run i18n:check
- name: Brand detection tests
run: pnpm run test:brand-detection
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- name: Trigger Vercel Deploy Hook
if: ${{ success() }}
run: curl -X POST "$VERCEL_DEPLOY_HOOK_URL"
env:
VERCEL_DEPLOY_HOOK_URL: ${{ secrets.VERCEL_DEPLOY_HOOK_URL }}


3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,6 @@ cookies.txt
# Generated files
repomix-output.txt
i18n.cache

# lockfiles from other package managers
package-lock.json
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
49 changes: 49 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Repository Guidelines

## Project Structure & Module Organization
- `app/` hosts Next.js 15 routes, server actions, and layouts; keep features grouped by route segment.
- `components/` contains shared UI; export reusable pieces via `index.ts` barrels where helpful and name files in PascalCase.
- `lib/` centralizes utilities (`auth`, `clients`, `validators`); prefer the `@/` alias when importing.
- `config/`, `hooks/`, `i18n/`, and `messages/` hold environment loaders, React hooks, and localization strings; sync locale changes with `pnpm i18n:check`.
- `supabase/`, `migrations/`, and `better-auth_migrations/` track SQL; commit generated files and keep IDs aligned with drizzle migrations.
- `public/` stores static assets; `scripts/` houses automation TSX scripts; `.github/workflows/` defines CI/CD.

##

## Build, Test, and Development Commands
- `pnpm run setup` bootstraps the project (installs deps, seeds auth tables).
- `pnpm dev` runs the Turbopack dev server on localhost.
- `pnpm build` produces the production bundle; `pnpm start` serves the compiled app.
- `pnpm lint` enforces ESLint+Next rules; run before every PR.
- `pnpm db:generate`, `pnpm db:migrate`, and `pnpm db:push` manage drizzle migrations; `pnpm db:studio` opens the schema explorer.
- `pnpm debug:env` prints resolved environment variables for troubleshooting.

## Coding Style & Naming Conventions
TypeScript is strict; enable editors to use the repo `tsconfig.json`. Rely on Prettier defaults (2-space indent, semicolons) and Next linting. Components and hooks use PascalCase and `useCamelCase` respectively; route folders stay lower-case kebab. Keep database files snake_case with numeric prefixes (`001_*`). Import with the `@/` alias instead of deep relative paths. Update localization keys consistently across `messages/` locales.

## Development Guidelines
1. **Document every change**
- Update relevant `README`, comments, or inline docs when modifying or creating features.
- When in doubt, explain *why* the code exists.

2. **No hard-coded strings**
- Always use `next-intl` and the `i18n` system.
- Add/modify entries in `/messages` and ensure both locales are updated.
- Run `pnpm i18n:check` before committing.

3. **Prefer reuse over duplication**
- Before writing new code, check if a utility, hook, or component already implements similar behavior.
- Extend existing logic rather than duplicating functionality.

4. **Avoid rigid static logic**
- Do not over-rely on long `if/else` or `switch` blocks with hard-coded cases.
- Prefer flexible patterns, data-driven configs, or leverage an **LLM-powered function** when appropriate for broader coverage and adaptability.

## Testing Guidelines
Automated tests are not yet wired; guard changes with `pnpm lint`, manual verification in `pnpm dev`, and database smoke tests via `pnpm db:studio`. When adding tests, colocate `*.test.ts(x)` beside the feature and stub network calls to keep runs deterministic. Extend CI to run new test suites before merging.

## Commit & Pull Request Guidelines
Write imperative, concise commit messages (~60 chars). Follow the current history by prefacing fixes with `fix:` when appropriate and omitting prefixes for general additions. Each PR should include: a short summary, linked issue or ticket, screenshots/GIFs for UI changes, notes on env vars or migrations, and a checklist of commands run (`pnpm lint`, relevant db tasks). Request review once CI passes and docs/config updates land in the same branch.

## Environment & Secrets
Copy `.env.example` to `.env.local` and fill the required keys: `DATABASE_URL`, `BETTER_AUTH_SECRET`, email providers, and AI API keys as needed. Use `pnpm debug:env` to confirm values. Never commit `.env.local`; rely on Vercel project settings for deployment.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# FireGEO Open-Source SaaS Starter
# VOXUM

<img src="https://media4.giphy.com/media/v1.Y2lkPTc5MGI3NjExNjh4N3VwdGw2YXg2ZXpvMHBlNDFlejd1MjBpZXBxNHZ5YXJxOGk5OSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/x2sTqbCW5m7z0qaNJM/giphy.gif" alt="FireGEO Demo" width="100%" />
<img src="https://media4.giphy.com/media/v1.Y2lkPTc5MGI3NjExNjh4N3VwdGw2YXg2ZXpvMHBlNDFlejd1MjBpZXBxNHZ5YXJxOGk5OSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/x2sTqbCW5m7z0qaNJM/giphy.gif" alt="Voxum" width="100%" />

Get your SaaS running in minutes with authentication, billing, AI chat, and brand monitoring. Zero-config setup with Next.js 15, TypeScript, and PostgreSQL.

Expand Down
140 changes: 140 additions & 0 deletions TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# Guide de Dépannage - Voxum

## Problème : Divergence entre ordinateurs

Si vous obtenez des réponses sur un ordinateur mais pas sur l'autre, voici les causes les plus probables et leurs solutions :

### 1. Variables d'environnement manquantes

**Symptôme :** Aucune donnée n'est extraite, erreurs dans la console

**Solution :**
```bash
# Exécuter le diagnostic
npm run debug:env
```

**Variables critiques à vérifier :**
- `FIRECRAWL_API_KEY` - **ESSENTIEL** pour le scraping
- `OPENAI_API_KEY` ou `ANTHROPIC_API_KEY` - **ESSENTIEL** pour l'extraction de données
- `AUTUMN_SECRET_KEY` - **ESSENTIEL** pour la vérification des crédits

### 2. Configuration des providers AI

**Symptôme :** Erreur "No AI providers configured"

**Solution :**
1. Vérifiez que au moins une clé API AI est configurée
2. Redémarrez le serveur après avoir ajouté les variables
3. Vérifiez que les clés sont valides

### 3. Problèmes de réseau

**Symptôme :** Timeouts, erreurs de connexion

**Solutions :**
- Vérifiez votre connexion internet
- Vérifiez les paramètres de firewall/proxy
- Essayez avec une URL différente (plus simple)

### 4. Problèmes de base de données

**Symptôme :** Erreurs d'authentification, problèmes de crédits

**Solution :**
```bash
# Vérifier la connexion à la base de données
npm run db:push
```

### 5. Problèmes de cache

**Symptôme :** Données obsolètes ou incohérentes

**Solution :**
```bash
# Nettoyer le cache et redémarrer
rm -rf .next
npm run dev
```

## Diagnostic Automatique

### Exécuter le diagnostic complet

```bash
npm run debug:env
```

Ce script vérifie :
- ✅ Variables d'environnement requises
- ✅ Configuration des providers AI
- ✅ Connexion à la base de données
- ✅ Connexion à Firecrawl
- ✅ Configuration des clés API

### Logs de debug

Les logs détaillés sont maintenant activés. Regardez la console pour :
- `🔍 [Scraper]` - Logs de scraping
- `🔍 [Processor]` - Logs d'extraction de données
- `🔍 [Scrape API]` - Logs de l'API
- `❌` - Erreurs détaillées

## Solutions par Type d'Erreur

### Erreur : "FIRECRAWL_API_KEY not configured"
```bash
# Ajouter dans .env.local
FIRECRAWL_API_KEY=your_key_here
```

### Erreur : "No AI providers configured"
```bash
# Ajouter au moins une clé API dans .env.local
OPENAI_API_KEY=your_key_here
# OU
ANTHROPIC_API_KEY=your_key_here
```

### Erreur : "Insufficient credits"
- Vérifiez votre compte Autumn
- Assurez-vous que les produits sont correctement configurés
- Vérifiez que `AUTUMN_SECRET_KEY` est correct

### Erreur : "Connection timeout"
- Vérifiez votre connexion internet
- Essayez avec une URL plus simple
- Vérifiez les paramètres de proxy/firewall

## Vérification Rapide

1. **Variables d'environnement :**
```bash
npm run debug:env
```

2. **Redémarrer le serveur :**
```bash
npm run dev
```

3. **Tester avec une URL simple :**
- Essayez `https://example.com` d'abord
- Puis testez avec votre URL cible

4. **Vérifier les logs :**
- Ouvrez la console du navigateur
- Regardez les logs du serveur
- Identifiez le point de défaillance

## Support

Si le problème persiste :
1. Exécutez `npm run debug:env` et partagez le résultat
2. Partagez les logs de la console
3. Indiquez l'URL que vous essayez de scraper
4. Précisez les différences entre les deux ordinateurs



Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
import { useCustomer } from '@/hooks/useAutumnCustomer';
import { useSession } from '@/lib/auth-client';
import { useEffect } from 'react';
import type { Session } from 'better-auth';

// Separate component that uses Autumn hooks
function AutumnVerifyContent({ session }: { session: any }) {
function AutumnVerifyContent({ session }: { session: Session | null }) {
const { customer, isLoading, error } = useCustomer();

useEffect(() => {
Expand Down Expand Up @@ -73,7 +74,7 @@ function AutumnVerifyContent({ session }: { session: any }) {
<div className="bg-blue-50 rounded-lg p-6">
<h3 className="font-semibold mb-2">Next Steps:</h3>
<ol className="list-decimal list-inside space-y-2 text-sm">
<li>Check the browser console for the logged "Autumn Customer" object</li>
<li>Check the browser console for the logged &quot;Autumn Customer&quot; object</li>
<li>Verify in your Autumn dashboard at <a href="https://app.useautumn.com/sandbox/customers" target="_blank" rel="noopener noreferrer" className="text-blue-600 hover:underline">https://app.useautumn.com/sandbox/customers</a> that the customer was created</li>
<li>The customer ID in Autumn should match your auth user ID: <code className="bg-white px-2 py-1 rounded">{session?.user?.id || 'Not logged in'}</code></li>
</ol>
Expand Down
Loading