initial, step 2 already
This commit is contained in:
129
README.md
Normal file
129
README.md
Normal file
@@ -0,0 +1,129 @@
|
||||
# Home Automation Monorepo
|
||||
|
||||
A Python-based home automation system built with Poetry in a monorepo structure.
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
home-automation/
|
||||
├── apps/ # Applications
|
||||
│ ├── api/ # API service
|
||||
│ ├── abstraction/ # Abstraction layer
|
||||
│ ├── rules/ # Rules engine
|
||||
│ └── ui/ # User interface
|
||||
├── packages/ # Shared packages
|
||||
│ └── home_capabilities/ # Home capabilities library
|
||||
├── infra/ # Infrastructure
|
||||
│ ├── docker-compose.yml
|
||||
│ └── README.md
|
||||
├── pyproject.toml # Poetry configuration
|
||||
└── README.md
|
||||
```
|
||||
|
||||
## Requirements
|
||||
|
||||
- Python 3.11+
|
||||
- Poetry
|
||||
|
||||
## Setup
|
||||
|
||||
1. Install Poetry if you haven't already:
|
||||
```bash
|
||||
curl -sSL https://install.python-poetry.org | python3 -
|
||||
```
|
||||
|
||||
2. Install dependencies:
|
||||
```bash
|
||||
poetry install
|
||||
```
|
||||
|
||||
3. Activate the virtual environment:
|
||||
```bash
|
||||
poetry shell
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
### Code Quality Tools
|
||||
|
||||
This project uses the following tools configured in `pyproject.toml`:
|
||||
|
||||
- **Ruff**: Fast Python linter
|
||||
- **Black**: Code formatter
|
||||
- **Mypy**: Static type checker
|
||||
|
||||
Run code quality checks:
|
||||
|
||||
```bash
|
||||
# Format code
|
||||
poetry run black .
|
||||
|
||||
# Lint code
|
||||
poetry run ruff check .
|
||||
|
||||
# Type check
|
||||
poetry run mypy .
|
||||
```
|
||||
|
||||
### Running Applications
|
||||
|
||||
#### Port Configuration
|
||||
|
||||
See `PORTS.md` for detailed port allocation.
|
||||
|
||||
- **API Server**: http://localhost:8001
|
||||
- **UI Server**: http://localhost:8002
|
||||
|
||||
#### API Server
|
||||
|
||||
Start the FastAPI server with auto-reload:
|
||||
|
||||
```bash
|
||||
# Using uvicorn directly (port 8001)
|
||||
poetry run uvicorn apps.api.main:app --reload --port 8001
|
||||
|
||||
# Or using the main function
|
||||
poetry run python -m apps.api.main
|
||||
```
|
||||
|
||||
The API will be available at:
|
||||
- API Base: http://localhost:8001
|
||||
- Interactive Docs: http://localhost:8001/docs
|
||||
- OpenAPI Schema: http://localhost:8001/openapi.json
|
||||
|
||||
Available endpoints:
|
||||
- `GET /health` - Health check endpoint
|
||||
- `GET /spec` - Capabilities specification
|
||||
|
||||
#### UI Server
|
||||
|
||||
Start the web interface:
|
||||
|
||||
```bash
|
||||
# Using uvicorn directly (port 8002)
|
||||
poetry run uvicorn apps.ui.main:app --reload --port 8002
|
||||
|
||||
# Or using the main function
|
||||
poetry run python -m apps.ui.main
|
||||
```
|
||||
|
||||
The UI will be available at:
|
||||
- Main page: http://localhost:8002
|
||||
- `GET /spec` - Capabilities specification
|
||||
|
||||
#### Other Applications
|
||||
|
||||
```bash
|
||||
# Abstraction
|
||||
poetry run python -m apps.abstraction.main
|
||||
|
||||
# Rules
|
||||
poetry run python -m apps.rules.main
|
||||
|
||||
# UI
|
||||
poetry run python -m apps.ui.main
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
TBD
|
||||
Reference in New Issue
Block a user