This project was created for Software Engineering Project at University of Helsinki.
Backend is intended to be used with the Flutter frontend
git clone git@github.com:AI-Smarties/back.gitcd backgit switch devpython3 -m venv venv
source venv/bin/activatepython -m venv venv
.\venv\Scripts\activatepip install -r requirements.txtThe application uses PostgreSQL.
docker compose up -dor
docker-compose up -dThis starts a PostgreSQL container with the correct configuration. You can access the database at localhost:5432.
The application will automatically connect to localhost when running locally (environment variables for database are not required for local development).
The backend uses Google Cloud Speech-to-Text, Vertex AI API, Firebase and the Application Default Credentials (ADC) method.
Do these first in your web browser:
-
Create a Project: Go to Google Cloud Console, create a new project, and copy the Project ID (e.g., smarties-backend-v2).
-
Activate Free Trial: Click the "Activate" banner at the top of the page to claim your free credits.
-
Enable the API: Search for
"Cloud Speech-to-Text API"in the top search bar and click Enable. Do the same for"Vertex AI API"
Run these commands in your terminal:
-
Install GCloud CLI: Download and install here.
-
Login to your Google account
gcloud auth application-default login
-
Link to Project: Run this command (replace [PROJECT_ID] with the ID you copied in Step 1):
gcloud auth application-default set-quota-project [PROJECT_ID]
create the following .env file in root dir
FIREBASE_PROJECT_ID=[PROJECT_ID]fastapi run src/main.py --host 0.0.0.0When you return to coding, activate the virtual environment and check for updates:
- Start database:
docker-compose up -d(if using Docker Compose) - Activate environment:
source venv/bin/activate - Fetch latest changes:
git pull origin dev - Start server:
fastapi dev src/main.py
src/main.py– FastAPI application and WebSocket endpointsrc/asr.py– Streaming ASR (Google Speech-to-Text)src/db.py– Database connection configurationsrc/models.py– SQLAlchemy database modelssrc/auth.py— Firebase authentication and token verificationsrc/gemini_live.py— Gemini Live API integration for real-time AI responsessrc/gemini_tools.py— Tool functions callable by Gemini during conversationssrc/memory_extractor.py— Extracts key data (budgets, deadlines) from transcripts and stores them to vector databasesrc/summary_service.py— Generates meeting summaries using Geminisrc/context_service.py— Builds structured context from calendar data for Geminisrc/db_utils.py— Vector DB operations (store, search, retrieve embeddings)requirements.txt– Dependenciesdocker-compose.yaml– Local PostgreSQL setupmanifests/– Deployment configurations