Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/blooser/dynatable
Dynamic models for django
https://github.com/blooser/dynatable
django django-rest docker docker-compose mypy poetry postgresql pytest ruff
Last synced: 9 days ago
JSON representation
Dynamic models for django
- Host: GitHub
- URL: https://github.com/blooser/dynatable
- Owner: blooser
- License: mit
- Created: 2024-04-01T14:49:33.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-04-01T22:52:56.000Z (8 months ago)
- Last Synced: 2024-04-02T16:51:02.158Z (8 months ago)
- Topics: django, django-rest, docker, docker-compose, mypy, poetry, postgresql, pytest, ruff
- Language: Python
- Homepage:
- Size: 849 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DynaTable ๐
![CI Status](https://github.com/blooser/DynaTable/actions/workflows/docker-image.yml/badge.svg)
**DynaTable** is an innovative dynamic model builder tailored for Django, equipped with a potent REST API interface. It facilitates the on-the-fly creation, updating, and management of database models ๐. Crafted meticulously using Django, Django REST Framework, and PostgreSQL, DynaTable stands as an indispensable asset for applications necessitating versatile and dynamic database schema management.
---
## Technologies ๐ป
- [Python](https://www.python.org/)
- [Django](https://www.djangoproject.com/) + [Django REST Framework](https://www.django-rest-framework.org/)
- [PostgreSQL](https://www.postgresql.org/)
- [Docker](https://www.docker.com/)
- [Swagger](https://swagger.io/) and [Redoc](https://redoc.ly/)
- [Pytest](https://docs.pytest.org/en/stable/)
- [Poetry](https://python-poetry.org/)## Core Features ๐
- **Dynamic Model Creation** ๐ ๏ธ: Intuitively define and instantiate new database models via a RESTful interface.
- **Model Schema Updates** ๐ง: Seamlessly modify existing models' schemas without the need to adjust the underlying codebase.
- **Efficient Data Manipulation** ๐: Dynamically insert and retrieve data rows for any constructed model.
- **RESTful API Excellence** ๐: Capitalize on the robust functionality of Django REST Framework for streamlined API interactions.
- **PostgreSQL Integration** ๐พ: Guarantee strong and dependable data storage solutions with PostgreSQL.## Build and Run ๐๏ธ
### Building the Application
```bash
$ docker-compose build
```### Running the Application
```bash
$ docker-compose up -d
```## Multi-stage Build ๐ ๏ธ
DynaTable employs a sophisticated multi-stage building process, encapsulated within Docker for optimal efficiency and performance.
This advanced approach offers several significant benefits:
- Reduced Image Size
- Improved Security
- Optimized Build Caching## Exploring API Documentation with Swagger/Redoc ๐
DynaTable simplifies API documentation exploration by utilizing both Swagger and Redoc.
Navigate to:
- Swagger UI
```bash
http://localhost:8000/swagger
```- Redoc
```bash
http://localhost:8000/redoc
```
---## Unit Testing with Pytest ๐งช
The application boasts comprehensive unit test coverage utilizing Pytest.
Execute unit tests with:
```bash
$ docker-compose run test
```Or run bash script
```
$ ./run_tests.sh
```## Advanced Data Generation and Testing ๐
**DynaTable** rigorously tests its functionalities using Pytest alongside generated data, ensuring maximum effectiveness. The bespoke [generator](https://github.com/blooser/DynaTable/blob/master/src/tests/generator.py) module proficiently produces random model fields and data rows for database population. This ensures diverse testing scenarios and enhances the overall quality and reliability of the functions.
## Simulation ๐
The **DynaTable** includes a comprehensive [simulation](https://github.com/blooser/DynaTable/blob/master/src/simulation/__main__.py) module designed to show interactions with the server.
To invoke simulation, run
```bash
$ poetry run python src/simulation -t --host
```Or use script
```bash
$ ./run_simulation.sh
```---
![sim2](https://github.com/blooser/DynaTable/blob/master/images/sim2.png?raw=true)
# License
This project is licensed under the MIT License - view the [LICENSE.md](https://github.com/blooser/DynaTable/blob/master/LICENSE.md) file for details.