Skip to content

Commit d3e090f

Browse files
committed
2025.12.23/13:53
1 parent eadcf5c commit d3e090f

13 files changed

Lines changed: 113 additions & 29 deletions

File tree

.env

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,35 @@ FRONTEND_HOST=http://localhost:5173
1111
# FRONTEND_HOST=https://dashboard.example.com
1212

1313
# Environment: local, staging, production
14-
ENVIRONMENT=local
14+
ENVIRONMENT=staging
1515

1616
PROJECT_NAME="Full Stack FastAPI Project"
1717
STACK_NAME=full-stack-fastapi-project
1818

1919
# Backend
20-
BACKEND_CORS_ORIGINS="http://localhost,http://localhost:5173,https://localhost,https://localhost:5173,http://localhost.tiangolo.com"
21-
SECRET_KEY=changethis
20+
BACKEND_CORS_ORIGINS="http://localhost,http://localhost:5173,https://localhost,https://localhost:5173,http://localhost.tiangolo.com,https://admin.jprq.live,http://0.0.0.0:5173,https://dashboard.jprq.live,https://www.vita-balans.uz"
21+
SECRET_KEY=krf2FS-02NVW7STU8CHDMKvv47Ylb82hamC0MPNTimc
2222
FIRST_SUPERUSER=admin@example.com
23-
FIRST_SUPERUSER_PASSWORD=changethis
23+
FIRST_SUPERUSER_PASSWORD=krf2FS-02NVW7STU8CHDMKvv47Ylb82hamC0MPNTimc
2424

2525
# Emails
26-
SMTP_HOST=
27-
SMTP_USER=
28-
SMTP_PASSWORD=
29-
EMAILS_FROM_EMAIL=info@example.com
26+
SMTP_HOST=smtp.gmail.com
27+
SMTP_USER=goldendevuz@gmail.com
28+
SMTP_PASSWORD="rvgm etbm fkyx scvu"
29+
EMAILS_FROM_EMAIL=yunusovabdulmajid@gmail.com
3030
SMTP_TLS=True
3131
SMTP_SSL=False
3232
SMTP_PORT=587
3333

3434
# Postgres
35-
POSTGRES_SERVER=localhost
35+
POSTGRES_SERVER=db
3636
POSTGRES_PORT=5432
37-
POSTGRES_DB=app
38-
POSTGRES_USER=postgres
39-
POSTGRES_PASSWORD=changethis
37+
POSTGRES_DB=vita
38+
POSTGRES_USER=abdulmajid
39+
POSTGRES_PASSWORD=krf2FS-02NVW7STU8CHDMKvv47Ylb82hamC0MPNTimc
4040

41-
SENTRY_DSN=
41+
SENTRY_DSN=https://93204ca013193712bdb793fdf59a8b16@o4508747412471808.ingest.de.sentry.io/4510582902554704
4242

4343
# Configure these with your own Docker registry images
44-
DOCKER_IMAGE_BACKEND=backend
45-
DOCKER_IMAGE_FRONTEND=frontend
44+
DOCKER_IMAGE_BACKEND=vita-backend
45+
DOCKER_IMAGE_FRONTEND=vita-frontend

.idea/.gitignore

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/2full-stack-fastapi-template.iml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.10
1+
FROM python:3.11.8-slim
22

33
ENV PYTHONUNBUFFERED=1
44

backend/app/api/routes/utils.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
from fastapi import APIRouter, Depends
1+
from fastapi import APIRouter, Depends, status
2+
from fastapi.responses import JSONResponse
23
from pydantic.networks import EmailStr
34

45
from app.api.deps import get_current_active_superuser
56
from app.models import Message
67
from app.utils import generate_test_email, send_email
78

8-
router = APIRouter(prefix="/utils", tags=["utils"])
9+
router = APIRouter(prefix="", tags=["utils"])
910

1011

1112
@router.post(
@@ -25,7 +26,16 @@ def test_email(email_to: EmailStr) -> Message:
2526
)
2627
return Message(message="Test email sent")
2728

29+
@router.get("/health-check", response_class=JSONResponse, status_code=status.HTTP_200_OK, tags=["Health"])
30+
async def health_check():
31+
"""
32+
Health check endpoint to verify that the service is running.
33+
34+
Returns:
35+
JSONResponse: {"status": "ok"}
36+
"""
37+
return {"status": "ok"}
2838

29-
@router.get("/health-check/")
30-
async def health_check() -> bool:
31-
return True
39+
@router.get("/sentry-debug", tags=["Debug"])
40+
async def trigger_error():
41+
division_by_zero = 1 / 0

backend/app/core/config.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import secrets
22
import warnings
3+
from pathlib import Path
34
from typing import Annotated, Any, Literal
45

56
from pydantic import (
@@ -15,6 +16,8 @@
1516
from typing_extensions import Self
1617

1718

19+
BASE_DIR = Path(__file__).resolve().parents[3]
20+
1821
def parse_cors(v: Any) -> list[str] | str:
1922
if isinstance(v, str) and not v.startswith("["):
2023
return [i.strip() for i in v.split(",") if i.strip()]
@@ -25,12 +28,11 @@ def parse_cors(v: Any) -> list[str] | str:
2528

2629
class Settings(BaseSettings):
2730
model_config = SettingsConfigDict(
28-
# Use top level .env file (one level above ./backend/)
29-
env_file="../.env",
31+
env_file=BASE_DIR / ".env",
3032
env_ignore_empty=True,
3133
extra="ignore",
3234
)
33-
API_V1_STR: str = "/api/v1"
35+
API_V1_STR: str = ""
3436
SECRET_KEY: str = secrets.token_urlsafe(32)
3537
# 60 minutes * 24 hours * 8 days = 8 days
3638
ACCESS_TOKEN_EXPIRE_MINUTES: int = 60 * 24 * 8
@@ -49,7 +51,7 @@ def all_cors_origins(self) -> list[str]:
4951
]
5052

5153
PROJECT_NAME: str
52-
SENTRY_DSN: HttpUrl | None = None
54+
SENTRY_DSN: str | None = None
5355
POSTGRES_SERVER: str
5456
POSTGRES_PORT: int = 5432
5557
POSTGRES_USER: str

0 commit comments

Comments
 (0)