Compare commits

..

2 Commits

Author SHA1 Message Date
6810de2583 Merge pull request 'Add simple FastAPI backend' (#2) from create-backend into main
Reviewed-on: #2
2026-01-12 11:35:47 -05:00
Luke Calladine
ce73a77783 Add simple FastAPI backend 2026-01-12 16:29:06 +00:00
4 changed files with 33 additions and 0 deletions

12
backend/docker/Dockerfile Normal file
View File

@@ -0,0 +1,12 @@
FROM python:3.13.7-slim-bookworm
WORKDIR /app
# Copy requirements and install Python dependencies
COPY ./requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Copy the app code and tests
COPY ../src ./src
CMD ["python", "src/main.py"]

2
backend/requirements.txt Normal file
View File

@@ -0,0 +1,2 @@
fastapi
uvicorn[standard]

11
backend/src/main.py Normal file
View File

@@ -0,0 +1,11 @@
from fastapi import FastAPI
app = FastAPI(title="HanchuESS Solar Backend API")
@app.get("/", tags=["Root"])
def root():
return {"message": "Welcome to the HanchuESS Solar Backend API!"}
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=8050)

8
docker-compose.yml Normal file
View File

@@ -0,0 +1,8 @@
services:
hanchuess-solar-backend:
build:
context: backend
dockerfile: docker/Dockerfile
container_name: hanchuess-solar-backend
ports:
- "8050:8050"