Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
3c9c847
fix: login response
fiqrikm18 Jun 20, 2026
eb77776
feat: add email verification on register
fiqrikm18 Jun 20, 2026
3d67a73
feat: add import boundary
fiqrikm18 Jun 20, 2026
920439d
refactor: move authentication app to auth
fiqrikm18 Jun 20, 2026
5acda50
feat: implement sync commumication
fiqrikm18 Jun 20, 2026
7b7f51f
feat: implement sync commumication
fiqrikm18 Jun 20, 2026
698a853
feat: implement sync commumication
fiqrikm18 Jun 20, 2026
358660d
fix: import path
fiqrikm18 Jun 21, 2026
1a8a61b
refactor: restructure authorization module to follow DDD + Clean Arch…
qwen-intl Jun 21, 2026
a256fae
Merge pull request #3 from IDTS-LAB/ddd-clean-architecture-with-cqrs-…
fiqrikm18 Jun 21, 2026
989280b
Add authorization infrastructure with Casbin policy management
qwen-intl Jun 21, 2026
c646f20
Merge pull request #4 from IDTS-LAB/python-import-resolution-issue-e8caa
fiqrikm18 Jun 21, 2026
7d30ef3
fix: invalid import path
fiqrikm18 Jun 21, 2026
a8508da
docs: update readme
fiqrikm18 Jun 21, 2026
392773a
Title: Refactor authorization infrastructure and update imports
qwen-intl Jun 21, 2026
cc9a574
Merge pull request #5 from IDTS-LAB/detecting-duplicate-code-36efe
fiqrikm18 Jun 21, 2026
4ec78ec
refactor: move infrastructure to module from core
fiqrikm18 Jun 22, 2026
5fefb72
Title: Implement Normalized User Domain with DDD Structure and Update…
qwen-intl Jun 22, 2026
91f707c
Merge pull request #6 from IDTS-LAB/normalized-user-domain-architectu…
fiqrikm18 Jun 22, 2026
5694eff
fix: import path
fiqrikm18 Jun 22, 2026
feca5b9
Refactor authorization models to remove circular imports and update g…
qwen-intl Jun 22, 2026
813d9b9
update branch
qwen-intl Jun 22, 2026
0a1fd7b
update branch
qwen-intl Jun 22, 2026
423aa00
Merge pull request #7 from IDTS-LAB/circular-import-resolution-b6fdb
fiqrikm18 Jun 22, 2026
00d2da9
chore: remove all __pycache__
fiqrikm18 Jun 22, 2026
3b28adf
chore: update gitignore
fiqrikm18 Jun 22, 2026
2fea739
chore: update gitignore
fiqrikm18 Jun 22, 2026
fc9207a
fix: update migration
fiqrikm18 Jun 22, 2026
c20e9e3
docs: design normalized database seed update
fiqrikm18 Jun 22, 2026
5fb3a12
docs: plan normalized database seed update
fiqrikm18 Jun 22, 2026
38df3a8
chore: ignore local worktrees
fiqrikm18 Jun 22, 2026
8797e85
test: cover normalized user seeding
fiqrikm18 Jun 22, 2026
bdbc4f6
fix: align user seed with normalized schema
fiqrikm18 Jun 22, 2026
bc69a64
docs: explain normalized database seeding
fiqrikm18 Jun 22, 2026
e4349c7
Merge pull request #8 from IDTS-LAB/fix/normalized-database-seed
fiqrikm18 Jun 22, 2026
f488307
Title: Restore Database Foreign Keys and Normalize User Identifiers
qwen-intl Jun 22, 2026
eff4ec8
Merge pull request #9 from IDTS-LAB/database-foreign-key-restoration-…
fiqrikm18 Jun 22, 2026
f408aeb
docs: design foreign key restoration
fiqrikm18 Jun 22, 2026
80c9497
docs: plan foreign key restoration
fiqrikm18 Jun 22, 2026
05515ca
fix: table data type
fiqrikm18 Jun 22, 2026
67b962d
fix: todo owner
fiqrikm18 Jun 22, 2026
d87732b
chore: update initial schemas
fiqrikm18 Jun 22, 2026
807e5c7
fix: update detail /me endpoint
fiqrikm18 Jun 22, 2026
c790c9e
Implement user account lockout and multi-method 2FA
qwen-intl Jun 22, 2026
9d5acf3
Merge pull request #10 from IDTS-LAB/multi-fa-authentication-setup-bc71e
fiqrikm18 Jun 22, 2026
98646e6
feat: 2fa implementation
fiqrikm18 Jun 22, 2026
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
36 changes: 36 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,45 +1,81 @@
# Application metadata and runtime environment.
APP_NAME=Todo Modulith API
APP_ENV=production
FRONTEND_URL=http://localhost:3000

