Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@ SMTP_TLS=True
SMTP_SSL=False
SMTP_PORT=587

# Postgres
POSTGRES_SERVER=localhost
POSTGRES_PORT=5432
POSTGRES_DB=app
POSTGRES_USER=postgres
POSTGRES_PASSWORD=changethis
# MySQL
MYSQL_SERVER=localhost
MYSQL_PORT=3306
MYSQL_ROOT_PASSWORD=changethis
MYSQL_DATABASE=app
MYSQL_USER=mysql
MYSQL_PASSWORD=changethis

SENTRY_DSN=

# Configure these with your own Docker registry images
DOCKER_IMAGE_BACKEND=backend
DOCKER_IMAGE_FRONTEND=frontend
DOCKER_IMAGE_BACKEND=caseycui/backend
DOCKER_IMAGE_FRONTEND=caseycui/frontend
2 changes: 1 addition & 1 deletion .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
SMTP_USER: ${{ secrets.SMTP_USER }}
SMTP_PASSWORD: ${{ secrets.SMTP_PASSWORD }}
EMAILS_FROM_EMAIL: ${{ secrets.EMAILS_FROM_EMAIL }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
SMTP_USER: ${{ secrets.SMTP_USER }}
SMTP_PASSWORD: ${{ secrets.SMTP_PASSWORD }}
EMAILS_FROM_EMAIL: ${{ secrets.EMAILS_FROM_EMAIL }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
steps:
- name: Checkout
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- ⚡ [**FastAPI**](https://fastapi.tiangolo.com) for the Python backend API.
- 🧰 [SQLModel](https://sqlmodel.tiangolo.com) for the Python SQL database interactions (ORM).
- 🔍 [Pydantic](https://docs.pydantic.dev), used by FastAPI, for the data validation and settings management.
- 💾 [PostgreSQL](https://www.postgresql.org) as the SQL database.
- 💾 [MySQL](https://www.mysql.org) as the SQL database.
- 🚀 [React](https://react.dev) for the frontend.
- 💃 Using TypeScript, hooks, Vite, and other parts of a modern frontend stack.
- 🎨 [Chakra UI](https://chakra-ui.com) for the frontend components.
Expand Down Expand Up @@ -134,7 +134,8 @@ Before deploying it, make sure you change at least the values for:

- `SECRET_KEY`
- `FIRST_SUPERUSER_PASSWORD`
- `POSTGRES_PASSWORD`
- `MYSQL_ROOT_PASSWORD`
- `MYSQL_PASSWORD`

You can (and should) pass these as environment variables from secrets.

Expand Down Expand Up @@ -209,7 +210,7 @@ The input variables, with their default values (some auto generated) are:
- `smtp_user`: (default: "") The SMTP server user to send emails, you can set it later in .env.
- `smtp_password`: (default: "") The SMTP server password to send emails, you can set it later in .env.
- `emails_from_email`: (default: `"[email protected]"`) The email account to send emails from, you can set it later in .env.
- `postgres_password`: (default: `"changethis"`) The password for the PostgreSQL database, stored in .env, you can generate one with the method above.
- `mysql_password`: (default: `"changethis"`) The password for the MySQL database, stored in .env, you can generate one with the method above.
- `sentry_dsn`: (default: "") The DSN for Sentry, if you are using it, you can set it later in .env.

## Backend Development
Expand Down
2 changes: 1 addition & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ WORKDIR /app/

# Install uv
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#installing-uv
COPY --from=ghcr.io/astral-sh/uv:0.4.15 /uv /bin/uv
COPY --from=ghcr.io/astral-sh/uv:0.5.3 /uv /bin/uv

# Place executables in the environment at the front of the path
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#using-the-environment
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

54 changes: 0 additions & 54 deletions backend/app/alembic/versions/e2412789c190_initialize_models.py

This file was deleted.

9 changes: 3 additions & 6 deletions backend/app/api/routes/items.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import uuid
from typing import Any

from fastapi import APIRouter, HTTPException
Expand Down Expand Up @@ -42,7 +41,7 @@ def read_items(


@router.get("/{id}", response_model=ItemPublic)
def read_item(session: SessionDep, current_user: CurrentUser, id: uuid.UUID) -> Any:
def read_item(session: SessionDep, current_user: CurrentUser, id: str) -> Any:
"""
Get item by ID.
"""
Expand Down Expand Up @@ -73,7 +72,7 @@ def update_item(
*,
session: SessionDep,
current_user: CurrentUser,
id: uuid.UUID,
id: str,
item_in: ItemUpdate,
) -> Any:
"""
Expand All @@ -93,9 +92,7 @@ def update_item(


@router.delete("/{id}")
def delete_item(
session: SessionDep, current_user: CurrentUser, id: uuid.UUID
) -> Message:
def delete_item(session: SessionDep, current_user: CurrentUser, id: str) -> Message:
"""
Delete an item.
"""
Expand Down
7 changes: 3 additions & 4 deletions backend/app/api/routes/users.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import uuid
from typing import Any

from fastapi import APIRouter, Depends, HTTPException
Expand Down Expand Up @@ -159,7 +158,7 @@ def register_user(session: SessionDep, user_in: UserRegister) -> Any:

@router.get("/{user_id}", response_model=UserPublic)
def read_user_by_id(
user_id: uuid.UUID, session: SessionDep, current_user: CurrentUser
user_id: str, session: SessionDep, current_user: CurrentUser
) -> Any:
"""
Get a specific user by id.
Expand All @@ -183,7 +182,7 @@ def read_user_by_id(
def update_user(
*,
session: SessionDep,
user_id: uuid.UUID,
user_id: str,
user_in: UserUpdate,
) -> Any:
"""
Expand All @@ -209,7 +208,7 @@ def update_user(

@router.delete("/{user_id}", dependencies=[Depends(get_current_active_superuser)])
def delete_user(
session: SessionDep, current_user: CurrentUser, user_id: uuid.UUID
session: SessionDep, current_user: CurrentUser, user_id: str
) -> Message:
"""
Delete a user.
Expand Down
Loading
Loading