Metadata-Version: 2.4
Name: simple_module_products
Version: 0.0.1
Summary: Example CRUD module used as a reference / demo for building simple_module modules
Project-URL: Homepage, https://github.com/antosubash/simple_module_python
Project-URL: Repository, https://github.com/antosubash/simple_module_python
Project-URL: Issues, https://github.com/antosubash/simple_module_python/issues
Project-URL: Changelog, https://github.com/antosubash/simple_module_python/blob/main/CHANGELOG.md
Author-email: Anto Subash <antosubash@live.com>
License-Expression: MIT
License-File: LICENSE
Keywords: crud,demo,example,simple-module
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: simple-module-core==0.0.1
Requires-Dist: simple-module-db==0.0.1
Requires-Dist: simple-module-hosting==0.0.1
Description-Content-Type: text/markdown

# simple_module_products

Example CRUD module for [simple_module](https://github.com/antosubash/simple_module_python). **This is a reference / demo**, not a production-ready commerce module — it exists to show what a fully-featured `simple_module` module looks like end-to-end: `ModuleBase`, SQLModel table with `AuditMixin`, contracts, service, REST + Inertia endpoints, Browse/Create/Edit pages, tests.

Fresh `simple-module new` scaffolds *don't* include this by default — it's here as a readable example.

## Install

```bash
pip install simple_module_products
```

## What it provides

- `Product` SQLModel table with `name`, `sku`, `price_cents`, `AuditMixin`.
- Contracts (`ProductCreate`, `ProductUpdate`, `ProductRead`) under `products.contracts`.
- Service layer (`ProductsService`) encapsulating the (tiny) business logic.
- REST endpoints at `/api/products` + Inertia view endpoints at `/products`.
- Inertia pages `Products/Browse`, `Products/Create`, `Products/Edit`.
- Unit tests covering the service + integration tests hitting the full endpoint stack.

## Usage

It's a reference, so the most useful "usage" is reading the source:

- `modules/products/products/module.py` — the `ModuleBase` subclass.
- `modules/products/products/service.py` — business logic.
- `modules/products/products/pages/` — Inertia React pages.
- `modules/products/tests/` — the test patterns to copy into new modules.

If you do want a working `/products` in your own app:

```bash
uv add simple_module_products
# Alembic will now see the products schema at the next `alembic revision --autogenerate`.
```

## Depends on

- `simple_module_core`, `simple_module_db`, `simple_module_hosting`

## License

MIT — see [LICENSE](https://github.com/antosubash/simple_module_python/blob/main/LICENSE).
