Commit Graph

23 Commits

Author SHA1 Message Date
b1878e470f feat(ui): add error handling, flash messages and SEO optimization
- Add custom error pages (404, 403, 500) with user-friendly messages
- Add flash message system with signed cookies for security
- Add toast notifications with auto-dismiss and manual close
- Add comprehensive SEO meta tags (description, keywords, OG, Twitter)
- Add canonical URLs for SEO
- Update routes to use slug-based URLs (/posts/{slug} instead of /posts/{id})
- Add Open Graph and Twitter Card meta tags for social sharing
- Add favicon SVG
- Update all templates with proper meta tags and URLs
- Add error handlers registration in main.py
- Add flash middleware for request handling
- Install itsdangerous dependency
2026-05-02 16:23:57 +03:00
4eee261107 fix(mobile): add functional mobile hamburger menu
- Add mobile menu button with hamburger/close icons
- Add full-screen mobile navigation overlay
- Add JavaScript for menu toggle functionality
- Prevent body scroll when menu is open
- Close menu on link click, escape key, or outside click
- Add proper ARIA attributes for accessibility
2026-05-02 15:47:58 +03:00
0cb706e54b feat(auth): implement web authentication with Keycloak OAuth2
- Add auth routes: /auth/login, /auth/callback, /auth/logout
- Add OAuth2 flow with Keycloak using HTTP-only cookies
- Add web auth dependencies with role checking
- Add profile page (read-only) at /web/profile
- Update header with user menu (sign in/out, profile)
- Filter posts based on user permissions (hide drafts from guests)
- Conditionally show/hide create/edit/delete buttons
- Add authorization rules documentation to AGENTS.md
- Secure post editing/deletion endpoints with auth checks
- Add can_edit, can_delete flags to templates
2026-05-02 15:39:49 +03:00
2aed9f5c8a refactor(ui): improve UI/UX design and spacing
- Increase card padding and gaps for better visual hierarchy
- Add hover lift effect to cards with smooth transitions
- Improve typography with larger headings and better line-height
- Darken meta text colors for better readability
- Add checkbox styling with accent color
- Make tags interactive with hover effects
- Add mobile responsive styles for forms and footer
- Replace Unicode arrows with SVG icons
- Improve focus styles for accessibility
- Increase badge padding and font-weight
- Add subtle shadow to cards by default
2026-05-02 15:03:20 +03:00
e2802d83f2 feat(ui): add web UI with Jinja2 templates and Gitea themes
- Add Jinja2 templates with data-testid attributes for testing
- Create light/dark themes based on Gitea color scheme
- Add theme switching with localStorage persistence
- Create base CSS, components, and layout styles
- Add mock web routes for UI demonstration
- Register web router and static files in main.py
- Add data-testid requirements to AGENTS.md
- Install jinja2 dependency
2026-05-02 14:45:51 +03:00
ca4e8877a5 docs: add AI code generation requirements and comprehensive Google-style docstrings
- Add AI code generation requirements to AGENTS.md
- Add module-level docstrings to all 46 Python modules
- Add detailed Google-style docstrings to all classes and functions
- Remove all inline comments following self-documenting code principle
- Include Args, Returns, Raises sections in function docstrings
- Add Attributes and Examples sections to class docstrings
2026-05-02 13:15:21 +03:00
6a528bcbb9 Auth impl (#10)
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/push/type Pipeline was successful
2026-05-02 09:11:32 +00:00
14adcaa3e6 style: apply ruff formatting to source and test files
All checks were successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/type Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
2026-05-02 12:05:14 +03:00
1dbedf0f52 style: apply ruff formatting and lint fixes 2026-05-02 12:04:14 +03:00
184b95969c feat(auth): implement Keycloak authentication with RBAC and pagination
Some checks failed
ci/woodpecker/pr/lint Pipeline failed
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/type Pipeline was successful
Major changes:
- Add Keycloak integration via token introspection endpoint
- Implement RBAC system with roles: admin, user, guest
- Add role-based permissions for post operations
- Add pagination support (default limit: 10) to list endpoints
- Add published_only filter with admin-only override for unpublished posts

Security improvements:
- Remove hardcoded default secrets (SECRET_KEY, KEYCLOAK_CLIENT_SECRET)
- Update .env.example with proper security placeholders
- Add comprehensive RBAC unit tests

Infrastructure:
- Add httpx dependency for HTTP client
- Add KeycloakAuthClient with token caching (TTL: 60s)
- Add role-based dependencies (RequireAdmin, RequireUser, etc.)
- Update DI container with Keycloak provider

Endpoints updated:
- GET /posts: filter by published status (admin can see all)
- Add pagination params (limit, offset) to list endpoints
- Enforce RBAC on post operations

Tests:
- Add 16 auth infrastructure tests
- Add 13 RBAC role tests
- Update existing tests for new required settings

Breaking changes:
- SECRET_KEY and KEYCLOAK_CLIENT_SECRET now required (no defaults)
2026-05-02 11:21:45 +03:00
ddab62a883 chore: remove blog.db from git and add to gitignore 2026-05-01 20:21:08 +03:00
87b094220d refactor: migrate to DDD architecture with Dishka DI
Complete architectural refactoring from simple MVC to Clean Architecture/DDD pattern:

Domain Layer:

- Add entities (Post, BaseEntity) with business logic

- Add value objects (Title, Content, Slug) with validation

- Add repository interfaces (PostRepository)

- Add domain exceptions

Application Layer:

- Add use cases (CreatePost, GetPost, UpdatePost, DeletePost, ListPosts, PublishPost)

- Add DTOs for data transfer

- Add TransactionManager interface

Infrastructure Layer:

- Add SQLAlchemy models and async database connection

- Add SQLAlchemyPostRepository implementation

- Add Dishka DI container with providers

- Add error handlers and middleware

Presentation Layer:

- Add FastAPI routes with Dishka integration

- Add Pydantic schemas

- Add dependency injection using FromDishka[T]

Other Changes:

- Remove old flat structure (api/, common/, core/, modules/)

- Add hatchling build system for package scripts

- Add blog CLI command

- Update AGENTS.md with new architecture docs

- All 48 tests passing, mypy clean, ruff clean
2026-05-01 20:20:41 +03:00
b8334efa5a fix: delete artefacts 2026-04-27 00:30:26 +03:00
2f27527c2e Merge pull request 'dev' (#8) from dev into main
Some checks failed
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/push/type Pipeline was successful
ci/woodpecker/push/comment_pr Pipeline failed
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/type Pipeline was successful
ci/woodpecker/pr/comment_pr Pipeline was successful
Reviewed-on: #8
2026-04-26 19:36:26 +00:00
9a6b608c73 feat: implement blog project with CI pipeline
Some checks failed
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/push/type Pipeline was successful
ci/woodpecker/push/comment_pr Pipeline failed
2026-04-26 21:12:17 +03:00
2e930ffbe5 feat: implement blog project with CI pipeline
All checks were successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/type Pipeline was successful
ci/woodpecker/pr/comment_pr Pipeline was successful
2026-04-26 21:08:49 +03:00
9c3b44b561 [QG] Add quality gates on main branch
All checks were successful
ci/woodpecker/push/lints Pipeline was successful
ci/woodpecker/push/tests Pipeline was successful
ci/woodpecker/push/types Pipeline was successful
[+] add lint pipeline for ruff isort and black checks
[+] add types pipeline for mypy check
[+] add tests pipeline for pytest check with coverage less 70% blocker QG
[+] add some tests fo QG pass
2026-04-20 10:06:29 +03:00
048071263a Dev dependencies
[+] install dev deps in --dev group
[+] add pre-commit config
2026-04-19 15:59:16 +03:00
7cd0d8c229 pipeline updated
Some checks failed
ci/woodpecker/push/python_lints Pipeline failed
ci/woodpecker/push/test_pipeline Pipeline failed
2026-04-19 14:07:31 +03:00
fa8751c973 [Lint] add pipeline
All checks were successful
ci/woodpecker/push/test_pipeline Pipeline was successful
ci/woodpecker/push/python_lints Pipeline was successful
[+] Add lint pipeline for testing
2026-04-19 12:08:15 +03:00
ba45f40a9b [Blog] Preparing
All checks were successful
ci/woodpecker/push/test_pipeline Pipeline was successful
[+] Fastapi app init
[+] Test ci pipeline
2026-04-19 10:58:53 +03:00
ef797bc85b blog project init 2026-04-12 21:35:18 +03:00
2cb55be630 Initial commit 2026-04-12 18:31:24 +00:00