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
144 changes: 144 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
### Python template

deploy/
.idea/
.vscode/
.git/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
31 changes: 31 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
root = true

[*]
tab_width = 4
end_of_line = lf
max_line_length = 88
ij_visual_guides = 88
insert_final_newline = true
trim_trailing_whitespace = true

[*.{js,py,html}]
charset = utf-8

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab

[.flake8]
indent_style = space
indent_size = 2

[*.py]
indent_style = space
indent_size = 4
ij_python_from_import_parentheses_force_if_multiline = true
127 changes: 127 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# =============================================================================
# CloudCasting Backend Environment Configuration
# =============================================================================
# Copy this file to .env and customize the values for your environment

# =============================================================================
# Application Server Configuration
# =============================================================================

# Host interface to bind the server to
# Default: "0.0.0.0" (all interfaces)
# For local development, you might use "127.0.0.1"
CLOUDCASTING_BACKEND_HOST=0.0.0.0

# Port number for the application server
# Default: 8000
CLOUDCASTING_BACKEND_PORT=8000

# Number of worker processes for uvicorn
# Default: 1
# For production, increase based on CPU cores
CLOUDCASTING_BACKEND_WORKERS_COUNT=1

# Enable auto-reload for development
# Default: false
# Set to true for development to auto-restart on file changes
CLOUDCASTING_BACKEND_RELOAD=false

# =============================================================================
# Environment and Logging Configuration
# =============================================================================

# Current environment identifier
# Default: "dev"
# Options: "dev", "staging", "production", "pytest"
CLOUDCASTING_BACKEND_ENVIRONMENT=dev

# Logging level
# Default: "INFO"
# Options: "NOTSET", "DEBUG", "INFO", "WARNING", "ERROR", "FATAL"
CLOUDCASTING_BACKEND_LOG_LEVEL=INFO

# =============================================================================
# Sentry Error Monitoring (Optional)
# =============================================================================

# Sentry DSN for error tracking and monitoring
# Default: null (disabled)
# Get this from your Sentry project settings
CLOUDCASTING_BACKEND_SENTRY_DSN=

# Sentry sample rate for performance monitoring
# Default: 1.0 (100% sampling)
# Range: 0.0 to 1.0 (0% to 100%)
CLOUDCASTING_BACKEND_SENTRY_SAMPLE_RATE=1.0

# =============================================================================
# AWS S3 Configuration (Required for cloudcasting data)
# =============================================================================

# S3 bucket containing the cloudcasting forecast data
# This bucket should contain zarr files under cloudcasting_forecast/latest.zarr/
CLOUDCASTING_BACKEND_S3_BUCKET_NAME=your-bucket-name

# AWS region where the S3 bucket is located
# Example: "us-east-1", "eu-west-1", etc.
CLOUDCASTING_BACKEND_S3_REGION_NAME=us-east-1

# AWS Access Key ID for S3 access
# Should have read permissions for the specified bucket
CLOUDCASTING_BACKEND_S3_ACCESS_KEY_ID=your-access-key-id

# AWS Secret Access Key for S3 access
# Keep this secure and never commit to version control
CLOUDCASTING_BACKEND_S3_SECRET_ACCESS_KEY=your-secret-access-key

# =============================================================================
# Auth0 Authentication Configuration (Optional)
# =============================================================================

# Auth0 domain for JWT token validation
# Example: "your-tenant.auth0.com"
AUTH0_DOMAIN=

# Auth0 API audience identifier
AUTH0_API_AUDIENCE=


# =============================================================================
# File Storage Paths (Optional - uses defaults if not specified)
# =============================================================================

# Path to store downloaded zarr files locally
# Default: "cloudcasting_backend/static/zarr_files"
# Can be absolute or relative path
CLOUDCASTING_BACKEND_ZARR_STORAGE_PATH=cloudcasting_backend/static/zarr_files

# Path to store converted GeoTIFF layers
# Default: "cloudcasting_backend/static/layers"
# These files are served via the /static/ endpoint
CLOUDCASTING_BACKEND_GEOTIFF_STORAGE_PATH=cloudcasting_backend/static/layers

# =============================================================================
# Example Development Configuration
# =============================================================================
# Uncomment and modify these for local development:

# CLOUDCASTING_BACKEND_HOST=127.0.0.1
# CLOUDCASTING_BACKEND_PORT=8000
# CLOUDCASTING_BACKEND_RELOAD=true
# CLOUDCASTING_BACKEND_ENVIRONMENT=dev
# CLOUDCASTING_BACKEND_LOG_LEVEL=DEBUG
# CLOUDCASTING_BACKEND_WORKERS_COUNT=1

# =============================================================================
# Example Production Configuration
# =============================================================================
# For production deployment:

# CLOUDCASTING_BACKEND_HOST=0.0.0.0
# CLOUDCASTING_BACKEND_PORT=8000
# CLOUDCASTING_BACKEND_WORKERS_COUNT=4
# CLOUDCASTING_BACKEND_RELOAD=false
# CLOUDCASTING_BACKEND_ENVIRONMENT=production
# CLOUDCASTING_BACKEND_LOG_LEVEL=INFO
# CLOUDCASTING_BACKEND_SENTRY_DSN=https://[email protected]/project-id
# CLOUDCASTING_BACKEND_SENTRY_SAMPLE_RATE=0.1
19 changes: 0 additions & 19 deletions .github/workflows/branch_ci.yml

This file was deleted.

11 changes: 0 additions & 11 deletions .github/workflows/merged_ci.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Testing cloudcasting_backend

on: push

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'poetry'
- name: Install dependencies
run: poetry install --no-root
- name: Run black lint
run: poetry run black --check .
- name: Run pytest
run: poetry run pytest -vv

Loading