diff --git a/README.md b/README.md new file mode 100644 index 0000000..f723222 --- /dev/null +++ b/README.md @@ -0,0 +1,59 @@ +# API Inventario + +Microservicio REST para gestión de inventario (productos, categorías, stock). + +## Tech Stack + +- **Python 3.11** + **FastAPI** +- **PostgreSQL** + **SQLAlchemy ORM** +- **Docker** + **docker-compose** + +## Quick Start + +### Con Docker (recomendado) + +```bash +docker-compose up -d +``` + +API disponible en http://localhost:8000 +Swagger docs: http://localhost:8000/docs + +### Sin Docker + +```bash +pip install -r requirements.txt +uvicorn app.main:app --reload --port 8000 +``` + +## API Endpoints + +| Method | Endpoint | Descripción | +|--------|----------|-------------| +| GET | `/health` | Health check | +| POST | `/api/v1/categories` | Crear categoría | +| GET | `/api/v1/categories` | Listar categorías | +| GET | `/api/v1/categories/{id}` | Obtener categoría | +| PUT | `/api/v1/categories/{id}` | Actualizar categoría | +| DELETE | `/api/v1/categories/{id}` | Eliminar categoría | +| POST | `/api/v1/products` | Crear producto | +| GET | `/api/v1/products` | Listar productos (paginated) | +| GET | `/api/v1/products/{id}` | Obtener producto | +| PUT | `/api/v1/products/{id}` | Actualizar producto | +| DELETE | `/api/v1/products/{id}` | Eliminar producto | +| GET | `/api/v1/products/low-stock` | Productos con stock bajo | +| POST | `/api/v1/stock/move` | Registrar movimiento | +| GET | `/api/v1/stock/history/{product_id}` | Historial de movimientos | + +## Environment Variables + +| Variable | Default | Description | +|----------|---------|-------------| +| DATABASE_URL | postgresql://user:pass@localhost:5432/inventario | PostgreSQL connection string | +| DEBUG | false | Modo debug | +| API_VERSION | v1 | API version prefix | + +## Proyecto + +- Repositorio: https://gitea.danielarroyo.cl/proyectos/api-inventario +- Spec: [SPEC.md](./SPEC.md)