Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b8e04fe816 | ||
|
|
c2d272d7ac | ||
|
|
f15e87a484 |
@@ -37,7 +37,7 @@ open http://localhost:8000
|
||||
### Using Docker Compose
|
||||
|
||||
```yaml
|
||||
version: '3.8'
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
baby-monitor:
|
||||
@@ -83,28 +83,31 @@ uv run uvicorn src.baby_monitor.main:app --reload --host 0.0.0.0 --port 8000
|
||||
|
||||
### Environment Variables
|
||||
|
||||
| Variable | Default | Description |
|
||||
|----------|---------|-------------|
|
||||
| `ENVIRONMENT` | `production` | Set to `development` to enable API docs |
|
||||
| `ADMIN_PASSWORD` | *(required)* | Admin user password |
|
||||
| `ADMIN_USERNAME` | `admin` | Admin username |
|
||||
| `DATA_DIR` | `/data` | Directory for SQLite database |
|
||||
| `REDIS_URI` | *(optional)* | Redis connection URI for distributed tokens |
|
||||
| Variable | Default | Description |
|
||||
| ---------------- | ------------ | ------------------------------------------- |
|
||||
| `ENVIRONMENT` | `production` | Set to `development` to enable API docs |
|
||||
| `ADMIN_PASSWORD` | _(required)_ | Admin user password |
|
||||
| `ADMIN_USERNAME` | `admin` | Admin username |
|
||||
| `DATA_DIR` | `/data` | Directory for SQLite database |
|
||||
| `REDIS_URI` | _(optional)_ | Redis connection URI for distributed tokens |
|
||||
|
||||
### Storage Options
|
||||
|
||||
**SQLite (Default)**
|
||||
|
||||
- Automatic setup, no configuration needed
|
||||
- Data stored in `/data/baby_monitor.db`
|
||||
- Perfect for single-server deployments
|
||||
|
||||
**Redis (Optional)**
|
||||
|
||||
```bash
|
||||
# Enable Redis token storage
|
||||
export REDIS_URI=redis://localhost:6379
|
||||
```
|
||||
|
||||
**PostgreSQL (Future)**
|
||||
|
||||
- Repository interface ready
|
||||
- Swap implementation in `dependencies.py`
|
||||
|
||||
@@ -190,6 +193,7 @@ uv run pytest tests/integration/
|
||||
### Docker Swarm / Kubernetes
|
||||
|
||||
The application is stateless when using Redis for tokens, making it suitable for:
|
||||
|
||||
- Multi-replica deployments
|
||||
- Load balancing
|
||||
- Rolling updates
|
||||
@@ -197,6 +201,7 @@ The application is stateless when using Redis for tokens, making it suitable for
|
||||
### CI/CD
|
||||
|
||||
Gitea Actions workflow included:
|
||||
|
||||
- Builds multi-architecture images (amd64, arm64)
|
||||
- Automatic semantic versioning
|
||||
- Pushes to container registry
|
||||
@@ -212,15 +217,15 @@ When running in development mode (`ENVIRONMENT=development`):
|
||||
|
||||
### Key Endpoints
|
||||
|
||||
| Endpoint | Method | Description |
|
||||
|----------|--------|-------------|
|
||||
| `/` | GET | Serve home page |
|
||||
| `/api/` | GET | Authenticated API root |
|
||||
| `/api/login` | POST | User authentication |
|
||||
| `/api/logout` | POST | Invalidate token |
|
||||
| `/health` | GET | Health check |
|
||||
| `/ready` | GET | Readiness probe |
|
||||
| `/info` | GET | Feature detection |
|
||||
| Endpoint | Method | Description |
|
||||
| ------------- | ------ | ---------------------- |
|
||||
| `/` | GET | Serve home page |
|
||||
| `/api/` | GET | Authenticated API root |
|
||||
| `/api/login` | POST | User authentication |
|
||||
| `/api/logout` | POST | Invalidate token |
|
||||
| `/health` | GET | Health check |
|
||||
| `/ready` | GET | Readiness probe |
|
||||
| `/info` | GET | Feature detection |
|
||||
|
||||
## 🤝 Contributing
|
||||
|
||||
@@ -252,9 +257,9 @@ This project is licensed under the MIT License - see the LICENSE file for detail
|
||||
|
||||
## 📧 Contact
|
||||
|
||||
Brian Bjarke Jensen - [@bbj](https://gitea.example.com/bbj)
|
||||
Brian Bjarke Jensen - [@brian](https://gitea.gt-proj.com/brian)
|
||||
|
||||
Project Link: [https://gitea.example.com/bbj/baby-monitor](https://gitea.example.com/bbj/baby-monitor)
|
||||
Project Link: [https://gitea.gt-proj.com/brian/baby-monitor](https://gitea.gt-proj.com/brian/baby-monitor)
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ dev = [
|
||||
"httpx>=0.28.1",
|
||||
"mypy>=1.18.2",
|
||||
"pre-commit>=4.3.0",
|
||||
"prettier>=0.0.7",
|
||||
"pytest>=8.4.2",
|
||||
"pytest-cov>=7.0.0",
|
||||
"pyupgrade>=3.21.0",
|
||||
|
||||
@@ -57,6 +57,7 @@ dev = [
|
||||
{ name = "httpx" },
|
||||
{ name = "mypy" },
|
||||
{ name = "pre-commit" },
|
||||
{ name = "prettier" },
|
||||
{ name = "pytest" },
|
||||
{ name = "pytest-cov" },
|
||||
{ name = "pyupgrade" },
|
||||
@@ -79,6 +80,7 @@ dev = [
|
||||
{ name = "httpx", specifier = ">=0.28.1" },
|
||||
{ name = "mypy", specifier = ">=1.18.2" },
|
||||
{ name = "pre-commit", specifier = ">=4.3.0" },
|
||||
{ name = "prettier", specifier = ">=0.0.7" },
|
||||
{ name = "pytest", specifier = ">=8.4.2" },
|
||||
{ name = "pytest-cov", specifier = ">=7.0.0" },
|
||||
{ name = "pyupgrade", specifier = ">=3.21.0" },
|
||||
@@ -437,6 +439,15 @@ wheels = [
|
||||
{ url = "http://10.0.0.2:5001/index/pre-commit/pre_commit-4.3.0-py2.py3-none-any.whl", hash = "sha256:2b0747ad7e6e967169136edffee14c16e148a778a54e4f967921aa1ebf2308d8" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "prettier"
|
||||
version = "0.0.7"
|
||||
source = { registry = "http://10.0.0.2:5001/index/" }
|
||||
sdist = { url = "http://10.0.0.2:5001/index/prettier/prettier-0.0.7.tar.gz", hash = "sha256:6c34b8cd09fd9c8956c05d6395ea3f575e0122dce494ba57685c07065abed427" }
|
||||
wheels = [
|
||||
{ url = "http://10.0.0.2:5001/index/prettier/prettier-0.0.7-py3-none-any.whl", hash = "sha256:20e76791de41cafe481328dd49552303f29ca192151cee1b120c26f66cae9bfc" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "psycopg2-binary"
|
||||
version = "2.9.11"
|
||||
|
||||
Reference in New Issue
Block a user