diff --git a/MinuteMate/Dockerfile b/MinuteMate/back/Dockerfile similarity index 100% rename from MinuteMate/Dockerfile rename to MinuteMate/back/Dockerfile diff --git a/MinuteMate/back/main.py b/MinuteMate/back/main.py new file mode 100644 index 00000000..a300dabb --- /dev/null +++ b/MinuteMate/back/main.py @@ -0,0 +1,38 @@ +from fastapi import FastAPI, HTTPException +from pydantic import BaseModel + +# Initialize the FastAPI app +app = FastAPI( + title="MinuteMate Propmpt & Response API", + description="A simple API that takes a text prompt uses ", + version="1.0.0" + +) + +# Define the request schema +class PromptRequest(BaseModel): + prompt: str + +# Define the response schema +class PromptResponse(BaseModel): + response: str + +# Your Python processing logic +def process_prompt(prompt: str) -> str: + response = '' + + #Call whatever code we need to here + + return response + +# API endpoint +@app.post("/process-prompt", response_model=PromptResponse) +async def process_prompt_endpoint(request: PromptRequest): + """ + Process the prompt and return the response + """ + try: + result = process_prompt(request.prompt) + return PromptResponse(result=result) + except Exception as e: + raise HTTPException(status_code=500, detail=str(e)) diff --git a/MinuteMate/back/requirements.txt b/MinuteMate/back/requirements.txt new file mode 100644 index 00000000..06eaddd2 --- /dev/null +++ b/MinuteMate/back/requirements.txt @@ -0,0 +1,9 @@ +# Necessary for the API +fastapi[standard] + +# Necessary for the API +# Handles data validation, parsing, error handling, conversions, type hints +pydantic + +# Necessary for web stuff +uvicorn \ No newline at end of file diff --git a/MinuteMate/front/Dockerfile b/MinuteMate/front/Dockerfile new file mode 100644 index 00000000..ecc035d7 --- /dev/null +++ b/MinuteMate/front/Dockerfile @@ -0,0 +1,6 @@ +FROM python:3.11-slim +WORKDIR /App +COPY . /App +RUN python -m pip install -r requirements.txt +EXPOSE 8000 +CMD [" ", "start","--port","8002","--host","0.0.0.0"] diff --git a/MinuteMate/App/app.py b/MinuteMate/front/app.py similarity index 100% rename from MinuteMate/App/app.py rename to MinuteMate/front/app.py diff --git a/MinuteMate/App/main.py b/MinuteMate/front/main.py similarity index 100% rename from MinuteMate/App/main.py rename to MinuteMate/front/main.py diff --git a/MinuteMate/App/requirements.txt b/MinuteMate/front/requirements.txt similarity index 100% rename from MinuteMate/App/requirements.txt rename to MinuteMate/front/requirements.txt