Final push: Correct directory structure and content

This commit is contained in:
Agent
2026-05-17 10:04:27 +00:00
commit 203518ac66
5 changed files with 40 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, declarative_base
SQLALCHEMY_DATABASE_URL = "postgresql://user:pass@db:5432/notes"
engine = create_engine(SQLALCHEMY_DATABASE_URL)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()
+12
View File
@@ -0,0 +1,12 @@
version: "3.8"
services:
app:
build: .
ports: ["8000:8000"]
depends_on: [db]
db:
image: postgres:13
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: pass
POSTGRES_DB: notes
+1
View File
@@ -0,0 +1 @@
<!DOCTYPE html><html><head><script src="https://cdn.tailwindcss.com"></script></head><body class="bg-yellow-50 p-10"><h1 class="text-2xl font-bold">旅行地のノート</h1></body></html>
+13
View File
@@ -0,0 +1,13 @@
from fastapi import FastAPI, Request
from fastapi.responses import HTMLResponse
import uvicorn
app = FastAPI()
@app.get("/", response_class=HTMLResponse)
def read_root():
with open("index.html", "r") as f:
return f.read()
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=8000)
+7
View File
@@ -0,0 +1,7 @@
from sqlalchemy import Column, Integer, String
from database import Base
class Note(Base):
__tablename__ = "notes"
id = Column(Integer, primary_key=True, index=True)
content = Column(String)