The Ito transcription server provides gRPC-based speech-to-text services for the Ito voice assistant application. This server handles audio transcription, user data management, and API authentication.
- Node.js 20+ with Bun package manager
- Docker & Docker Compose (for local PostgreSQL database)
- GROQ API Key (for transcription services)
- Auth0 Account (optional, for authentication)
Create your environment configuration:
# Copy the example environment file
cp .env.example .envAdd the following configuration to your .env file:
# Database Configuration
DB_HOST=localhost
DB_PORT=5432
DB_USER=devuser
DB_PASS=devpass
DB_NAME=devdb
# Storage Configuration (S3/MinIO)
BLOB_STORAGE_BUCKET=ito-audio-storage
S3_ENDPOINT=http://localhost:9000
S3_ACCESS_KEY_ID=minioadmin
S3_SECRET_ACCESS_KEY=minioadmin
S3_FORCE_PATH_STYLE=true
# GROQ API Configuration (Required)
GROQ_API_KEY=your_groq_api_key_here
# CEREBRAS API Key (Not Required)
CEREBRAS_API_KEY=your_CEREBRAS_API_KEY_here
# Authentication (Optional - set to false for local development)
REQUIRE_AUTH=false
AUTH0_DOMAIN=your_auth0_domain.auth0.com
AUTH0_AUDIENCE=http://localhost:3000
# Billing (Stripe)
STRIPE_SECRET_KEY=sk_test_xxx
STRIPE_WEBHOOK_SECRET=whsec_xxx
STRIPE_PRICE_ID=price_xxx
APP_PROTOCOL=ito-dev
STRIPE_PUBLIC_BASE_URL=http://localhost:3000- Visit console.groq.com
- Create an account or sign in
- Navigate to API Keys section
- Create a new API key
- Copy the key to your
.envfile asGROQ_API_KEY
For production or authenticated development:
- Create a Auth0 account
- Create a new application (API type)
- Copy Domain and Audience to your
.envfile - Set
REQUIRE_AUTH=truein your.env
bun installStart all local services (PostgreSQL + MinIO for S3-compatible storage):
# Start all local services
bun run local-services-up
# Run database migrations
bun run db:migrateThis will start:
- PostgreSQL on port 5432
- MinIO S3 on port 9000 (API) and 9001 (Console)
- Auto-creates the
ito-audio-storagebucket
# Start the server with hot reload
bun run devThe server will start on http://localhost:3000
bun run dev # Start development server with hot reload
bun run start # Start production server
bun run build # Build TypeScript to JavaScript# Services Management
bun run local-services-up # Start PostgreSQL + MinIO
bun run local-services-down # Stop all local services
bun run local-db-up # Start only PostgreSQL
bun run local-s3-up # Start only MinIO + create bucket
bun run local-s3-down # Stop MinIO
# Database Operations
bun run db:migrate # Run migrations up
bun run db:migrate:down # Run migrations down
bun run db:migrate:create <name> # Create new migrationbun run proto:gen # Generate both server and client types
bun run proto:gen:server # Generate server types only
bun run proto:gen:client # Generate client types onlybun run test-client # Run gRPC client tests- Fastify Server: HTTP/gRPC server with Auth0 integration
- Connect RPC: Type-safe gRPC implementation
- PostgreSQL: Primary database for user data and metadata
- S3/MinIO: Audio file storage (local development uses MinIO)
- GROQ SDK: AI transcription service integration
TranscribeFile: Single file transcriptionTranscribeStream: Real-time streaming transcription
- Create, read, update, delete user notes
- Automatic transcription saving
- Custom vocabulary management
- Pronunciation corrections
- Dictation session tracking
- Usage analytics
- Complete user data deletion
- Privacy compliance
| Variable | Required | Default | Description |
|---|---|---|---|
DB_HOST |
Yes | localhost |
PostgreSQL host |
DB_PORT |
Yes | 5432 |
PostgreSQL port |
DB_USER |
Yes | - | Database username |
DB_PASS |
Yes | - | Database password |
DB_NAME |
Yes | - | Database name |
BLOB_STORAGE_BUCKET |
Yes | - | S3 bucket name for audio storage |
S3_ENDPOINT |
No | - | S3 endpoint (for MinIO/local development) |
S3_ACCESS_KEY_ID |
No | - | S3 access key (for MinIO/local development) |
S3_SECRET_ACCESS_KEY |
No | - | S3 secret key (for MinIO/local development) |
S3_FORCE_PATH_STYLE |
No | false |
Use path-style S3 URLs (required for MinIO) |
GROQ_API_KEY |
Yes | - | GROQ API key for transcription |
CEREBRAS_API_KEY |
No | - | CEREBRAS API key for reasoning |
REQUIRE_AUTH |
No | false |
Enable Auth0 authentication |
AUTH0_DOMAIN |
No* | - | Auth0 domain (*required if auth enabled) |
AUTH0_AUDIENCE |
No* | - | Auth0 audience (*required if auth enabled) |
PostgreSQL Database: The server uses PostgreSQL with automatic migrations. The database schema includes:
- users: User profiles and settings
- notes: Transcribed text and metadata
- interactions: Dictation sessions (with S3 audio references)
- dictionary: Custom vocabulary
- llm_settings: User-specific LLM configuration
S3 Storage: Audio files are stored in S3 (or MinIO for local development) with the following structure:
- Bucket: Configured via
BLOB_STORAGE_BUCKET - Keys:
raw-audio/{userId}/{audioUuid} - Format: Raw audio bytes (no file extensions)
Local Development Setup:
- MinIO Console: http://localhost:9001 (admin/admin)
- MinIO S3 API: http://localhost:9000
- Auto-bucket creation:
ito-audio-storagecreated automatically
Authentication is optional for local development. When enabled:
- All gRPC endpoints require valid JWT tokens
- Auth0 provides user identity and authorization
- User context is automatically injected into requests
# Build and start with Docker Compose
docker compose up -d
# Run migrations
docker compose exec ito-grpc-server bun run db:migrateThe server includes AWS CDK infrastructure:
cd infra
npm install
cdk deploy --allThis deploys:
- ECS Fargate service
- Application Load Balancer
- Aurora Serverless PostgreSQL
- Lambda functions for migrations
curl http://localhost:3000/# Run the test client
bun run test-clientTest individual services using the included test client or tools like:
# Check if PostgreSQL & MinIO are running
bun run local-services-up
# Verify database credentials in .env
# Ensure DB_HOST, DB_PORT, DB_USER, DB_PASS are correct# Verify API key is valid
# Check GROQ_API_KEY in .env file
# Ensure you have credits in your GROQ account# Check if MinIO is running
bun run local-s3-up
# Reset MinIO data (WARNING: destroys stored files)
docker compose down -v
bun run local-services-up
# Manually setup MinIO bucket
./scripts/setup-minio.sh
# Verify S3 configuration in .env
# Ensure S3_ENDPOINT, S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY are set# Reset migrations (WARNING: destroys data)
bun run local-services-down
bun run local-services-up
bun run db:migrate# For local development, disable auth
echo "REQUIRE_AUTH=false" >> .env
# For production, ensure AUTH0_DOMAIN and AUTH0_AUDIENCE are setIf ports 5432, 9000, or 9001 are in use:
- Modify ports in
docker-compose.yml - Update corresponding environment variables
Enable verbose logging:
NODE_ENV=development bun run devFor local development, access the MinIO console at http://localhost:9001:
- Username:
minioadmin - Password:
minioadmin
Use the console to:
- View stored audio files
- Monitor storage usage
- Manage buckets and objects
- Debug S3 operations
Check server logs for detailed error information:
- Database connection issues
- API authentication failures
- Transcription service errors
- Migration problems
- S3 storage operations
The API is defined in src/ito.proto. Key services:
service ItoService {
// Transcription
rpc TranscribeFile(TranscribeFileRequest) returns (TranscriptionResponse);
rpc TranscribeStream(stream AudioChunk) returns (TranscriptionResponse);
// Data Management
rpc CreateNote(CreateNoteRequest) returns (Note);
rpc ListNotes(ListNotesRequest) returns (ListNotesResponse);
// ... more services
}The Ito desktop app automatically connects to localhost:3000. Ensure the server is running before starting the desktop application.
- Fork and clone the repository
- Create feature branch from
dev - Set up development environment following this guide
- Make changes with appropriate tests
- Submit pull request with clear description
- Follow TypeScript best practices
- Add migrations for schema changes
- Test gRPC endpoints thoroughly
- Update documentation for API changes
- Consider backwards compatibility
- Issues: GitHub Issues
- Documentation: Main README
- Server Logs: Check console output for debugging information