Skip to content
Merged
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
25 changes: 12 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: '3.11.13'
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: 1.8.3
virtualenvs-create: false
enable-cache: true
cache-dependency-glob: backend/uv.lock
- name: Install dependencies
run: poetry install --no-interaction --no-ansi
run: uv sync --frozen
- name: Run tests
run: poetry run pytest tests/ -v
run: uv run pytest tests/ -v

build-backend:
runs-on: ubuntu-latest
Expand All @@ -38,15 +38,15 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: '3.11.13'
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: 1.8.3
virtualenvs-create: false
enable-cache: true
cache-dependency-glob: backend/uv.lock
- name: Install dependencies
run: poetry install --no-interaction --no-ansi
run: uv sync --frozen
- name: Build
run: poetry build
run: uv build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
Expand All @@ -72,4 +72,3 @@ jobs:
pnpm format:check
pnpm tsc --noEmit
pnpm build

8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@
TODO.md
.pytest_cache
.coverage
.DS_Store
.DS_Store
.idea/*
!.idea/inspectionProfiles/
!.idea/codeStyles/
!.idea/runConfigurations/
!.idea/vcs.xml
.pnpm-store/
6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ An intelligent task scheduling system that uses AI to extract tasks from content
### Backend
```bash
cd backend
poetry install
poetry run alembic upgrade head
poetry run uvicorn app.main:app --reload
uv sync
uv run alembic upgrade head
uv run uvicorn app.main:app --reload
```

### Frontend
Expand All @@ -100,7 +100,7 @@ docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d --build
docker compose down

# Database migrations (Manual run)
docker compose exec api poetry run alembic upgrade head
docker compose exec api alembic upgrade head
```

## Project Structure
Expand Down Expand Up @@ -152,20 +152,20 @@ Controls Docker behavior.

```bash
# Backend tests
docker-compose exec api poetry run pytest
docker-compose exec api pytest

# With coverage
docker-compose exec api poetry run pytest --cov=app
docker-compose exec api pytest --cov=app
```

## Database Migrations

```bash
# Create migration
docker-compose exec api poetry run alembic revision --autogenerate -m "description"
docker-compose exec api alembic revision --autogenerate -m "description"

# Apply migrations
docker-compose exec api poetry run alembic upgrade head
docker-compose exec api alembic upgrade head
```

## License
Expand Down
15 changes: 7 additions & 8 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ FROM python:3.13-slim AS base

WORKDIR /backend

RUN pip install poetry==1.8.3
COPY --from=ghcr.io/astral-sh/uv:0.11.16 /uv /uvx /bin/

RUN poetry config virtualenvs.create false
ENV PATH="/backend/.venv/bin:$PATH"
ENV UV_LINK_MODE=copy

COPY pyproject.toml poetry.lock ./
COPY pyproject.toml uv.lock ./

FROM base AS dev
RUN poetry install --no-interaction --no-ansi
RUN uv sync --frozen --no-install-project
COPY ./app ./app
COPY alembic.ini ./
COPY ./scripts ./scripts
Expand All @@ -21,16 +22,14 @@ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload

FROM base AS prod
RUN addgroup --system appgroup && adduser --system --group appuser
RUN poetry install --without dev --no-interaction --no-ansi
RUN uv sync --frozen --no-dev --no-install-project
COPY ./app ./app
COPY alembic.ini ./
COPY ./scripts ./scripts

RUN chmod +x /backend/scripts/start.sh
RUN chown -R appuser:appgroup /backend
# Set HOME for appuser and ensure Poetry doesn't create virtualenvs
ENV HOME=/tmp
ENV POETRY_VIRTUALENVS_CREATE=false
USER appuser
EXPOSE 8000
ENTRYPOINT ["/backend/scripts/start.sh"]
ENTRYPOINT ["/backend/scripts/start.sh"]
Loading
Loading