Skip to main content

One App you can do everything

Project description

Bomiot logo

🚀 Bomiot

One App you can do everything

强大的分布式文档管理框架 & 全栈开发平台

License: APLv2 Release Version (latest Version) i18n Support

repo size GitHub commit activity Contributors

GitHub Org's stars GitHub Follows GitHub Forks GitHub Watch

Python Django Quasar Cli Vue NodeJS

YouTube

English | 中文


📋 目录


🌟 项目简介

Bomiot 是一个革命性的分布式文档管理框架和全栈开发平台,专为解决现代开发中的痛点而设计。我们相信,优秀的开源项目不仅要有强大的技术栈,更要注重开发者的使用体验和团队协作效率。

🎯 设计理念

  • 开发者友好: 从 0 到 1 的无缝体验,无需复杂配置
  • 团队协作: 高效的开发团队交互机制
  • 模块化设计: 插件化架构,功能可扩展
  • 企业级: 生产环境就绪,支持大规模部署

✨ 核心特性

🔧 开发工具

  • 项目脚手架: 一键创建项目和应用
  • 插件系统: 丰富的插件生态
  • 实时文件监控: 开发效率提升
  • 热重载: 代码修改即时生效

🕐 任务管理

  • 定时任务: 强大的调度系统
  • 任务监控: 实时任务状态跟踪
  • 错误处理: 智能异常处理机制
  • 日志管理: 完整的日志记录系统

🔐 权限控制

  • 细粒度权限: 基于角色的访问控制
  • JWT 认证: 安全的身份验证
  • API 权限: 接口级别的权限管理
  • 操作审计: 完整的操作日志

🌍 国际化

  • 多语言支持: 内置国际化框架
  • 动态语言切换: 运行时语言切换
  • 本地化配置: 区域化设置

📊 系统监控

  • 性能监控: CPU、内存、磁盘监控
  • 进程管理: 系统进程实时监控
  • 网络监控: 网络流量统计
  • 健康检查: 系统健康状态检测

🚀 快速开始

1. 安装 Bomiot

# 使用 pip 安装
pip install bomiot

# 或使用 poetry 安装
poetry add bomiot

2. 初始化工作空间

# 初始化 Bomiot 工作空间
bomiot init

3. 创建项目

# 创建新项目
bomiot project my-project

# 创建应用
bomiot new my-app

4. 启动服务

# 启动开发服务器
bomiot run

# 或指定端口
bomiot run --port 8080

📦 安装指南

系统要求

  • Python: 3.9 或更高版本
  • Node.js: 18.19.1 或更高版本
  • 操作系统: Windows, macOS, Linux

详细安装步骤

1. 安装 Python 依赖

# 克隆项目
git clone https://github.com/Bomiot/Bomiot.git
cd Bomiot

# 创建虚拟环境
python -m venv venv

# 激活虚拟环境
# Windows
venv\Scripts\activate
# macOS/Linux
source venv/bin/activate

# 安装依赖
pip install -r requirements.txt

2. 安装前端依赖

# 进入前端目录
cd bomiot/templates

# 安装依赖
yarn install

# 或使用 npm
npm install

3. 初始化数据库

# 创建数据库迁移
bomiot makemigrations

# 执行迁移
bomiot migrate

# 创建管理员账户
bomiot initadmin

🛠️ 命令行工具

Bomiot 提供了强大的命令行工具,让开发和管理变得简单高效。

📋 命令概览

bomiot [命令] [选项]

🔧 核心命令

项目管理

# 初始化工作空间
bomiot init [folder]

# 创建新项目
bomiot project <project_name>

# 创建新应用
bomiot new <app_name>

# 创建插件
bomiot plugins <plugin_name>

数据库管理

# 创建数据库迁移
bomiot makemigrations

# 执行数据库迁移
bomiot migrate

# 加载初始数据
bomiot loaddata <source>

# 导出数据
bomiot dumpdata [appname]

用户管理

# 创建管理员账户
bomiot initadmin

# 重置管理员密码
bomiot initpwd [folder]

服务管理

# 启动服务器
bomiot run [选项]

# 部署项目
bomiot deploy [folder]

系统管理

# 初始化认证密钥
bomiot keys

# 从市场安装项目
bomiot market <project_name>

🚀 服务器启动选项

bomiot run [选项]

选项:
  --host HOST          服务器主机地址 (默认: 127.0.0.1)
  --port PORT          服务器端口 (默认: 8000)
  --workers WORKERS    工作进程数 (默认: 2)
  --log-level LEVEL    日志级别 (critical/error/warning/info/debug/trace)
  --ssl-keyfile FILE   SSL 密钥文件
  --ssl-certfile FILE  SSL 证书文件
  --proxy-headers      启用代理头
  --http HTTP          HTTP 实现 (auto/h11/httptools)
  --loop LOOP          异步循环 (auto/asyncio/uvloop)

📝 使用示例

# 基本启动
bomiot run

# 指定端口和主机
bomiot run --host 0.0.0.0 --port 8080

# 生产环境配置
bomiot run --host 0.0.0.0 --port 80 --workers 4 --log-level info

# SSL 配置
bomiot run --ssl-keyfile key.pem --ssl-certfile cert.pem

🏗️ 项目结构

Bomiot/
├── bomiot/                    # 核心包
│   ├── cmd/                   # 命令行工具
│   │   ├── __init__.py       # 主命令入口
│   │   ├── project.py        # 项目管理
│   │   ├── plugins.py        # 插件管理
│   │   ├── deploy.py         # 部署工具
│   │   └── ...
│   ├── server/               # 服务器端
│   │   ├── core/            # 核心模块
│   │   ├── server/          # 服务器配置
│   │   ├── media/           # 媒体文件
│   │   └── templates/       # 前端模板
│   └── ...
├── dbs/                      # 数据库文件
├── logs/                     # 日志文件
├── deploy/                   # 部署配置
├── requirements.txt          # Python 依赖
├── pyproject.toml           # 项目配置
└── README.md               # 项目文档

🔧 配置说明

环境配置

Bomiot 使用配置文件来管理不同环境的设置:

# setup.ini
[project]
name = my-project

[database]
engine = sqlite
name = db.sqlite3

[local]
time_zone = UTC

[jwt]
user_jwt_time = 1000000

[throttle]
allocation_seconds = 1
throttle_seconds = 10

[request]
limit = 2

[file]
file_size = 102400000
file_extension = py,png,jpg,jpeg,gif,bmp,webp,txt,md,html,htm,js,css,json,xml,csv,xlsx,xls,ppt,pptx,doc,docx,pdf

数据库配置

支持多种数据库:

  • SQLite (默认)
  • MySQL
  • PostgreSQL
  • Oracle

🌐 部署指南

开发环境

# 启动开发服务器
bomiot run --host 0.0.0.0 --port 8000

使用 Docker

FROM python:3.9-slim

WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt

COPY . .
RUN bomiot init
RUN bomiot migrate

EXPOSE 8000
CMD ["bomiot", "run", "--host", "0.0.0.0", "--port", "8000"]

使用 Nginx

server {
    listen 80;
    server_name your-domain.com;

    location / {
        proxy_pass http://127.0.0.1:8000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

📚 开发指南

创建自定义应用

# 1. 创建应用
bomiot new my-custom-app

# 2. 编辑应用代码
cd my-project/my-custom-app

# 3. 注册应用
# 在 bomiotconf.ini 中设置 mode = plugins

创建定时任务

from bomiot.server.core.signal import bomiot_job_signals

@receiver(bomiot_job_signals)
def my_scheduled_task(sender, **kwargs):
    # 你的任务逻辑
    print("执行定时任务")
    
# 发送任务信号
bomiot_job_signals.send(sender=my_scheduled_task, msg={
    'models': 'JobList',
    'data': {
        'trigger': 'interval',
        'seconds': 60,
        'description': '每分钟执行一次'
    }
})

API 开发

from rest_framework import viewsets
from bomiot.server.core.client import CoreModelViewSet

class MyModelViewSet(CoreModelViewSet):
    """
    自定义 API 视图集
    """
    queryset = MyModel.objects.all()
    serializer_class = MyModelSerializer
    filter_class = MyModelFilter

🤝 贡献指南

我们欢迎所有形式的贡献!

贡献方式

  1. 报告 Bug: 创建 Issue
  2. 功能请求: 提交功能请求
  3. 代码贡献: Fork 项目并提交 Pull Request
  4. 文档改进: 帮助完善文档
  5. 社区支持: 回答其他用户的问题

开发环境设置

# 1. Fork 项目
# 2. 克隆你的 Fork
git clone https://github.com/your-username/Bomiot.git

# 3. 创建功能分支
git checkout -b feature/amazing-feature

# 4. 提交更改
git commit -m 'Add amazing feature'

# 5. 推送到分支
git push origin feature/amazing-feature

# 6. 创建 Pull Request

代码规范

  • 遵循 PEP 8 Python 代码规范
  • 添加适当的注释和文档字符串
  • 编写单元测试
  • 确保所有测试通过

📄 许可证

本项目采用 APLv2 许可证 - 查看 LICENSE 文件了解详情。


🔗 相关链接

📺 视频教程

📖 文档

🐛 问题反馈

💬 社区


⭐ 如果这个项目对你有帮助,请给我们一个 Star!

Made with ❤️ by Bomiot Team

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bomiot-0.9.2.tar.gz (3.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bomiot-0.9.2-py3-none-any.whl (3.5 MB view details)

Uploaded Python 3

File details

Details for the file bomiot-0.9.2.tar.gz.

File metadata

  • Download URL: bomiot-0.9.2.tar.gz
  • Upload date:
  • Size: 3.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.9 Windows/10

File hashes

Hashes for bomiot-0.9.2.tar.gz
Algorithm Hash digest
SHA256 060143dc6d4aab56bf021d9d5c9773e2daebc9ebbc3135a8a873e495f389f3bf
MD5 a860125d450de20d2e638ea705e49102
BLAKE2b-256 139fe1aa8de90845815cc0454b82b398db2f690eab993a278093c89633b27573

See more details on using hashes here.

File details

Details for the file bomiot-0.9.2-py3-none-any.whl.

File metadata

  • Download URL: bomiot-0.9.2-py3-none-any.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.9 Windows/10

File hashes

Hashes for bomiot-0.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cb065da2892c2edf4d8d6120fea36856dbd7add8129a130e074e5f54de164621
MD5 eb8bbfee2b3cd281c9c17f8b3b8c2206
BLAKE2b-256 5e1401883da23a1e55da93ff4e3e29142655f0b8cb800d84efc7eda1348f2757

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page