Skip to content

This project was designed by Claude Code to record voice recordings to a local database. Additionally, it uses a new Plugin to generate some documentation automatically.

Notifications You must be signed in to change notification settings

MaxGrosshandler/voice-recorder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Voice Recording App

A web-based audio recording application with PostgreSQL database storage. Record, save, download, and manage audio files directly from your browser.

Features

  • 🎤 Real-time audio recording from your microphone
  • 💾 Save recordings to PostgreSQL database
  • 📝 Add descriptions to your recordings
  • ⏱️ Track recording duration
  • 📥 Download recorded audio files
  • 📋 View all saved recordings
  • 🗑️ Delete recordings
  • 📊 File size tracking

Prerequisites

  • Node.js (v14 or higher)
  • Docker and Docker Compose
  • Modern web browser with microphone support

Setup Instructions

1. Start PostgreSQL Database

docker-compose up -d

This will start a PostgreSQL container with the following credentials:

  • User: postgres
  • Password: postgres
  • Database: voice_recordings
  • Port: 5432

Verify the container is running:

docker ps

2. Install Dependencies

npm install

3. Start the Server

For development:

npm run dev

For production:

npm start

The server will start on http://localhost:3000

4. Access the Application

Open your browser and navigate to:

http://localhost:3000

Project Structure

VoiceRecording/
├── server.js                 # Express server and API routes
├── package.json             # Dependencies
├── .env                     # Environment variables
├── docker-compose.yml       # PostgreSQL Docker configuration
├── public/
│   ├── index.html          # Frontend UI
│   └── app.js              # Frontend JavaScript logic
├── uploads/                # Audio file storage (created automatically)
└── README.md              # This file

Database Schema

The application automatically creates a recordings table with the following structure:

CREATE TABLE recordings (
    id SERIAL PRIMARY KEY,
    filename VARCHAR(255) NOT NULL,
    file_size INTEGER NOT NULL,
    duration FLOAT,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    description TEXT
);

API Endpoints

Get All Recordings

GET /api/recordings

Get Single Recording

GET /api/recordings/:id

Upload Audio Recording

POST /api/recordings
Content-Type: multipart/form-data

Body:
- audio: WAV file
- duration: Recording duration in seconds (optional)
- description: Recording description (optional)

Download Audio File

GET /api/download/:filename

Delete Recording

DELETE /api/recordings/:id

Health Check

GET /api/health

Configuration

Edit .env file to customize settings:

PORT=3000
DB_USER=postgres
DB_PASSWORD=postgres
DB_HOST=localhost
DB_PORT=5432
DB_NAME=voice_recordings

Troubleshooting

Microphone Not Detected

  • Ensure your browser has permission to access the microphone
  • Check browser settings and allow microphone access for localhost
  • Some browsers require HTTPS for getUserMedia (except localhost)

Database Connection Error

  • Verify PostgreSQL container is running: docker ps
  • Check container logs: docker logs voice_recordings_db
  • Ensure credentials in .env match docker-compose.yml

Port 5432 Already in Use

  • Change the port in docker-compose.yml: "5433:5432"
  • Update DB_PORT in .env to match

Stopping the Application

Stop the server:

# Press Ctrl+C in the terminal

Stop the database:

docker-compose down

To also remove the database volume:

docker-compose down -v

Browser Support

  • Chrome 49+
  • Firefox 25+
  • Safari 14.1+
  • Edge 79+

Notes

  • Audio files are stored in the uploads/ directory and referenced in the database
  • Each recording is automatically assigned a unique filename
  • The application provides a responsive design for mobile devices
  • All recordings are timestamped for easy tracking

Future Enhancements

  • Audio format conversion (MP3, OGG, etc.)
  • Recording playback visualization
  • Advanced search and filtering
  • Recording tags/categories
  • Batch operations
  • Cloud storage integration

License

MIT

About

This project was designed by Claude Code to record voice recordings to a local database. Additionally, it uses a new Plugin to generate some documentation automatically.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published