Skip to content

Django Project Template with Modular Architecture

Notifications You must be signed in to change notification settings

Negarkhodro/django_design_pattern

 
 

Repository files navigation

Django Project Template with Modular Architecture

Overview

This project is a Django-based template designed with a modular architecture, making it scalable and maintainable. It serves as a robust starting point for building applications that require clear separation of concerns and integration with various services.

Features

  • Modular API structure with versioning support (api/v1).
  • Service-oriented design integrating third-party services (e.g., Elasticsearch, Minio, RabbitMQ).
  • Custom management commands for streamlined operations.
  • Reusable components such as middleware, permissions, and caching strategies.
  • Repository pattern for data access, promoting clean and testable code.
  • Dependency Injection for improved testability and modularity in service integration and component management.
  • Custom validation to ensure data integrity and enforce business rules.
  • Pydantic integration for data validation and settings management, enhancing data integrity and configuration management.
  • Serializer management to handle data transformation and serialization across different API components.
  • URL management with organized routing configurations for different parts of the application.
  • Model management for effective database schema design and migrations, supporting scalable and maintainable data structures.
  • Comprehensive test suite with organized test modules

Project Structure

Here's a detailed breakdown of the project structure:

├── api
│   ├── __init__.py
│   └── v1
│       ├── admin
│       │   ├── __init__.py
│       │   └── users.py
│       ├── auth
│       │   └── __init__.py
│       ├── __init__.py
│       └── users
│           ├── __init__.py
│           └── users.py
├── apps.py
├── cache
│   ├── cache_decorators.py
│   └── __init__.py
├── __init__.py
├── injector
│   ├── base_injector.py
│   └── __init__.py
├── management
│   ├── commands
│   │   ├── create_superuser.py
│   │   ├── import_sql.py
│   │   ├── __init__.py
│   │   └── launch_queue_listener.py
│   └── __init__.py
├── middleware
│   ├── __init__.py
│   └── response.py
├── migrations
│   ├── 0001_initial.py
│   └── __init__.py
├── models
│   ├── base.py
│   ├── __init__.py
│   └── users.py
├── modules
│   ├── elastic_module.py
│   ├── __init__.py
│   ├── kavenegar_module.py
│   ├── minio_module.py
│   ├── rabbitmq_module.py
│   └── redis_module.py
├── permissions
│   ├── __init__.py
│   └── permissions.py
├── repositories
│   ├── base_repo.py
│   ├── __init__.py
│   └── users_repo.py
├── schemas
│   ├── __init__.py
│   └── users.py
├── serializers
│   ├── admin
│   │   ├── __init__.py
│   │   └── user_serializers.py
│   ├── auth
│   │   ├── auth_serializers.py
│   │   └── __init__.py
│   ├── __init__.py
│   └── users
│       ├── __init__.py
│       └── users_serializers.py
├── services
│   ├── elasticsearch
│   │   ├── elasticsearch.py
│   │   ├── indexing
│   │   │   ├── __init__.py
│   │   │   └── users_index.py
│   │   └── __init__.py
│   ├── __init__.py
│   ├── kafka
│   │   ├── consumer.py
│   │   ├── __init__.py
│   │   ├── producer.py
│   │   ├── producer_user_created.py
│   │   └── queue_listener.py
│   ├── minio
│   │   ├── __init__.py
│   │   └── minio.py
│   ├── rabbitmq
│   │   ├── __init__.py
│   │   └── rabbitmq.py
│   ├── redis
│   │   ├── __init__.py
│   │   └── redis.py
│   └── sms
│       ├── __init__.py
│       ├── kavenegar.py
│       └── tasks.py
├── signals
│   ├── __init__.py
│   ├── receivers.py
│   └── signals.py
├── tests
│   ├── admin
│   │   └── __init__.py
│   ├── base_test.py
│   ├── __init__.py
│   └── users
│       ├── __init__.py
│       └── test_user_login.py
├── urls
│   ├── admin
│   │   ├── admin.py
│   │   └── __init__.py
│   ├── __init__.py
│   ├── urls.py
│   └── users.py
└── utils
    ├── exceptionhandler.py
    ├── helper.py
    ├── __init__.py
    ├── messages.py
    └── validations.py

This structure provides a detailed view of the project's organization, including:

  • API versioning (api/v1)
  • Custom management commands
  • Model definitions
  • Service integrations (Elasticsearch, Kafka, Minio, RabbitMQ, Redis, SMS)
  • Serializers for different parts of the application
  • Test structure
  • URL configurations
  • Utility functions and helpers

About

Django Project Template with Modular Architecture

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%