Skip to content
smitsp11Public

About

smits donna

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

# Sonna Backend Installation Guide

This document explains how to set up and run the Sonna backend from scratch.

---

# 1. Prerequisites

Make sure you have the following installed:
- Python 3.10 or newer (recommended: 3.11)
- Git
- PostgreSQL or a Supabase database
- (Optional) Redis, if you plan to use Celery for background jobs

---

# 2. Clone the Repository

git clone https://github.com/your-username/sonna.git  
cd sonna/backend

---

# 3. Create a Virtual Environment

python -m venv .venv  
source .venv/bin/activate   # macOS/Linux  
# OR  
.venv\Scripts\activate      # Windows

---

# 4. Upgrade Pip

pip install --upgrade pip

---

# 5. Install Dependencies

pip install -r requirements.txt

---

# 6. Configure Environment Variables

Copy the example environment file and fill in your API keys:

cp .env.example .env

Then edit `.env` and add your actual API keys:
- **GEMINI_API_KEY**: Get from https://makersuite.google.com/app/apikey
- **DATABASE_URL**: Your PostgreSQL or Supabase connection string
- **PINECONE_API_KEY**: Get from https://www.pinecone.io/ (for memory features)
- **ELEVENLABS_API_KEY**: Get from https://elevenlabs.io/ (for voice synthesis)
- **REDIS_URL**: Redis connection (default: redis://localhost:6379/0)

---

# 7. Start Required Services

## Start Redis (for Celery)
redis-server

## Start Celery Worker (for reminders)
celery -A backend.tasks.reminder_tasks worker --loglevel=info

## Start Celery Beat (for periodic tasks)
celery -A backend.tasks.reminder_tasks beat --loglevel=info

---

# 8. Run the Application

From the root folder of the project:

uvicorn backend.app:app --reload

Expected output:
INFO:     Uvicorn running on http://127.0.0.1:8000  
INFO:     Application startup complete.  
INFO:     Faster-Whisper model initialized successfully.  
INFO:     Initialized Gemini LLM agent with model: gemini-pro  

You can now visit:  
http://127.0.0.1:8000/docs

About

smits donna

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages