Skip to content

Commit 08f5ce9

Browse files
authored
Merge pull request #1 from lhutt-hackathon/manager
Manager
2 parents 05d91fb + d7bff0c commit 08f5ce9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+15439
-1059
lines changed

.env.template

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ S3_ACCESS_KEY=rps_...
77
S3_SECRET_KEY=user_...
88

99
RUNPROD_KEY=rpa_...
10+
11+
HUGGINGFACE_API_KEY=hf_...
File renamed without changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ WORKDIR /app
2424
ENV PATH="/.venv/bin:$PATH"
2525
ENV PYTHONUNBUFFERED=1
2626

27+
RUN prisma generate --schema app/prisma/schema.prisma
2728
CMD ["uvicorn", "app.app:app", "--host", "0.0.0.0", "--port", "8000"]
File renamed without changes.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from fastapi import FastAPI as FastAPIBase
22

3+
from app.lifespan import lifespan
34

45
class FastAPI(FastAPIBase):
56
def _setup_routers(self) -> None:
@@ -12,4 +13,4 @@ def setup(self) -> None:
1213
self._setup_routers()
1314

1415

15-
app = FastAPI()
16+
app = FastAPI(lifespan=lifespan)

api/app/config/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from .settings import settings
2+
3+
4+
__all__ = ["settings"]

api/app/config/settings.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from typing import Literal
2+
3+
from pydantic import Field, SecretStr
4+
from pydantic_settings import BaseSettings
5+
6+
7+
class Settings(BaseSettings):
8+
env: Literal["dev", "prod"] = Field(
9+
default="dev",
10+
)
11+
12+
session_secret: SecretStr = Field()
13+
session_cookie_name: str = "session"
14+
session_max_age_seconds: int = 60 * 60 * 24 * 7 # 7 days
15+
session_same_site: Literal["lax", "strict", "none"] = "lax"
16+
cookie_secure: bool = False
17+
return_path: str = "http://localhost:3000/"
18+
19+
20+
settings = Settings()

0 commit comments

Comments
 (0)