Skip to content

Latest commit

 

History

History
110 lines (75 loc) · 5.28 KB

readme_en.md

File metadata and controls

110 lines (75 loc) · 5.28 KB

logo.png

License Release Version PRs Welcome codecov Unittest Py3

Overview

bk_resource, is a scaffold based on Blueapps and Django Rest Framework, supports to quickly generate WEB SaaS projects that comply with the twelve-factor specification and DDD (Domain-Driven Design) development mode.

Features

  • [Basic] Based on Django, generate standard swagger API
  • [Basic] Based on django-environ, adapt both environment variables and .env file
  • [Basic] Support for PEP-621 with config plan of mypy, isort, flake8, black
  • [Basic] Support for code standardization tools: pre-commitcode-cc
  • [Resource] Integrate bk_resource to organize project directory structure, declare business logic through Resource, compatible with DDD development mode.
  • [Resource] Support to use ApiResource / BkApiResource fo third-party API

Getting started

Installation

  1. Install cruft
$ pip install cruft
  1. Generate project using cruft
$ cruft create https://github.com/TencentBlueKing/bk-resource.git --checkout main --directory template
  1. Add a remote repository and push
cd {{ project_id }}
git init
git add .
git commit -m "init repo"
git remote add origin {{ git_url }}
git push -u origin master

Template Lifecycle Management

Make sure the local code has been committed before checking or updating the template,

  1. Check update of the template
$ cruft check --checkout main
  1. Merge the template into the local project
$ cruft update  --checkout main

Usage

Domain Driven Design Development Practices

ddd

  • Api Interaction Layer
    Expose services to users through UI Api or Open Api, and the corresponding Api is responsible for connecting the corresponding business logic.
  • Scene Layer
    When accessing the backend through Api, the actual access is a scene service exposed by Resource, which connects the business logic of the domain layer.
  • Domain Layer
    The domain layer focuses on the corresponding sub-modules, responsible for handling the specific business logic, such as, in the user module, processing user registration, login, password modification, password reset, etc.
  • Model Layer
    In the MVC framework (such as Django), the code architecture is divided into Model, View, and Controller layers. The View is used for display. In the practice of front-end and back-end separation development and deployment, it is no longer processed by the backend, and the backend only needs to handle Model & Controller.

Roadmap

Support

BlueKing Community

  • BK-CMDB: BlueKing CMDB is an enterprise-level management platform designed for assets and applications.
  • BK-CI: BlueKing Continuous Integration platform is a free, open source CI service, which allows developers to automatically create - test - release workflow, and continuously, efficiently deliver their high-quality products.
  • BK-BCS: BlueKing Container Service is a container-based basic service platform that provides management service to microservice businesses.
  • BK-PaaS: BlueKing PaaS is an open development platform that allows developers to efficiently create, develop, set up, and manage SaaS apps.
  • BK-SOPS: BlueKing SOPS is a system that features workflow arrangement and execution using a graphical interface. It's a lightweight task scheduling and arrangement SaaS product of the Blueking system.
  • BK-JOB:BlueKing JOB is a set of operation and maintenance script management platform with the ability to handle a large number of tasks concurrently.

Contributing

If you have good ideas or suggestions, please let us know by Issues or Pull Requests and contribute to the Blue Whale Open Source Community.
Tencent Open Source Incentive Program welcome developers from all over the globe to contribute to Tencent Open Source projects.

License

Based on the MIT protocol. Please refer to LICENSE