Speakr is a personal, self-hosted web application designed for transcribing audio recordings
Python
Reorganize repository structure for better organization and cleaner root directory
Murtaza Nasird139393c7764
diff --git a/Dockerfile b/Dockerfileindex f765b4d3..bd88f252 100644--- a/Dockerfile+++ b/Dockerfile@@ -25,7 +25,7 @@ ENV SQLALCHEMY_DATABASE_URI=sqlite:////data/instance/transcriptions.dbENV UPLOAD_FOLDER=/data/uploads# Add entrypoint script-COPY docker-entrypoint.sh /usr/local/bin/+COPY scripts/docker-entrypoint.sh /usr/local/bin/RUN chmod +x /usr/local/bin/docker-entrypoint.sh# Expose the portdiff --git a/README.md b/README.mdindex c51f1f2f..e22688f5 100644--- a/README.md+++ b/README.md@@ -292,10 +292,10 @@ Follow these steps if you want to modify the code or build the Docker image yourcd speakr```2. **Create Configuration Files:**- Copy the example files. Use `env.whisper.example` for the standard API method or `env.asr.example` for the ASR webservice method.+ Copy the example files. Use `config/env.whisper.example` for the standard API method or `config/env.asr.example` for the ASR webservice method.```bashcp docker-compose.example.yml docker-compose.yml- cp env.whisper.example .env # Or cp env.asr.example .env+ cp config/env.whisper.example .env # Or cp config/env.asr.example .env```Edit the `.env` file with your custom settings and API keys.diff --git a/env.asr.example b/config/env.asr.examplesimilarity index 100%rename from env.asr.examplerename to config/env.asr.examplediff --git a/env.whisper.example b/config/env.whisper.examplesimilarity index 100%rename from env.whisper.examplerename to config/env.whisper.examplediff --git a/deployment/setup.sh b/deployment/setup.shindex 38b484ee..5a469f4f 100755--- a/deployment/setup.sh+++ b/deployment/setup.sh@@ -10,8 +10,8 @@ sudo chown $USER:$USER /opt/transcription-appcp app.py /opt/transcription-app/cp -r templates /opt/transcription-app/cp requirements.txt /opt/transcription-app/-cp reset_db.py /opt/transcription-app/-cp create_admin.py /opt/transcription-app/+cp scripts/reset_db.py /opt/transcription-app/+cp scripts/create_admin.py /opt/transcription-app/cp .env /opt/transcription-app/ # Copy the .env file with API keys# Add SECRET_KEY to .env file if it doesn't existdiff --git a/docker-compose.example.yml b/docker-compose.example.ymlindex 96506d50..1533f0aa 100644--- a/docker-compose.example.yml+++ b/docker-compose.example.yml@@ -14,10 +14,10 @@ services:# 2. Copy the corresponding example file to .env:## For standard Whisper API:- # cp env.whisper.example .env+ # cp config/env.whisper.example .env## For a custom ASR endpoint:- # cp env.asr.example .env+ # cp config/env.asr.example .env## 3. Edit the .env file to add your API keys and settings.env_file:diff --git a/DEPLOYMENT_GUIDE.md b/docs/DEPLOYMENT_GUIDE.mdsimilarity index 100%rename from DEPLOYMENT_GUIDE.mdrename to docs/DEPLOYMENT_GUIDE.mddiff --git a/create_docs.py b/docs/create_docs.pysimilarity index 100%rename from create_docs.pyrename to docs/create_docs.pydiff --git a/create_admin.py b/scripts/create_admin.pysimilarity index 96%rename from create_admin.pyrename to scripts/create_admin.pyindex 1db4a075..3ff374de 100644--- a/create_admin.py+++ b/scripts/create_admin.py@@ -5,6 +5,9 @@ import sysimport getpassfrom email_validator import validate_email, EmailNotValidError+# Add parent directory to path for imports+sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))+# Try to import from app contexttry:from flask import current_appdiff --git a/docker-entrypoint.sh b/scripts/docker-entrypoint.shsimilarity index 93%rename from docker-entrypoint.shrename to scripts/docker-entrypoint.shindex 683169d5..decda695 100644--- a/docker-entrypoint.sh+++ b/scripts/docker-entrypoint.sh@@ -18,7 +18,7 @@ fi# Check if we need to create an admin user (regardless of whether the database exists)if [ -n "$ADMIN_USERNAME" ] && [ -n "$ADMIN_EMAIL" ] && [ -n "$ADMIN_PASSWORD" ]; thenecho "Creating admin user using environment variables..."- python docker_create_admin.py+ cd /app && python scripts/docker_create_admin.pyfi# Start the applicationdiff --git a/docker_create_admin.py b/scripts/docker_create_admin.pysimilarity index 96%rename from docker_create_admin.pyrename to scripts/docker_create_admin.pyindex b071fc45..fcfba548 100644--- a/docker_create_admin.py+++ b/scripts/docker_create_admin.py@@ -4,6 +4,9 @@ import osimport sysfrom email_validator import validate_email, EmailNotValidError+# Add parent directory to path for imports+sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))+# Try to import from app contexttry:from flask import current_appdiff --git a/migrate_docker.sh b/scripts/migrate_docker.shsimilarity index 100%rename from migrate_docker.shrename to scripts/migrate_docker.shdiff --git a/migrate_existing_recordings.py b/scripts/migrate_existing_recordings.pysimilarity index 100%rename from migrate_existing_recordings.pyrename to scripts/migrate_existing_recordings.pydiff --git a/parse_asr_json.py b/scripts/parse_asr_json.pysimilarity index 100%rename from parse_asr_json.pyrename to scripts/parse_asr_json.pydiff --git a/reset_db.py b/scripts/reset_db.pysimilarity index 98%rename from reset_db.pyrename to scripts/reset_db.pyindex e7a2db77..08f72e61 100644--- a/reset_db.py+++ b/scripts/reset_db.py@@ -5,7 +5,7 @@ import osimport sysimport shutil# Add project root to path if necessary for 'app' import-# sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))+sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))# Load environment variables in case DB path relies on them (optional here)# from dotenv import load_dotenvdiff --git a/resize_logo.py b/scripts/resize_logo.pysimilarity index 100%rename from resize_logo.pyrename to scripts/resize_logo.pydiff --git a/resize_logo.sh b/scripts/resize_logo.shsimilarity index 100%rename from resize_logo.shrename to scripts/resize_logo.shdiff --git a/update_version.py b/scripts/update_version.pysimilarity index 100%rename from update_version.pyrename to scripts/update_version.pydiff --git a/test_inquire_mode.py b/tests/test_inquire_mode.pysimilarity index 100%rename from test_inquire_mode.pyrename to tests/test_inquire_mode.pydiff --git a/test_json_fix.py b/tests/test_json_fix.pysimilarity index 100%rename from test_json_fix.pyrename to tests/test_json_fix.pydiff --git a/test_json_preprocessing.py b/tests/test_json_preprocessing.pysimilarity index 100%rename from test_json_preprocessing.pyrename to tests/test_json_preprocessing.pydiff --git a/test_json_standalone.py b/tests/test_json_standalone.pysimilarity index 100%rename from test_json_standalone.pyrename to tests/test_json_standalone.py