- π Overview
- πΎ Features
- π Project Structure
- π Getting Started
- π Project Roadmap
- π° Contributing
- π License
- π Acknowledgments
Aksiyamix.git is an open-source project solving seamless Docker service orchestration for production and development environments. Key features include managing services like web apps, databases, and workers, automating deployments to Azure VMs, and simplifying Django app configuration. Ideal for developers seeking efficient Docker-based project management and deployment workflows.
Feature | Summary | |
---|---|---|
βοΈ | Architecture |
|
π© | Code Quality |
|
π | Documentation |
|
π | Integrations |
|
𧩠| Modularity |
|
π§ͺ | Testing |
|
β‘οΈ | Performance |
|
π‘οΈ | Security |
|
π¦ | Dependencies |
|
βββ aksiyamix.git/
βββ .github
β βββ workflows
βββ Dockerfile
βββ LICENSE
βββ README.md
βββ docker-compose.dev.yml
βββ docker-compose.prod.yml
βββ requirements
β βββ common.txt
β βββ dev.txt
β βββ prod.txt
βββ src
βββ .env.example
βββ __init__.py
βββ apps
βββ config
βββ main.py
βββ manage.py
We believe in the power of collaboration. Below are some of our amazing contributors:
Name | Project Spent Time | |
---|---|---|
Mukhsin Mukhtorov |
AKSIYAMIX.GIT/
__root__
docker-compose.prod.yml - Orchestrates Docker services for a production environment, including a web app, PostgreSQL, Redis, Celery worker, and Celery beat
- Manages migrations, static files, and runs the web server
- Dependencies ensure proper service startup
- Configuration is defined in a Docker Compose file.docker-compose.dev.yml - Orchestrates Docker services for the project, including web app, PostgreSQL, Redis, Celery worker, and Celery beat
- Manages build, container setup, environment variables, ports, volumes, and dependencies
- Enables seamless development environment setup and service communication.Dockerfile Builds a Docker image for the project by setting up a Python environment, installing dependencies, and copying source code.
.github
workflows
deploy.yml - Facilitates automated deployment to an Azure VM upon main branch push
- Utilizes SSH for secure access, updating the application via Git, and managing Docker containers with docker-compose.
src
main.py - Generates Django app configuration files based on directory structure in the apps folder
- Creates necessary directories and initializes files for models, views, serializers, signals, translations, validators, utils, tasks, admin, tests, and URLs
- Configures Django app settings dynamically for each app.manage.py Facilitates Django administrative tasks by setting up the environment and executing commands. .env.example Define and configure essential environment variables for Django, SMTP, database, Docker, ESKIZ_UZ, Redis, and Payme Payment Settings in the .env.example file. config
celery.py - Defines and configures Celery for asynchronous task processing in the Django project
- Sets up Celery app, imports Django settings, and auto-discovers tasks
- Includes a debug task for testing Celery functionality.urls.py - Define the API endpoints for various modules within the Django project, including authentication, user management, tags, services, and more
- Integrate Swagger and Redoc for API documentation
- Serve media files using Django settings.yasg.py - Generates an API schema view with basic information like title, version, and permissions
- This view is publicly accessible and follows the BSD License.asgi.py - Expose the ASGI callable as a module-level variable named 'application' for the config project
- Set the DJANGO_SETTINGS_MODULE to 'config.settings' and retrieve the ASGI application for deployment.wsgi.py - Expose the WSGI callable as a module-level variable named ``application`` for the config project
- Set the DJANGO_SETTINGS_MODULE to 'config.settings' and initialize the WSGI application for deployment.settings
base.py - Defines the foundational settings and configurations for the Django project, including middleware, installed apps, and template settings
- Manages key aspects such as security, internationalization, and static file handling
- Centralizes essential parameters like time zone, database fields, and media storage paths.database.py - Configure database and cache settings based on environment variables, supporting both PostgreSQL and SQLite
- The file src/config/settings/database.py sets up database connections and cache configurations for the Django project, utilizing environment variables for sensitive information.rest_framework.py - Configures default settings for the REST framework, including authentication, rendering, parsing, permissions, pagination, filtering, throttling, versioning, and more
- Defines various classes and parameters to ensure consistent behavior and customization across API endpoints.languages.py - Defines language settings and paths for internationalization in the Django project
- Sets the default language to Uzbek and includes support for Russian
- Specifies the locale paths for translations.celery.py - Define Celery settings for task scheduling and result backend using Redis
- Set timezone to Asia/Tashkent and enable task tracking
- Configure a scheduled task to run 'get_currency' daily at midnight.sms_providers.py Retrieve and store credentials for Eskiz UZ email and password from environment variables. payme.py - Define dynamic Payme payment settings based on environment, loading credentials from environment variables
- Set Payme username, password, and callback URL depending on the environment (development or production) to ensure proper configuration for Payme integration within the project.debug_toolbar.py Enables debugging tools for local development by specifying internal IP addresses. ckeditor.py - Define custom configurations for CKEditor 5, including toolbar options, block styles, image settings, table properties, and heading options
- Customize color palettes for borders and backgrounds, enhancing the editor's visual appearance and functionality
- Optimize content creation experience by providing a tailored set of features and styling choices within the CKEditor environment.auth.py - Define the authentication settings for the project, specifying the user model and login/logout URLs
- This configuration file centralizes authentication-related parameters, ensuring consistency and ease of management across the codebase.simplejwt.py Define JWT settings for token lifetimes, authentication rules, and serializers in Django project. apps
main.py - Improve application performance by implementing caching mechanisms in the main.py file
- This code optimizes data retrieval and processing, enhancing overall system efficiency.features
tests.py Implements unit tests for feature functionality in the project, ensuring robustness and reliability. apps.py Defines configuration for the 'features' app within the Django project, specifying the default database field type. urls.py - Defines URL patterns for the project's features, mapping endpoints to corresponding views
- This file plays a crucial role in routing user requests to the appropriate functionality within the codebase architecture.admin.py - Improve admin feature functionality by managing user permissions and access control
- This code file enhances the project's architecture by centralizing admin-related operations, ensuring secure and efficient management of user roles and permissions.models
feature.py - Defines models for features and feature values, ensuring uniqueness based on category and name
- Automatically generates slugs and prevents duplicate entries
- Supports parent-child relationships between features
- Maintains data integrity and consistency within the database.views
features.py - Defines a view for listing active features with their children, ordered by a specific criteria
- It enforces authentication and uses a custom list API view for serialization.feature_values.py Improve user experience by displaying feature values in the application's views. serializers
features.py - Serializes features with their associated values for the project's frontend display
- The code defines the structure and fields to be included when converting Feature model instances into JSON format
- This serializer plays a crucial role in ensuring that feature data is properly formatted and accessible for rendering on the user interface.feature_values.py - Defines serialization for feature values in the project, specifying fields like feature, value, and slug
- This serializer is crucial for handling data related to feature values within the codebase architecture.wishlists
tests.py Implements unit tests to ensure the functionality and reliability of the wishlists feature within the project. apps.py Defines configuration for wishlists app in Django project, specifying default auto field and app name. urls.py - Defines URL patterns for wishlists feature, facilitating navigation within the project
- This file plays a crucial role in routing user requests to the appropriate views, enhancing the overall user experience.admin.py - Manages administrative operations for wishlists in the project, ensuring smooth management and organization of wishlist-related data
- This code file plays a crucial role in overseeing and handling administrative tasks related to wishlists within the project architecture.models
wishlist.py - Defines a WishList model that links users to discounts in the project's Django-based architecture
- The model inherits from an abstract base model and specifies relationships with user and discount entities
- The code ensures data integrity and consistency within the wishlists module.branches
tests.py - Implements unit tests for the branches functionality in the project, ensuring proper behavior and functionality
- This code file plays a crucial role in maintaining the reliability and correctness of the branches feature within the overall codebase architecture.apps.py - Defines the configuration for the 'branches' app within the Django project, specifying the default auto field and app name
- This file plays a crucial role in organizing and managing the branches functionality within the overall project architecture.urls.py - Defines URL patterns for branch-related operations in a Django project
- Maps endpoints to corresponding viewsets for listing, retrieving, creating, updating, and deleting branches
- Facilitates routing requests to appropriate handlers, enhancing the project's API functionality and maintainability.admin.py Manages administrative tasks for branches in the project, ensuring smooth operations and efficient management. models
branch.py - Defines a model for branch companies within the project, including fields for company details, contact information, location, and unique ID generation
- The model ensures data integrity and uniqueness by generating a unique ID for each instance
- It also provides methods for retrieving the branch address and cleaning data before saving.views
branches.py - Manages branch data through CRUD operations, ensuring authentication for each action
- Lists all branches, retrieves a specific branch by ID, creates a new branch, partially updates branch details, and deletes a branch
- Validates data, returns appropriate responses, and handles errors effectively.serializers
branches.py - Defines serializers for BranchCompany model to handle list, detail, creation, and update operations
- Serializers include fields like company, title, phone numbers, address, region, district, delivery, longitude, and latitude
- Custom logic for creating and validating branch data is implemented.ratings
tests.py Implements unit tests to ensure the reliability and accuracy of the ratings functionality within the project. apps.py - Defines the configuration for the ratings app within the Django project, specifying the default auto field and app name
- This AppConfig class plays a crucial role in managing the ratings functionality within the overall project architecture.urls.py Defines URL patterns for creating ratings using the RatingCreateViewSet in the Django project. admin.py - Enables management of ratings data in the admin interface, facilitating easy access and modification of rating-related information
- This functionality enhances the overall user experience by providing a streamlined process for administrators to oversee and update ratings within the system.models
rating.py - Defines a Django model for ratings, linking companies and users with a rating value
- Ensures rating value falls within a specific range
- Maintains a unique constraint for each company-user pair.views
ratings.py Defines a view set for creating ratings with authentication permissions, utilizing a custom model view set. serializers
ratings.py Defines a serializer for ratings data, specifying fields for company and rating value. notifications
tests.py Tests the notification functionality to ensure proper functioning within the project architecture. apps.py Defines the configuration for the notifications app within the Django project. urls.py - Defines URL patterns for the notifications app, facilitating routing and navigation within the project
- This file plays a crucial role in directing users to specific functionalities and views within the notifications module, enhancing the overall user experience and interaction with the application.admin.py - Improve notification management in the admin interface by enhancing the functionality for managing notifications
- This code file plays a crucial role in the project's architecture by enabling efficient handling and customization of notifications within the admin panel.models
notifications.py - Defines a model for notifications with various types like News, Follow, and Payment
- Includes fields for title, image, and message
- Establishes a relationship with the Company model.tags
tests.py Implements unit tests for the tags functionality in the project, ensuring the reliability and accuracy of tag-related features. apps.py - Defines configuration for the 'tags' app within the Django project, specifying the default auto field and app name
- This file plays a crucial role in organizing and managing the functionality related to tags within the overall project architecture.urls.py - Defines URL patterns for tag-related functionalities in the Django project, mapping endpoints to corresponding views
- The code in this file facilitates routing requests to the appropriate API views for filtering and creating tags within the application.admin.py Defines Django admin settings for managing Tag model, displaying key fields and enabling search/filter capabilities. create_objects.py - Generates tags for the application by creating Tag objects with predefined names and setting them as active
- The function bulk creates these Tag objects in the database.models
tags.py - Defines a Tag model that inherits from AbstractBaseModel, providing a name field for storing unique tags
- The model is structured to interact with the database table 'tag'.views
search_tags.py - Implements a generic API view for searching tags by name prefix
- Returns a list of tag IDs and names based on the provided query parameter.create_tags.py - Enables authenticated users to create tags for discounts using a bulk serializer
- The TagsCreateAPIView class handles the POST request to save validated tag data, ensuring a seamless tag creation process within the project's architecture.serializers
create_tags.py Handles bulk creation of tags by checking existing tags and creating new ones if needed, then returns the updated list of tags. likes
tests.py Implements unit tests for the likes functionality in the project, ensuring proper behavior and functionality. apps.py - Defines configuration for the 'likes' app within the Django project, specifying the default auto field and app name
- This code file plays a crucial role in organizing and managing the 'likes' functionality within the overall project architecture.urls.py - Defines URL patterns for handling discount reactions using Django and REST framework routers
- Integrates DiscountReactionViewSet with DefaultRouter to register reactions endpoint
- Organizes URLs for easy access and navigation within the likes app.admin.py Manages admin functionality for handling likes within the project, contributing to a seamless user experience. signals
like_counts.py - Handles updating total likes and dislikes for discounts by triggering Celery tasks upon creation or deletion of like/dislike instances
- Signals are used to listen for post-save and post-delete events on DiscountLike and DiscountDislike models, respectively
- The actual count updates are delegated to a separate task for efficiency.tasks
update_discount_likes_count.py - Implements a Celery task to update likes or dislikes count for a discount in the database using atomic increments/decrements
- Handles actions like incrementing likes, decrementing likes, incrementing dislikes, and decrementing dislikes
- Retries up to 3 times if the discount is not found.models
dislikes.py - Defines a model to link users with disliked discounts, ensuring each user can dislike a discount only once and not simultaneously like and dislike the same discount
- Tracks which user disliked which discount, enforcing constraints on user and discount choices.likes.py - Defines a model to link users with liked discounts, ensuring each user can like a discount only once and not simultaneously like and dislike the same discount
- Tracks user likes and associated discounts, enforcing constraints for active and approved items.views
likes.py - Implements a DiscountReactionViewSet for managing likes and dislikes on discounts, providing functionalities to add/remove likes and dislikes, view statistics, and list user's liked and disliked discounts
- Handles actions like liking, disliking, and retrieving statistics on discount reactions.serializers
dislikes.py Serializes dislike data for discounts in the project, ensuring secure and efficient data handling. stats.py - Calculates and provides statistics on likes, dislikes, and user interactions within the likes feature of the project
- The serializer class defines fields for total likes, total dislikes, and user interactions, enhancing the user experience by displaying relevant engagement data.likes.py Serializes DiscountLike model data for user interaction, ensuring only specific fields are exposed. permissions
permissions.py - Defines permissions for admin and users to manage their own Likes/Dislikes
- Allows admin users full access and restricts regular users to managing their own actions
- Checks ownership for DELETE requests and permits GET requests.users
tests.py Implements unit tests for user-related functionalities in the project, ensuring robustness and reliability. apps.py - Defines the configuration for the users app within the Django project, specifying the default auto field and app name
- This file plays a crucial role in organizing and managing the users-related functionality within the overall project architecture.urls.py - Defines URL patterns for user-related functionalities like forgot password and profile management in the Django project's users app
- The code maps specific URLs to corresponding views for handling password reset, profile retrieval, and updates
- This file plays a crucial role in routing user requests to the appropriate API views within the project's architecture.admin.py Manages administrative functionalities for user accounts in the project, ensuring smooth operations and efficient user management. create_objects.py - Generates user objects with predefined phone numbers and names, then bulk creates them in the database using the CustomUser model
- This functionality is crucial for efficiently populating the user database with test data.management
commands
create_super_user.py Creates a super user with predefined details in the Django user model. validators
phone_number.py Validates phone numbers to ensure they adhere to the required format within the users module of the project. models
users.py - Define a fully-featured User model with admin permissions, including fields like username, email, phone number, and more
- Implement custom validation for phone numbers and handle user data cleaning
- Additionally, provide functionality to send emails to users
- This model enhances user management within the project's architecture.views
profile.py - Enables authenticated users to retrieve and update their profile information
- Uses Django's authentication system and REST framework for permissions
- Inherits from a custom API view class and utilizes a specific serializer for user profile data
- Designed to ensure secure access and seamless interaction with user data within the project's architecture.forgot_password.py - Manages the process of sending a password reset link to a phone number and setting a new password for a user
- Validates the token provided in the request against the cache and handles the password update operation securely
- This functionality is crucial for user account security and password recovery within the application.utils
sms_providers.py - The code in `sms_providers.py` file handles the generation and sending of SMS messages for various user actions like password reset and authentication
- It interacts with external APIs to obtain authentication tokens and send SMS messages with dynamic content
- This utility class centralizes SMS functionality for user-related operations within the project architecture.managers.py - Manages user creation and authentication by extending Django's built-in UserManager
- Handles the creation of regular users and superusers with specific permissions and password hashing
- Ensures superusers have the correct staff and superuser flags set.serializers
profile.py - Enables serialization for user profile data, including fields like username, email, and phone number
- Utilizes Django and REST framework for seamless integration with the project's user model
- Provides read-only access to certain fields and custom validation logic for user data.forgot_password.py - Implements serializers for handling forgot password and setting a new password for users
- Validates user input, checks user existence, and sends reset password links via SMS
- Manages password reset tokens and generates JWT tokens for authentication
- Includes IP address limit checks for security.categories
tests.py Implements unit tests for the categories app to ensure functionality and reliability within the project architecture. apps.py - Defines configuration for the 'categories' app within the Django project, specifying the default database field type
- This AppConfig class is crucial for managing the app's behavior and settings within the larger project architecture.urls.py - Defines URL patterns for category-related endpoints using Django and REST framework routers
- Maps views to specific HTTP methods for listing categories and retrieving children categories based on parent ID
- Integrates with the project's category functionality within the specified app structure.admin.py - Defines Django admin settings for managing Category models, specifying displayed fields, filter options, and prepopulated slug field
- This code enhances the admin interface functionality, streamlining the process of managing and organizing categories within the project.models
category.py - Define and enforce validation rules for category models, ensuring proper categorization and hierarchy within the system
- Implement checks for category levels and icon presence, along with slug generation and uniqueness validation
- Maintain data integrity and consistency for managing categories effectively.views
category.py - Defines view sets for category data retrieval based on parent-child relationships
- Manages listing top-level categories and fetching children categories under a specific parent category
- Utilizes custom read-only model view sets for efficient data handling.serializers
category.py Serializes category data for the project, defining the fields to be included in the output. boosts
tests.py Improve Boosts functionality by testing Boosts API endpoints. apps.py Defines BoostsConfig class for Django app configuration in src/apps/boosts/apps.py. urls.py Defines URL patterns for boosting functionality within the project, facilitating navigation and interaction with boost-related features. admin.py Manages administrative functionalities for boosts in the project, contributing to the overall architecture. models
boost_tariff.py - Defines BoostTariff model with quantity and price fields, inheriting from AbstractBaseModel
- This model represents boost tariffs within the boosts application, contributing to the overall data structure and functionality of the project.boost_discount.py Defines BoostTariff model with a discount field that establishes a ForeignKey relationship with the Discount model. company_boost_tariff.py Defines company-specific boost tariffs for quantity and price, linking them to the respective company. authentication
tests.py Tests user authentication functionality to ensure secure access and data protection within the project's authentication module. apps.py - Defines the configuration for the authentication app within the Django project, specifying the default auto field and app name
- This file plays a crucial role in structuring the authentication functionality within the overall project architecture.urls.py - Defines authentication and registration URL patterns for the Django project, integrating JWT authentication with custom views
- The file organizes endpoints for user login, token refresh, sending verification codes, and user registration
- It plays a crucial role in managing user authentication and registration flows within the project architecture.admin.py Manages administrative functionalities for user authentication within the project architecture, ensuring secure access and user management. views
register.py - Handles user registration, verification, and code sending for phone number verification
- Utilizes serializers to validate and process data, returning responses with validated data
- Implements custom generic API views for registration, code verification, and code sending functionalities.utils
services.py - Generates JWT tokens for user authentication, utilizing the rest_framework_simplejwt library
- The function creates a refresh token and an access token for the user, returning them as a dictionary
- This service plays a crucial role in enabling secure user authentication within the project's architecture.services
username_type.py - Define a function to determine if a username is an email or phone number
- The function validates the input and returns the type accordingly
- This code file plays a crucial role in the authentication service by identifying the type of username provided, ensuring proper handling based on the input type.serializers
register.py - Handles user registration, code verification, and token generation
- Validates user input, sends registration code, verifies code, and creates a new user with validated data
- Utilizes Django models, serializers, and cache for user authentication
- Integrates with EskizUz SMS provider for code sending.products
tests.py Implements unit tests for the products application to ensure functionality and reliability within the project architecture. apps.py Defines the configuration for the 'products' app within the Django project, specifying the default auto field and app name. urls.py - Defines URL patterns for product-related endpoints using Django's path function, connecting requests to the ProductViewSet for handling
- This file plays a crucial role in routing incoming requests to the appropriate view functions within the products app, ensuring seamless navigation and interaction with product-related functionalities.admin.py Manages administrative functionalities for products within the project, ensuring smooth operations and efficient management of product-related data. validators
image_size.py Validates product image size to ensure it meets specified dimensions within the project's architecture. models
product.py - Defines a Django model for products with fields like company, category, title, and image
- Establishes relationships with other models and enforces constraints for data integrity.views
product.py - Handles CRUD operations for products in the API, ensuring authentication and permission checks
- Retrieves, lists, creates, updates, partially updates, and deletes products
- Utilizes serializers for data manipulation and custom exceptions for error handling
- Maintains data integrity and security throughout product management processes.serializers
product.py - Handles serialization and validation for products in the project
- Manages permissions, enforces product count limits, and ensures only authorized users can create or update products
- Integrates with the Django REST framework to streamline product data handling within the system.permissions
permissions.py - Enforces permissions for editing products based on user roles
- Allows company owners and staff to modify products while restricting access for others.general
tests.py - Improve testing coverage for the general application by adding comprehensive test cases in the tests.py file
- This will ensure robustness and reliability of the general application module within the codebase architecture.apps.py Defines configuration for the 'general' app within the Django project, specifying default database field and app name. urls.py - Defines URL patterns for the general application, mapping specific URLs to corresponding views
- This file plays a crucial role in routing user requests to the appropriate functionality within the project architecture.admin.py Improve data management and access control in the admin interface for the general application. tasks
get_currency.py - Retrieve and print the latest USD to UZS exchange rate and its establishment date from a specified URL using requests library
- This task is executed asynchronously as a shared task using Celery, enhancing the project's scalability and performance.validators
validators.py Validate user input to ensure data integrity and security within the general application module. models
general.py - Validate and store company balance replenishment limits and currency exchange rates in the database
- Ensure the minimum replenishment amount is less than the maximum amount to prevent errors
- The models maintain data integrity for financial transactions and currency conversions within the application.base
tests.py Tests the functionality of the base app in the Django project. apps.py Defines the configuration for the base app in the Django project, including the default database field and signals. signals.py - Handles file deletion operations for objects in the base app by utilizing Django signals
- The code in signals.py listens for post_delete and pre_save signals to trigger functions that delete associated files
- This ensures that files are cleaned up when objects are deleted or updated within the base app.pagination.py - Implements custom pagination settings for the base application using the PageNumberPagination class from the rest_framework module
- Sets default page size, page query parameter, page size query parameter, and maximum page size for the pagination functionality in the project.authenticate.py - Improve user authentication by validating credentials and generating JWT tokens
- Ensure active user status and handle exceptions gracefully
- This code file enhances security and user experience within the project's authentication flow.admin.py Defines a custom admin class in Django to handle model saving with user tracking. exceptions.py Defines a custom exception class to handle API errors with specified details and codes. handlers.py Handles exceptions related to protected database objects, providing a custom response message. validators
validators.py - Validates image size and YouTube URLs in the base application, ensuring images meet specified dimensions and YouTube URLs are valid
- The code enhances data integrity by preventing invalid image uploads and incorrect YouTube URLs.models
base.py - Enhances data integrity and consistency by normalizing text fields before saving in the database
- Implements a general abstract base model with auto-generated UUID primary key and timestamp fields for tracking creation and updates
- Maintains relationships with user models for auditing purposes.views
viewsets.py - Defines custom viewsets for different types of API endpoints in the project architecture
- The code file in src/apps/base/views/viewsets.py extends functionality from the rest_framework module to create custom ViewSets for handling various types of requests, such as basic, generic, model-based, and read-only endpoints.generics.py Defines custom generic API views for handling various CRUD operations in the project architecture. api_views.py Defines a custom API view class for the base app, contributing to the project's architecture. utils
region_choices.py - The code file `region_choices.py` in the `src/apps/base/utils` directory defines region choices for a Django model, providing a list of regions with corresponding integer values and translated names
- This file serves the purpose of centralizing and organizing region choices within the codebase architecture, enabling easy access and consistency in referencing regions throughout the project.services
normalize_text.py - Normalizes text in CharField and TextFields of Django models by removing extra whitespaces
- This service function iterates over the fields of a given model object and joins the text fields after splitting them by whitespaces
- This ensures consistent formatting and improves data quality within the project's database.delete_files.py - Manages file deletion for objects in the Django project, ensuring files are removed after object deletion or update
- It iterates through object fields, deleting associated files from storage if they exist
- This functionality helps maintain data integrity and storage efficiency within the project architecture.serializers
abstract_serializer.py Implements user-based data tracking for create and update operations in serializers, ensuring proper attribution of user actions within the application. model_serializer.py - Defines a custom model serializer by extending the Django Rest Framework's ModelSerializer and an abstract custom serializer mixin
- This code file plays a crucial role in serializing model data within the project's architecture, ensuring efficient data handling and transformation for API responses.serializer.py Defines a custom serializer class that extends the functionality of the Django REST framework serializers. payments
tests.py Tests payment processing functionality to ensure accurate and reliable payment transactions within the project architecture. apps.py Defines the configuration for the payments app within the Django project, specifying the default auto field and app name. urls.py - Defines URL patterns for payment-related views using Django and REST framework routers
- Registers endpoints for payment processing and initialization
- Integrates these views into the project's URL structure.admin.py - Manages administrative tasks for payments within the project, ensuring smooth operations and efficient handling of payment-related functionalities
- This code file plays a crucial role in overseeing and managing payment processes, contributing to the overall architecture's robustness and effectiveness.models
orders.py - Defines an Order model for payment processing, utilizing an 8-character unique ID and linking to the Transaction model
- Tracks order details like company, amount, and payment status
- Facilitates order and transaction management within the system architecture.transactions.py - Manages payment transactions, capturing details like payment system, status, amount, and errors
- Associated with orders, it records a comprehensive payment history.views
initialization.py - Implements an API for Payme merchant API Initialization, creating new unpaid orders, generating Payme parameters, and providing frontend data for redirection to Payme's payment page
- This code file resides in the 'src/apps/payments/views/initialization.py' path within the project structure.payments.py - Implements API endpoints for handling payment transactions, including creating, performing, and canceling transactions, as well as checking transaction status and generating transaction history
- Facilitates interaction between the app and Payme merchant API, enabling seamless payment processing flow for users.utils
payme_errors.py - Formats error and success responses from Payme API, providing structured messages and HTTP status codes
- The class contains predefined error codes and messages for common scenarios, ensuring consistent response handling across the payments module.unique_id.py - Generates unique IDs for the Order model in the payments application by creating an 8-character alphanumeric string
- This utility function ensures each order has a distinct identifier within the project's architecture.serializers
orders.py - Serializes Order model data for payments, including company, amount, and payment status
- Prevents modification of payment status through read-only fields.transactions.py Serialize transaction data for payments module. initialization.py Generates a payment initialization serializer for orders, converting the amount to tiyin and structuring payment data for the merchant. companies
tests.py - Improve test coverage for the companies app by adding comprehensive unit tests in the tests.py file
- This ensures robustness and reliability in the codebase architecture, enhancing overall project quality and stability.apps.py - Defines the configuration for the 'apps.companies' module within the Django project, specifying the default auto field type
- This AppConfig class plays a crucial role in managing the behavior and metadata of the companies app within the overall project architecture.urls.py - Defines URL patterns for various company-related views, including checking usernames, company operations, timetable management, and ratings
- Organizes endpoints for listing, creating, updating, and deleting companies and their timetables, as well as rating companies
- Facilitates structured navigation and interaction with company data within the project.generate_objects.py Generates objects for company entities in the project architecture. admin.py - Registers the Company model with the Django admin interface, allowing administrators to manage company data efficiently
- This code file plays a crucial role in the project architecture by enabling seamless interaction with company-related information within the admin panel.validators
company_logo_size.py Validates company logo and icon sizes to ensure they meet specified dimensions and file size limits within the project's company module. company_banner_size.py Validates company banner size and dimensions to ensure they meet specified criteria for upload in the project's company application. company_video_size.py Validates the size of company videos to ensure they do not exceed 15 MB. models
company_time_table.py Generates unique CompanyTimeTable IDs and enforces constraints for company and branch schedules, ensuring start times precede end times. company.py - Defines the data structure and behavior of a Company model within the project, encompassing various attributes such as owner details, contact information, ratings, and geographical data
- It also includes methods for generating unique identifiers and cleaning data before saving
- This model serves as a core entity for managing company-related information and interactions within the system.views
company_time_table.py - Handles CRUD operations for company timetables, including listing, retrieving, creating, updating, and deleting entries
- Implements necessary permissions for authenticated users
- The code provides endpoints to interact with company time tables, ensuring data integrity and security within the project's architecture.ratings.py - Implements functionality to create and update ratings for companies based on user input
- Calculates total weighted rating and updates rating counts accordingly
- Provides an endpoint for managing company ratings within the project's architecture.company.py - Implements ViewSets for CRUD operations on Company objects, including listing, retrieving, creating, updating, and deleting companies
- Utilizes serializers for data manipulation and authentication permissions for secure access control
- Supports actions like checking username availability and interacting with company data through RESTful endpoints.serializers
company_time_table.py - Manages serialization for company time table data, ensuring proper handling of create, update, and retrieve operations
- Maintains consistency in data structure and read-only fields across different serializer actions.ratings.py Serialize company ratings data for API responses. company.py - Enhances company data serialization by providing tailored views for list, creation, update, deletion, and retrieval operations
- Optimizes data presentation and manipulation for improved user experience and efficient data management within the project's architecture.choice
disctrict.py Define district and region choices for various regions in Uzbekistan. country.py Define country choices for specific locations in the project's Django application. enums
week_day.py Define the order of the week days using integer choices for the companies app. discounts
tests.py Verifies discount calculation accuracy in the discounts module, ensuring correct application of promotional offers. apps.py Defines configuration for discounts app, including signal imports. urls.py - Defines URL patterns for the discounts application, facilitating navigation within the project
- This file plays a crucial role in routing user requests to the appropriate views, enhancing the overall user experience.admin.py - Manages discount administration functionality within the project architecture, ensuring seamless handling of discount-related operations
- This code file plays a crucial role in overseeing the configuration and management of discounts, contributing to the overall efficiency and organization of the system.choices.py Define integer choices for currency and discount types in the Django application. signals
discount_feature.py Updates discount prices based on new features to maintain accurate pricing in the system. validators
image_size.py Validate discount image size to ensure it meets specified dimensions within the project's architecture. video_size.py - Validate video files for discounts based on format, duration, and resolution to ensure compliance with supported extensions, time limits, and quality standards
- The code enforces constraints for video files uploaded for discounts, safeguarding against unsupported formats, excessive durations, and inadequate resolutions.discount.py Validates various discount types based on specific criteria to ensure data integrity and consistency within the discounts module. models
discount_image.py - Defines a model for discount images linked to discounts, enforcing image size validation
- Automatically updates the associated discount's image when the ordering number is set to 1.discount_feature.py - Defines a model for discount features with fields like price, quantity, and remainder
- Ensures data integrity by validating old price against price and remainder against quantity
- Maintains a relationship with discounts and feature values.discount.py - Defines a Django model for discounts with various attributes like title, price, description, and more
- Handles features, validations, and category assignments
- Implements methods for feature retrieval, cleaning, and saving discount instances.utils
unique_id.py - Generates unique company IDs by combining random letters and digits
- Located in the discounts app, this code file plays a crucial role in assigning distinct identifiers within the project architecture.serializers
discount_image.py - Serialize discount image data for the discounts app, mapping fields to the DiscountImage model
- The DiscountImageSerializer class defines the structure for handling discount image information, including discount, image, ordering number, and creation timestamp
- It ensures proper data representation for discount images within the project architecture.discount_feature.py Serializes discount feature data for the project's architecture, focusing on specific fields for DiscountFeature model. discount.py - Handles serialization and database transactions for creating and updating discount objects
- Manages features, images, and validation, ensuring data integrity
- Supports atomic operations for maintaining consistency in the discount creation and update processes within the project's architecture.services
tests.py Implements unit tests for the services module, ensuring functionality and reliability within the project's codebase architecture. apps.py - Defines configuration for the services app within the Django project, specifying the default auto field and app name
- This file plays a crucial role in organizing and managing the services module within the overall project architecture.urls.py - Defines URL patterns for service-related API endpoints in the Django project
- Maps specific URLs to corresponding views for listing and creating services.admin.py - Defines custom admin settings for the Service model in Django, enhancing the display and editing capabilities within the admin interface
- The code in this file centralizes the configuration for how Service instances are presented and managed, ensuring a streamlined user experience for administrators interacting with service data.create_objects.py - Generates services for the project by creating instances of the Service model with predefined names and settings
- The code populates the database with various service options, enhancing the project's functionality and user experience.translations
services.py Enables translation of service names within the project's services module. validators
image_size.py Validates image size to ensure it meets specified dimensions within the project architecture. models
services.py - Implements a Django model for services with fields for name, slug, icon, and activation status
- Ensures slug uniqueness and icon presence when service is active
- Extends AbstractBaseModel and handles custom exceptions.views
service_create.py Enables authenticated users to create new services using a custom API view and serializer within the project's services module. service_list.py Implements a custom list API view for services, filtering active services and serializing them using a specific serializer. serializers
service_create.py Enables creation of service objects by defining serialization rules for service data. service_list.py - Serializes service data for display, extracting specific fields like ID, name, and icon
- This serializer is crucial for rendering service information in a structured format within the project's architecture.comments
tests.py Implements unit tests for the comments functionality in the project, ensuring robustness and reliability. apps.py Defines the configuration for the comments app within the Django project, including the default database field and signals. urls.py - Defines URL patterns for comments using Django and REST framework routers, enabling easy endpoint configuration and viewset registration
- This file plays a crucial role in structuring the API routes for managing discount comments within the project architecture.admin.py Manages administrative tasks for comments in the project, ensuring smooth operations and organization. signals
comment_count.py - Manages comment count updates for discounts, ensuring accuracy and preventing race conditions in a Django project
- Signals trigger Celery tasks to increment or decrement counts based on comment creation, update, or deletion events
- This architecture maintains data integrity and scalability by offloading count updates to asynchronous tasks.tasks
celery_count_comments.py - Implements a Celery task to update comment counts for discounts in the database
- Increments or decrements the count based on the specified action ('increment' or 'decrement')
- Utilizes F() expressions for atomic database updates.paginations
paginations.py Defines custom pagination settings for comment replies in the project, specifying the page size, query parameters, and maximum page size. validators
comment_max_length.py - Validates comment length to ensure it does not exceed the specified limit
- Handles various comment-related validations, enforcing business rules and content restrictions
- The class encapsulates methods for validating comments based on length and custom criteria, raising errors if validation rules are violated.models
comment.py - Defines a Django model for comments, linking users, discounts, and parent comments
- Implements constraints to ensure data integrity and provides a manager for filtering active comments.views
comments.py - Manages interactions with discount comments and replies, allowing users to add, list, and delete comments and replies
- Utilizes custom pagination and permissions for admin or comment owner actions
- Implements efficient database queries using select_related and prefetch_related for optimal performance.managers
comment_manager.py - Implements custom queryset to exclude soft-deleted comments, ensuring only active comments are retrieved
- Utilizes soft-deletion to maintain data integrity and preserve comment threads
- Enables seamless conversation flow by keeping replies visible even if parent comments are deleted.serializers
comments.py - Serializes parent and child comments, including user data, for dynamic handling of custom user models
- Provides flexibility and reusability in nested serializers, controlling user data representation
- Handles pagination for child comments, ensuring efficient data retrieval and presentation.permissions
permissions.py - Defines permissions for admin and comment owners in the comments app, allowing admin users to perform any action and regular users to manage only their own comments
- The code ensures that authenticated users can access the specified HTTP methods based on their role.appeals
tests.py Tests the functionality of the appeals application to ensure it meets requirements and functions as expected within the project architecture. apps.py Defines the configuration for the appeals app within the Django project. urls.py Defines URL patterns for creating appeals using the AppealCreateViewSet in the Django project's appeals app. admin.py - Manages administrative operations for appeals within the project, ensuring efficient handling and resolution of appeals-related tasks
- This code file plays a crucial role in overseeing and managing the appeals process, contributing to the overall architecture's functionality and effectiveness.models
appeal.py - Define the Appeal model with user, company, phone number, subject, and message fields
- Ensure data integrity by setting constraints on user and company choices
- Maintain a clean database structure by utilizing the AbstractBaseModel.views
appeals.py - Defines a view set for creating appeals, ensuring only authenticated users can access it
- Handles appeal creation by associating the user with the request to save the appeal data.serializers
appeals.py Enhances appeal creation by associating user with request data. followers
tests.py - Improve testing coverage for the followers feature by enhancing the test suite in the 'followers/tests.py' file
- This file plays a crucial role in ensuring the reliability and functionality of the followers module within the project architecture.apps.py - Defines the configuration for the 'followers' app within the Django project, specifying the default database field and app name
- This code file plays a crucial role in organizing and managing the functionality related to followers within the overall project architecture.urls.py - Defines URL patterns for the followers app, facilitating navigation within the project
- This file plays a crucial role in routing user requests to the appropriate views, enhancing the overall user experience.admin.py Manages administrative tasks for follower data in the project, ensuring smooth operations and efficient management of user interactions. models
follower.py - Define a model to manage followers of companies, ensuring users cannot follow the same company multiple times
- The model establishes relationships between users and companies, enforcing data integrity and preventing duplicate follow actions.complaints
tests.py Improve test coverage for the complaints app by adding comprehensive unit tests. apps.py - Defines the configuration for the complaints app within the Django project, specifying the default auto field and the app's name
- This AppConfig class plays a crucial role in managing the complaints app's behavior and settings within the overall project architecture.urls.py - Defines URL patterns for the complaints app, facilitating navigation within the project
- This file plays a crucial role in routing user requests to the appropriate views, ensuring seamless interaction with the complaints functionality.admin.py Manages administrative functionalities for complaints in the project, ensuring smooth handling and resolution of user-reported issues. models
complaint.py - Defines a model for user complaints, linking users to discounts and companies
- Captures complaint details like message, first name, and completion status
- Implements constraints to ensure unique user-discount pairs.tops
tests.py Implements unit tests for the 'tops' application to ensure functionality and reliability within the project architecture. apps.py - Defines the configuration for the 'tops' app within the Django project, specifying the default auto field and app name
- This AppConfig class plays a crucial role in managing the behavior and metadata of the 'tops' app within the larger project architecture.urls.py - Defines URL patterns for the 'tops' app, facilitating navigation within the project
- This file plays a crucial role in routing user requests to the appropriate views, enhancing the overall user experience.admin.py Manages administrative functionalities for the tops application, ensuring smooth operations and user management within the codebase architecture. models
top_calendar.py - Define a model representing booked days in a month, storing year, month, and booked days as a boolean grid
- Ensure uniqueness by year and month.top_tariff.py - Defines a model for top tariffs in the project, storing quantity and price information
- This model extends an abstract base model and is structured to interact with the database table 'top_tariff'.top_discount.py Defines a model for top discounts in the project, linking discounts to specific dates. company_top_tariff.py - Defines a model for company top tariffs in the Django project, storing quantity and price information
- The model is linked to the Company model and enforces constraints on the price field
- This file contributes to the project's architecture by managing top tariff data for companies.advertisements
tests.py Implements unit tests for the advertisement functionality to ensure proper behavior and reliability within the project's architecture. apps.py Defines the configuration for the advertisements app within the Django project, specifying the default auto field and the app name. urls.py - Defines URL patterns for the advertisements app, facilitating navigation within the project
- This file plays a crucial role in routing user requests to the appropriate views, enhancing the overall user experience and ensuring seamless interaction with the advertisements functionality.generate_objects.py - Generates 10 unique Advertisement objects with random data, ensuring each has a distinct title and image path
- Utilizes bulk_create to efficiently save all objects at once.admin.py Manages administrative functionalities for advertisements in the project, ensuring smooth operations and organization. validators
validate_image_size.py Validates image size and dimensions for advertisements to ensure they meet specified criteria. models
advertisement.py - Defines Advertisement model with unique ID generation, URL validation, and date constraints
- Ensures each instance has a unique 8-digit ID and validates URL format
- Implements date validation to ensure the start date is before the end date
- This model represents companies' advertisements within the project architecture.packets
tests.py Improve test coverage for packet handling functionality in the project's test suite. apps.py - Defines the configuration for the 'packets' app within the Django project, specifying the default database field and app name
- This AppConfig class plays a crucial role in managing the behavior and characteristics of the 'packets' app within the larger project architecture.urls.py - Defines URL patterns for packet-related API endpoints using Django and REST framework routers, enabling easy routing and viewset registration
- This file plays a crucial role in structuring the API endpoints for packets within the project architecture.admin.py Manages administrative tasks for packet data within the project, ensuring smooth operations and organization. models
packets.py - Defines a Packet model for payments with quantity and price fields, ensuring data integrity and validation
- This model is crucial for managing and storing information related to packages used for posting discounts within the project's architecture.views
packets.py - Implements a PacketGenericViewSet class that handles listing Packet objects with specific permissions and serialization
- Includes methods to retrieve and display packets based on creation date.serializers
packets.py - Serializes Packet model data with read-only fields for id, quantity, and price
- Extends CustomModelSerializer to define serialization behavior.permissions
permissions.py - Implement a permission class to restrict access based on user roles
- Admins have full access, while company owners can only view packages
- The class checks user permissions and company ownership to determine access rights.
requirements
dev.txt - Facilitates development environment setup by specifying dependencies in dev.txt, referencing common.txt
- This file plays a crucial role in managing project dependencies and ensuring a consistent development environment across the codebase architecture.prod.txt Integrate common dependencies for production use in the project architecture. common.txt Manage project dependencies using the provided common.txt file, ensuring compatibility and stability across the codebase architecture.
Before getting started with aksiyamix.git, ensure your runtime environment meets the following requirements:
- Programming Language: Python
- Container Runtime: Docker
Install aksiyamix.git using one of the following methods:
Build from source:
- Clone the aksiyamix.git repository:
β― git clone https://github.com/Aksiya-Mix-Prod/aksiyamix.git
- Navigate to the project directory:
β― cd aksiyamix.git
- Install the project dependencies:
β― docker build -f docker-compose.dev.yml up --build
Run aksiyamix.git using the following command:
Using docker
Β
β― docker run -it {image_name}
Run the test suite using the following command: echo 'INSERT-TEST-COMMAND-HERE'
-
Task 1
:Implement feature one. -
Task 2
: Implement feature two. -
Task 3
: Implement feature three.
- π¬ Join the Discussions: Share your insights, provide feedback, or ask questions.
- π Report Issues: Submit bugs found or log feature requests for the
aksiyamix.git
project. - π‘ Submit Pull Requests: Review open PRs, and submit your own PRs.
Contributing Guidelines
- Fork the Repository: Start by forking the project repository to your github account.
- Clone Locally: Clone the forked repository to your local machine using a git client.
git clone https://github.com/Aksiya-Mix-Prod/aksiyamix.git
- Create a New Branch: Always work on a new branch, giving it a descriptive name.
git checkout -b new-feature-x
- Make Your Changes: Develop and test your changes locally.
- Commit Your Changes: Commit with a clear message describing your updates.
git commit -m 'Implemented new feature x.'
- Push to github: Push the changes to your forked repository.
git push origin new-feature-x
- Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
- Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
This project is protected under the SELECT-A-LICENSE License. For more details, refer to the LICENSE file.
-
List any resources, contributors, inspiration, etc. here.
Name: Mukhsin Mukhtorov
-
Place: Tashkent, Uzbekistan
-
Bio: Backend Developer | ML/AI Enthusiast
-
GitHub: Mukhsin0508