# Local service credentials used by Docker Compose.
POSTGRES_USER=postgres
POSTGRES_PASSWORD=
POSTGRES_DB=todo_db
REDIS_PASSWORD=

# Database connection string and SQLAlchemy pool tuning.
DATABASE_URL=
DATABASE_POOL_SIZE=20
DATABASE_MAX_OVERFLOW=10
DATABASE_POOL_TIMEOUT=30
DATABASE_POOL_RECYCLE=3600

# Redis connection used by shared infrastructure such as rate limiting or caching.
REDIS_URL=

# JWT signing secret. Change this in every deployed environment.
SECRET_KEY=

# Maximum request body size in bytes.
MAX_REQUEST_SIZE_MB=5242880 #5mb

# JWT signing, validation, and token lifetime settings.
ALGORITHM=HS256
JWT_ISSUER=todo-modulith-api
JWT_AUDIENCE=todo-modulith-client
ACCESS_TOKEN_EXPIRE_MINUTES=30
REFRESH_TOKEN_EXPIRE_MINUTES=10080

# API rate limit rule.
RATE_LIMIT="100/minute"

# CORS settings for browser clients.
CORS_ALLOW_ORIGINS=http://localhost:3000
CORS_ALLOW_METHODS=*
CORS_ALLOW_HEADERS=*

# Content Security Policy header value.
SECURITY_CONTENT_SECURITY_POLICY=default-src 'self'; frame-ancestors 'none'

# Idempotency key retention time in seconds.
IDEMPOTENCY_TTL_SECONDS=86400

# Account lockout thresholds used to slow repeated failed login attempts.
ACCOUNT_LOCKOUT_MAX_ATTEMPTS=5
ACCOUNT_LOCKOUT_WINDOW_MINUTES=15
ACCOUNT_LOCKOUT_DURATION_MINUTES=15

# Logging output format for application logs.
LOG_FORMAT=json

# Email provider selection. Options: ses, sendgrid, smtp.
EMAIL_PROVIDER=ses

# AWS SES configuration.
AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
SES_FROM_EMAIL=noreply@example.com

# SendGrid configuration.
SENDGRID_API_KEY=
SENDGRID_FROM_EMAIL=noreply@example.com

# SMTP configuration for Gmail or other SMTP providers.
SMTP_HOST=
SMTP_PORT=587
SMTP_USERNAME=
SMTP_PASSWORD=
SMTP_FROM_EMAIL=noreply@example.com
SMTP_USE_TLS=true

# Optional admin and development users created by database seeders.
SEED_ADMIN_EMAIL=
SEED_ADMIN_PASSWORD=
SEED_ADMIN_USERNAME=admin
Expand Down
36 changes: 19 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
# Poetry specific files
.venv/
/dist/
/poetry.toml

# Python bytecode and caches
__pycache__/
```
*.pyc
*.pyo
*.pyd
.pytest_cache/
.mypy_cache/
.ruff_cache/
.cache/

# Environment variables (secret keys)
__pycache__/
*.log
*.tmp
*.swp
.env

# IDE settings
.env.local
.env.*
.vscode/
.idea/
dist/
build/
target/
.venv/
venv/
node_modules/
.mypy_cache/
.pytest_cache/
.coverage
coverage/
htmlcov/
```
10 changes: 10 additions & 0 deletions .idea/.gitignore

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

