Backend API for the Transcript Parser application.
- Node.js 20+
- PostgreSQL 15+ (or use Docker)
- FFmpeg installed on your system
- Gemini API key
- Install dependencies:
cd server
npm install- Create
.envfile from.env.example:
copy .env.example .env- Update
.envwith your credentials:
DATABASE_URL: Your PostgreSQL connection stringJWT_SECRET: A secure random string for JWT tokensGEMINI_API_KEY: Your Google Gemini API key
- Create database:
# Using psql
createdb transcript_parser
# Or using Docker
docker run --name postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=transcript_parser -p 5432:5432 -d postgres:15-alpine- Generate and run migrations:
npm run db:generate
npm run db:pushnpm run devnpm run build
npm startPOST /api/auth/register- Register new userPOST /api/auth/login- Login userGET /api/auth/me- Get current user (requires auth)
POST /api/transcripts/upload- Upload video for transcription (requires auth)GET /api/transcripts- List all transcripts (requires auth)GET /api/transcripts/:id- Get transcript details (requires auth)DELETE /api/transcripts/:id- Delete transcript (requires auth)PATCH /api/transcripts/:id/entry/:entryId- Update transcript entry (requires auth)
| Variable | Description | Default |
|---|---|---|
| PORT | Server port | 3000 |
| NODE_ENV | Environment | development |
| DATABASE_URL | PostgreSQL connection string | Required |
| JWT_SECRET | Secret for JWT tokens | Required |
| GEMINI_API_KEY | Google Gemini API key | Required |
| UPLOAD_DIR | Upload directory path | ./uploads |
| MAX_FILE_SIZE | Max upload size in bytes | 104857600 (100MB) |
| CORS_ORIGIN | CORS allowed origin | http://localhost:5173 |
Run with Docker Compose:
cd ..
docker-compose upThis will start:
- PostgreSQL database
- Backend API server
- Frontend application
The server requires FFmpeg for audio extraction from video files.
Download from https://ffmpeg.org/download.html
brew install ffmpegsudo apt-get install ffmpegserver/
├── src/
│ ├── config/ # Configuration files
│ ├── controllers/ # Request handlers
│ ├── middleware/ # Express middleware
│ ├── models/ # Database schemas
│ ├── routes/ # API routes
│ ├── services/ # Business logic
│ └── index.ts # Server entry point
├── uploads/ # Uploaded files
│ ├── videos/ # Video files
│ └── audio/ # Extracted audio
└── drizzle/ # Database migrations
- Ensure PostgreSQL is running
- Check DATABASE_URL format:
postgresql://user:password@host:port/database
- Ensure FFmpeg is installed and in PATH
- Test with:
ffmpeg -version
- Check UPLOAD_DIR exists and has write permissions
- Verify MAX_FILE_SIZE allows your file
MIT