Metadata-Version: 2.4
Name: core-package
Version: 0.1.2
Summary: Shared Django/Ninja foundation (auth, RBAC, logging, base models) that downstream site packages (blog, ecommerce, portfolio, community, ...) install as a dependency.
License-Expression: MIT
Classifier: Framework :: Django
Classifier: Framework :: Django :: 5.2
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Django<5.3,>=5.2
Requires-Dist: django-ninja<2,>=1.4
Requires-Dist: asgiref>=3.8
Requires-Dist: email-validator<3,>=2.2
Requires-Dist: python-socketio<6,>=5.11
Requires-Dist: python-engineio<5,>=4.9
Requires-Dist: django-environ<1,>=0.12
Requires-Dist: argon2-cffi>=23
Requires-Dist: PyJWT<3,>=2.8
Requires-Dist: django-cors-headers<5,>=4.4
Requires-Dist: django-unfold>=0.60
Requires-Dist: whitenoise<7,>=6.7
Requires-Dist: Pillow>=10
Requires-Dist: requests<3,>=2.31
Provides-Extra: postgres
Requires-Dist: psycopg[binary]<4,>=3.2; extra == "postgres"
Provides-Extra: redis
Requires-Dist: django-redis>=5.4; extra == "redis"
Requires-Dist: redis<9,>=5; extra == "redis"
Provides-Extra: server
Requires-Dist: uvicorn[standard]>=0.30; extra == "server"
Dynamic: license-file

# core-package

**Author:** puzzllium · [puzzllium@gmail.com](mailto:puzzllium@gmail.com) · [LinkedIn](https://www.linkedin.com/in/puzzllium)

Shared Django/Ninja foundation (auth, RBAC, logging, base models, realtime) that
downstream site packages (blog, ecommerce, portfolio, community, ...) install as a
dependency.

## Install

```bash
pip install core-package
pip install "core-package[postgres,redis,server]"   # optional extras
```

Requires Python 3.10+ and Django 5.2.

## What's inside

The package ships the reusable `apps.*` library:

| App | Purpose |
| --- | --- |
| `apps.core` | Session-bound JWT auth, permissions, middleware, pagination, throttling, exceptions, audit logging, SMS helper, shared utils |
| `apps.users` | User model and user/auth API |
| `apps.roles` | Role-based access control (RBAC): roles, permissions, assignment |
| `apps.realtime` | Socket.IO server with JWT authentication |
| `apps.contacts` | Contact messages model, API and admin |
| `apps.events` | Events model, API and admin |

`config/` (settings, urls, asgi, the NinjaAPI instance) and `manage.py` are
host-project-only and are **not** part of the installable package. A site is a
host project with this package and one or more site packages installed and wired
into its settings and API.

## Dependencies

Version ranges are used (this is a library), so it won't conflict with the host project.

**Required**

| Package | Used for |
| --- | --- |
| Django `>=5.2,<5.3` | Web framework |
| django-ninja `>=1.4,<2` | REST API layer |
| asgiref `>=3.8` | ASGI support |
| email-validator `>=2.2,<3` | Email validation |
| python-socketio `>=5.11,<6`, python-engineio `>=4.9,<5` | Realtime (Socket.IO) |
| django-environ `>=0.12,<1` | Environment-based settings |
| argon2-cffi `>=23` | Password hashing |
| PyJWT `>=2.8,<3` | JWT tokens |
| django-cors-headers `>=4.4,<5` | CORS |
| django-unfold `>=0.60` | Admin theme |
| whitenoise `>=6.7,<7` | Static file serving |
| Pillow `>=10` | Image handling |
| requests `>=2.31,<3` | HTTP client |

**Optional extras**

| Extra | Installs |
| --- | --- |
| `postgres` | `psycopg[binary]>=3.2,<4` |
| `redis` | `django-redis>=5.4`, `redis>=5,<9` |
| `server` | `uvicorn[standard]>=0.30` |

## License

MIT. See [LICENSE](LICENSE).