13 changes: 13 additions & 0 deletions .idea/fastapi-modulith.iml

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

5 changes: 5 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/inspectionProfiles/profiles_settings.xml

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

8 changes: 8 additions & 0 deletions .idea/misc.xml

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

8 changes: 8 additions & 0 deletions .idea/modules.xml

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

50 changes: 50 additions & 0 deletions .importlinter
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[importlinter]
root_package = src

[importlinter:contract:todo-cross-module-boundary]
name = Todo module only imports public contracts from other modules
type = forbidden
allow_indirect_imports = True
source_modules =
src.modules.todo
forbidden_modules =
src.modules.user.application
src.modules.user.domain
src.modules.user.infrastructure
src.modules.user.presentation
src.modules.authorization.application
src.modules.authorization.domain
src.modules.authorization.infrastructure
src.modules.authorization.presenter

[importlinter:contract:user-cross-module-boundary]
name = User module only imports public contracts from other modules
type = forbidden
allow_indirect_imports = True
source_modules =
src.modules.user
forbidden_modules =
src.modules.todo.application
src.modules.todo.domain
src.modules.todo.infrastructure
src.modules.todo.presentation
src.modules.authorization.application
src.modules.authorization.domain
src.modules.authorization.infrastructure
src.modules.authorization.presenter

[importlinter:contract:authorization-cross-module-boundary]
name = Authorization module only imports public contracts from other modules
type = forbidden
allow_indirect_imports = True
source_modules =
src.modules.authorization
forbidden_modules =
src.modules.todo.application
src.modules.todo.domain
src.modules.todo.infrastructure
src.modules.todo.presentation
src.modules.user.application
src.modules.user.domain
src.modules.user.infrastructure
src.modules.user.presentation
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
repos:
- repo: local
hooks:
- id: import-linter
name: import-linter
entry: poetry run lint-imports
language: system
pass_filenames: false
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"python-envs.defaultEnvManager": "ms-python.python:poetry",
"python-envs.defaultPackageManager": "ms-python.python:poetry"
}
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@ SHELL := /bin/bash
PYTHON := .venv/bin/python
PYTEST := .venv/bin/pytest
RUFF := .venv/bin/ruff
IMPORT_LINTER := .venv/bin/lint-imports
UVICORN := .venv/bin/uvicorn
ALEMBIC := .venv/bin/alembic
POETRY := poetry
COMPOSE_FILE := docker-compose.yml

.DEFAULT_GOAL := help

.PHONY: help install run test lint import-check security-scan check migrate seed downgrade revision db-up db-down db-logs clean
.PHONY: help install run test lint lint-imports import-check security-scan check migrate seed downgrade revision db-up db-down db-logs clean

help:
@echo "[make:help] Available commands:"
@echo " [make:install] Install project dependencies with Poetry"
@echo " [make:run] Run the FastAPI development server"
@echo " [make:test] Run pytest"
@echo " [make:lint] Run Ruff checks"
@echo " [make:lint-imports] Enforce import boundary contracts"
@echo " [make:import-check] Verify src.main imports"
@echo " [make:security-scan] Run dependency vulnerability scan with pip-audit"
@echo " [make:check] Run tests, lint, and import check"
Expand Down Expand Up @@ -46,6 +48,10 @@ lint:
@echo "[make:lint] Running Ruff checks"
@$(RUFF) check src tests scripts

lint-imports:
@echo "[make:lint-imports] Enforcing import boundary contracts"
@$(IMPORT_LINTER)

import-check:
@echo "[make:import-check] Verifying src.main imports"
@PYTHONDONTWRITEBYTECODE=1 $(PYTHON) -c "import src.main; print('import ok')"
Expand All @@ -54,7 +60,7 @@ security-scan:
@echo "[make:security-scan] Running dependency vulnerability scan"
@PIP_CACHE_DIR=.cache/pip $(POETRY) run pip-audit --cache-dir .cache/pip-audit

check: test lint import-check
check: test lint lint-imports import-check
@echo "[make:check] All checks completed"

migrate:
Expand Down
Loading
Loading