Skip to content

TheJagStudio/AnalyzrAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FP&A AI Copilot Foundation

Monorepo starter for a full-stack FP&A SaaS foundation:

  • backend/: Django + Django REST Framework API
  • frontend/: Vite + React (JSX) + Tailwind CSS + shadcn/ui-style components

Prerequisites

  • Python 3.11+
  • Node.js 20+
  • npm 10+

1) Backend Setup

cd backend
py -m venv .venv
.\.venv\Scripts\python -m pip install -r requirements.txt
Copy-Item .env.example .env
.\.venv\Scripts\python manage.py migrate
.\.venv\Scripts\python manage.py runserver

Backend runs at http://127.0.0.1:8000.

Health endpoint: http://127.0.0.1:8000/api/health/

2) Frontend Setup

cd frontend
npm install
Copy-Item .env.example .env
npm run dev

Frontend runs at http://127.0.0.1:5173.

Default Environment Variables

backend/.env

DJANGO_SECRET_KEY=replace-with-a-secure-secret
DJANGO_DEBUG=True
DJANGO_ALLOWED_HOSTS=127.0.0.1,localhost,testserver
CORS_ALLOWED_ORIGINS=http://localhost:5173,http://127.0.0.1:5173
DB_NAME=postgres
DB_USER=postgres.your_project_ref
DB_PASSWORD=your-db-password
DB_HOST=aws-0-us-west-2.pooler.supabase.com
DB_PORT=5432
DB_SSLMODE=require
CEREBRAS_API_KEY=your-cerebras-api-key
CEREBRAS_MODEL=gpt-oss-120b

frontend/.env

VITE_API_BASE_URL=http://127.0.0.1:8000
VITE_SUPABASE_URL=https://your-project-ref.supabase.co
VITE_SUPABASE_PUBLISHABLE_DEFAULT_KEY=sb_publishable_your_key

Validation Commands

Backend

cd backend
.\.venv\Scripts\python manage.py check
.\.venv\Scripts\python manage.py migrate

Frontend

cd frontend
npm run lint
npm run build

Troubleshooting

  • If frontend health status shows error, ensure Django server is running on port 8000.
  • If CORS errors appear, verify CORS_ALLOWED_ORIGINS matches your Vite host/port.
  • If npm run dev picks a different port, update frontend/.env and backend CORS settings accordingly.

LLM Endpoint (Cerebras)

After setting CEREBRAS_API_KEY, call:

POST /api/copilot/chat/
Content-Type: application/json

{
  "message": "Why is fast inference important?"
}

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors