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.
- [Basic] Based on
Django
, generate standardswagger 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-commit
、code-cc
- [Resource] Integrate
bk_resource
to organize project directory structure, declare business logic throughResource
, compatible with DDD development mode. - [Resource] Support to use
ApiResource
/BkApiResource
fo third-partyAPI
- Install
cruft
$ pip install cruft
- Generate project using
cruft
$ cruft create https://github.com/TencentBlueKing/bk-resource.git --checkout main --directory template
- 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
Make sure the local code has been committed before checking or updating the template,
- Check update of the template
$ cruft check --checkout main
- Merge the template into the local project
$ cruft update --checkout main
- 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.
- 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.
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.
Based on the MIT protocol. Please refer to LICENSE