diff --git a/.env.example b/.env.example index cc5b09b..bde44aa 100644 --- a/.env.example +++ b/.env.example @@ -2,7 +2,7 @@ LETTERFEED_APP_BASE_URL=http://localhost:3000 # The database URL. Change this if you change the volume mount point -LETTERFEED_DATABASE_URL=sqlite:////data/letterfeed.db +LETTERFEED_DATABASE_URL=sqlite:////data/letterfeed.db # IMAP server settings. Must have IMAP over SSL on port 993 LETTERFEED_IMAP_SERVER= diff --git a/README.md b/README.md index 71dbbfd..a3c2600 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ LetterFeed is a self-hosted application that converts email newsletters into RSS cp .env.example .env ``` - Edit the `.env` file with your specific settings. + Edit the `.env` file with your specific settings. 3. **Build and run the Docker containers:** @@ -134,4 +134,3 @@ cd backend uv sync --group test uvicorn app.main:app --reload ``` - diff --git a/backend/app/crud/__init__.py b/backend/app/crud/__init__.py index 7084aa1..aca9e26 100644 --- a/backend/app/crud/__init__.py +++ b/backend/app/crud/__init__.py @@ -1 +1 @@ -"""CRUD operations for database models.""" \ No newline at end of file +"""CRUD operations for database models.""" diff --git a/backend/app/models/__init__.py b/backend/app/models/__init__.py index 53a9b56..8479564 100644 --- a/backend/app/models/__init__.py +++ b/backend/app/models/__init__.py @@ -1 +1 @@ -"""SQLAlchemy models for the database.""" \ No newline at end of file +"""SQLAlchemy models for the database.""" diff --git a/backend/app/models/newsletters.py b/backend/app/models/newsletters.py index 7ca2f65..a69cc62 100644 --- a/backend/app/models/newsletters.py +++ b/backend/app/models/newsletters.py @@ -6,6 +6,7 @@ from app.core.database import Base class Newsletter(Base): """Represents a newsletter, which can have multiple senders and entries.""" + __tablename__ = "newsletters" id = Column(Integer, primary_key=True, index=True) @@ -22,6 +23,7 @@ class Newsletter(Base): class Sender(Base): """Represents an email sender associated with a newsletter.""" + __tablename__ = "senders" id = Column(Integer, primary_key=True, index=True) diff --git a/backend/app/models/settings.py b/backend/app/models/settings.py index c11a21d..2c38583 100644 --- a/backend/app/models/settings.py +++ b/backend/app/models/settings.py @@ -5,6 +5,7 @@ from app.core.database import Base class Settings(Base): """Represents application settings, including IMAP configuration.""" + __tablename__ = "settings" id = Column(Integer, primary_key=True, index=True) diff --git a/backend/app/routers/__init__.py b/backend/app/routers/__init__.py index a9555d9..b4aa793 100644 --- a/backend/app/routers/__init__.py +++ b/backend/app/routers/__init__.py @@ -1 +1 @@ -"""API routers for the application.""" \ No newline at end of file +"""API routers for the application.""" diff --git a/backend/app/schemas/__init__.py b/backend/app/schemas/__init__.py index 2e60313..e59418c 100644 --- a/backend/app/schemas/__init__.py +++ b/backend/app/schemas/__init__.py @@ -1 +1 @@ -"""Pydantic schemas for data validation and serialization.""" \ No newline at end of file +"""Pydantic schemas for data validation and serialization.""" diff --git a/backend/app/schemas/newsletters.py b/backend/app/schemas/newsletters.py index eb0d269..60fea97 100644 --- a/backend/app/schemas/newsletters.py +++ b/backend/app/schemas/newsletters.py @@ -5,16 +5,19 @@ from pydantic import BaseModel, ConfigDict class SenderBase(BaseModel): """Base schema for a sender.""" + email: str class SenderCreate(SenderBase): """Schema for creating a new sender.""" + pass class Sender(SenderBase): """Schema for retrieving a sender with its ID and newsletter ID.""" + id: int newsletter_id: int @@ -23,21 +26,25 @@ class Sender(SenderBase): class NewsletterBase(BaseModel): """Base schema for a newsletter.""" + name: str class NewsletterCreate(NewsletterBase): """Schema for creating a new newsletter.""" + sender_emails: List[str] class NewsletterUpdate(NewsletterBase): """Schema for updating an existing newsletter.""" + sender_emails: List[str] class Newsletter(NewsletterBase): """Schema for retrieving a newsletter with its ID, active status, senders, and entries count.""" + id: int is_active: bool senders: List[Sender] = [] diff --git a/backend/app/schemas/settings.py b/backend/app/schemas/settings.py index 62d1ae7..6f9e70b 100644 --- a/backend/app/schemas/settings.py +++ b/backend/app/schemas/settings.py @@ -5,6 +5,7 @@ from pydantic import BaseModel, ConfigDict, Field class SettingsBase(BaseModel): """Base schema for application settings.""" + imap_server: str imap_username: str search_folder: str = "INBOX" @@ -16,11 +17,13 @@ class SettingsBase(BaseModel): class SettingsCreate(SettingsBase): """Schema for creating or updating settings, including the IMAP password.""" + imap_password: str class Settings(SettingsBase): """Schema for retrieving settings, with password excluded by default.""" + id: int imap_password: str | None = Field(None, exclude=True) locked_fields: List[str] = [] diff --git a/backend/app/services/__init__.py b/backend/app/services/__init__.py index 8b5a65b..07237ed 100644 --- a/backend/app/services/__init__.py +++ b/backend/app/services/__init__.py @@ -1 +1 @@ -"""Application services for business logic.""" \ No newline at end of file +"""Application services for business logic.""" diff --git a/backend/app/tests/__init__.py b/backend/app/tests/__init__.py index 3044484..b96599b 100644 --- a/backend/app/tests/__init__.py +++ b/backend/app/tests/__init__.py @@ -1 +1 @@ -"""Unit tests for the application.""" \ No newline at end of file +"""Unit tests for the application.""" diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 9bb9cb8..8ea992f 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -28,4 +28,4 @@ volumes: networks: letterfeed_network: - driver: bridge + driver: bridge diff --git a/frontend/components/ui/components.json b/frontend/components/ui/components.json index ffe928f..3289f23 100644 --- a/frontend/components/ui/components.json +++ b/frontend/components/ui/components.json @@ -18,4 +18,4 @@ "hooks": "@/hooks" }, "iconLibrary": "lucide" -} \ No newline at end of file +} diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts index 1db62ad..5336fb4 100644 --- a/frontend/src/lib/api.ts +++ b/frontend/src/lib/api.ts @@ -151,4 +151,3 @@ export async function processEmails(): Promise<{ message: string }> { export function getFeedUrl(newsletterId: number): string { return `${API_BASE_URL}/feeds/${newsletterId}`; } -