diff --git a/.streamlit/config.toml b/app/.streamlit/config.toml similarity index 100% rename from .streamlit/config.toml rename to app/.streamlit/config.toml diff --git a/Dockerfile b/app/Dockerfile similarity index 100% rename from Dockerfile rename to app/Dockerfile diff --git a/app.py b/app/index..py similarity index 100% rename from app.py rename to app/index..py diff --git a/pages/audiocast.py b/app/pages/audiocast.py similarity index 100% rename from pages/audiocast.py rename to app/pages/audiocast.py diff --git a/src/__init__.py b/app/src/__init__.py similarity index 100% rename from src/__init__.py rename to app/src/__init__.py diff --git a/src/env_var.py b/app/src/env_var.py similarity index 100% rename from src/env_var.py rename to app/src/env_var.py diff --git a/src/services/__init__.py b/app/src/services/__init__.py similarity index 100% rename from src/services/__init__.py rename to app/src/services/__init__.py diff --git a/src/services/admin_sdk.py b/app/src/services/admin_sdk.py similarity index 100% rename from src/services/admin_sdk.py rename to app/src/services/admin_sdk.py diff --git a/src/services/anthropic_client.py b/app/src/services/anthropic_client.py similarity index 100% rename from src/services/anthropic_client.py rename to app/src/services/anthropic_client.py diff --git a/src/services/elevenlabs_client.py b/app/src/services/elevenlabs_client.py similarity index 100% rename from src/services/elevenlabs_client.py rename to app/src/services/elevenlabs_client.py diff --git a/src/services/firestore_sdk.py b/app/src/services/firestore_sdk.py similarity index 100% rename from src/services/firestore_sdk.py rename to app/src/services/firestore_sdk.py diff --git a/src/services/gemini_client.py b/app/src/services/gemini_client.py similarity index 100% rename from src/services/gemini_client.py rename to app/src/services/gemini_client.py diff --git a/src/services/openai_client.py b/app/src/services/openai_client.py similarity index 100% rename from src/services/openai_client.py rename to app/src/services/openai_client.py diff --git a/src/services/storage.py b/app/src/services/storage.py similarity index 100% rename from src/services/storage.py rename to app/src/services/storage.py diff --git a/src/uis/__init__.py b/app/src/uis/__init__.py similarity index 100% rename from src/uis/__init__.py rename to app/src/uis/__init__.py diff --git a/src/uis/audioui.py b/app/src/uis/audioui.py similarity index 100% rename from src/uis/audioui.py rename to app/src/uis/audioui.py diff --git a/src/uis/chatui.py b/app/src/uis/chatui.py similarity index 100% rename from src/uis/chatui.py rename to app/src/uis/chatui.py diff --git a/src/utils/__init__.py b/app/src/utils/__init__.py similarity index 100% rename from src/utils/__init__.py rename to app/src/utils/__init__.py diff --git a/src/utils/audio_manager.py b/app/src/utils/audio_manager.py similarity index 100% rename from src/utils/audio_manager.py rename to app/src/utils/audio_manager.py diff --git a/src/utils/audio_manager_utils.py b/app/src/utils/audio_manager_utils.py similarity index 100% rename from src/utils/audio_manager_utils.py rename to app/src/utils/audio_manager_utils.py diff --git a/src/utils/audio_synthesizer.py b/app/src/utils/audio_synthesizer.py similarity index 100% rename from src/utils/audio_synthesizer.py rename to app/src/utils/audio_synthesizer.py diff --git a/src/utils/audio_to_video.py b/app/src/utils/audio_to_video.py similarity index 100% rename from src/utils/audio_to_video.py rename to app/src/utils/audio_to_video.py diff --git a/src/utils/audiocast_request.py b/app/src/utils/audiocast_request.py similarity index 100% rename from src/utils/audiocast_request.py rename to app/src/utils/audiocast_request.py diff --git a/src/utils/chat_request.py b/app/src/utils/chat_request.py similarity index 100% rename from src/utils/chat_request.py rename to app/src/utils/chat_request.py diff --git a/src/utils/chat_thread.py b/app/src/utils/chat_thread.py similarity index 100% rename from src/utils/chat_thread.py rename to app/src/utils/chat_thread.py diff --git a/src/utils/chat_utils.py b/app/src/utils/chat_utils.py similarity index 100% rename from src/utils/chat_utils.py rename to app/src/utils/chat_utils.py diff --git a/src/utils/clean_tss_markup.py b/app/src/utils/clean_tss_markup.py similarity index 100% rename from src/utils/clean_tss_markup.py rename to app/src/utils/clean_tss_markup.py diff --git a/src/utils/decorators.py b/app/src/utils/decorators.py similarity index 100% rename from src/utils/decorators.py rename to app/src/utils/decorators.py diff --git a/src/utils/generate_speech_utils.py b/app/src/utils/generate_speech_utils.py similarity index 100% rename from src/utils/generate_speech_utils.py rename to app/src/utils/generate_speech_utils.py diff --git a/src/utils/main_utils.py b/app/src/utils/main_utils.py similarity index 100% rename from src/utils/main_utils.py rename to app/src/utils/main_utils.py diff --git a/src/utils/prompt_templates/__init__.py b/app/src/utils/prompt_templates/__init__.py similarity index 100% rename from src/utils/prompt_templates/__init__.py rename to app/src/utils/prompt_templates/__init__.py diff --git a/src/utils/prompt_templates/source_content_prompt.py b/app/src/utils/prompt_templates/source_content_prompt.py similarity index 100% rename from src/utils/prompt_templates/source_content_prompt.py rename to app/src/utils/prompt_templates/source_content_prompt.py diff --git a/src/utils/prompt_templates/streamline_audio.py b/app/src/utils/prompt_templates/streamline_audio.py similarity index 100% rename from src/utils/prompt_templates/streamline_audio.py rename to app/src/utils/prompt_templates/streamline_audio.py diff --git a/src/utils/prompt_templates/tts_prompt.py b/app/src/utils/prompt_templates/tts_prompt.py similarity index 100% rename from src/utils/prompt_templates/tts_prompt.py rename to app/src/utils/prompt_templates/tts_prompt.py diff --git a/src/utils/render_audiocast.py b/app/src/utils/render_audiocast.py similarity index 100% rename from src/utils/render_audiocast.py rename to app/src/utils/render_audiocast.py diff --git a/src/utils/render_audiocast_utils.py b/app/src/utils/render_audiocast_utils.py similarity index 100% rename from src/utils/render_audiocast_utils.py rename to app/src/utils/render_audiocast_utils.py diff --git a/src/utils/render_chat.py b/app/src/utils/render_chat.py similarity index 100% rename from src/utils/render_chat.py rename to app/src/utils/render_chat.py diff --git a/src/utils/session_manager.py b/app/src/utils/session_manager.py similarity index 100% rename from src/utils/session_manager.py rename to app/src/utils/session_manager.py diff --git a/src/utils/session_state.py b/app/src/utils/session_state.py similarity index 100% rename from src/utils/session_state.py rename to app/src/utils/session_state.py diff --git a/src/utils/waveform_utils.py b/app/src/utils/waveform_utils.py similarity index 100% rename from src/utils/waveform_utils.py rename to app/src/utils/waveform_utils.py diff --git a/tests/__init__.py b/app/tests/__init__.py similarity index 100% rename from tests/__init__.py rename to app/tests/__init__.py diff --git a/tests/test_speech_gen.py b/app/tests/test_speech_gen.py similarity index 100% rename from tests/test_speech_gen.py rename to app/tests/test_speech_gen.py diff --git a/requirements.txt b/requirements.txt index 834ebf4..264fa56 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,8 @@ +fastapi pydantic +fastapi-utilities +uvicorn +gunicorn streamlit httpx diff --git a/server/src/__init__.py b/server/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/server/src/main.py b/server/src/main.py new file mode 100644 index 0000000..294deda --- /dev/null +++ b/server/src/main.py @@ -0,0 +1,33 @@ +from contextlib import asynccontextmanager + +from fastapi import FastAPI +from fastapi.middleware.cors import CORSMiddleware + + +@asynccontextmanager +async def lifespan(_app: FastAPI): + # --- + yield + # --- + + +app = FastAPI( + title="Audiora API", + description="Listen to anything, anytime, leveraging AI-generated audio.", + version="1.0.0", + lifespan=lifespan, +) + +app.add_middleware( + CORSMiddleware, + allow_origins=["*"], + allow_credentials=True, + allow_methods=["*"], + allow_headers=["*"], + expose_headers=["*"], +) + + +@app.get("/") +async def root(): + return {"message": "Hello World"}