Skip to content
Open
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
69 changes: 69 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
env/
venv/
.venv/
ENV/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# Testing
.pytest_cache/
.coverage
htmlcov/
.tox/
.mypy_cache/
.ruff_cache/

# IDE
.vscode/
.idea/
*.swp
*.swo
*~

# Environment
.env
.env.*
!.env.example

# Git
.git/
.gitignore

# Documentation
*.md
docs/

# CI/CD
.github/

# Docker
docker-compose.yml
Dockerfile

# Other
.DS_Store
*.log
Makefile
tests/
scripts/
bruno/
TESTING.md
6 changes: 6 additions & 0 deletions .env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
APP_ENV=development
DATABASE_URL=postgresql://dev:postgres@localhost:5432/app_db
DEBUG=true
LOG_LEVEL=DEBUG
ALLOWED_ORIGINS=http://localhost:3000,http://localhost:8000,http://localhost:5173
ENABLE_CORS=true
29 changes: 29 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Environment Selection
# Options: development, testing, production
# Loads from: .env.dev, .env.testing, or .env.production respectively
APP_ENV=development

# Application Settings
PROJECT_NAME=FastAPI Project
VERSION=1.0.0
DESCRIPTION=FastAPI project with raw SQL database layer

# Database Settings
# Format: postgresql://user:password@host:port/database
DATABASE_URL=postgresql://dev:postgres@localhost:5432/app_db
TEST_DATABASE_URL=

# CORS Settings (comma-separated)
ALLOWED_ORIGINS=http://localhost:3000,http://localhost:8000
ENABLE_CORS=true

# Logging
DEBUG=true
LOG_LEVEL=DEBUG

# API Settings
API_V1_PREFIX=/api/v1

# External Services (optional) - Uncomment and set if needed
# REDIS_URL=redis://localhost:6379/0
# EXTERNAL_API_URL=http://localhost:9000
7 changes: 7 additions & 0 deletions .env.production.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
APP_ENV=production
# REQUIRED: Set via environment variables in production
DATABASE_URL=postgresql://user:password@host:5432/prod_db
DEBUG=false
LOG_LEVEL=WARNING
ALLOWED_ORIGINS=https://yourdomain.com,https://www.yourdomain.com
ENABLE_CORS=true
7 changes: 7 additions & 0 deletions .env.testing
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
APP_ENV=testing
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/test_db
TEST_DATABASE_URL=postgresql://postgres:postgres@localhost:5432/test_db
DEBUG=true
LOG_LEVEL=INFO
ALLOWED_ORIGINS=*
ENABLE_CORS=true
14 changes: 14 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[flake8]
max-line-length = 100
extend-ignore = E203, E266, E501, W503
exclude =
.git,
__pycache__,
.venv,
venv,
.eggs,
*.egg,
build,
dist,
.tox
max-complexity = 10
65 changes: 65 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# Virtual Environment
venv/
env/
ENV/
env.bak/
venv.bak/
.venv/

# Poetry
# Note: poetry.lock should typically be committed for applications
# Uncomment the line below if you want to ignore it
# poetry.lock

# IDEs
.vscode/
.idea/
*.swp
*.swo
*~

# Environment
.env
.env.local
.env.production

# Database
*.db
*.sqlite
*.sqlite3

# Testing
.pytest_cache/
.coverage
htmlcov/
.tox/

# Linting/Formatting
.ruff_cache/
.mypy_cache/

# OS
.DS_Store
Thumbs.db
36 changes: 36 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
repos:
# Ruff - Fast Python linter and formatter
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.11
hooks:
# Run the linter
- id: ruff
args: [--fix]
# Run the formatter
- id: ruff-format

# Black - Python code formatter
- repo: https://github.com/psf/black
rev: 23.12.1
hooks:
- id: black
language_version: python3.12

# isort - Import sorting
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black"]

# Additional helpful hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: check-merge-conflict
- id: check-toml
- id: detect-private-key
Loading