Skip to content

Project Directory and Files ​

This document describes the main directories, key files and generated artifacts in the FastBee-Arduino repository. When maintaining the project, prioritize the boundaries defined here to avoid mixing generated files, source code and release artifacts.

web-src/, data/www/, and data/config/ contain the Web sources, generated assets, and factory configuration respectively. Export selected runtime configuration from Device Configuration > Advanced Configuration; validate Web resources with the build artifact checks.

Device Configuration Page

Directory boundaries can be understood as an artifact map: source code, configuration and Web resources are inputs; .pio/ is the build cache; dist/ is the release output; only traceable build artifacts and acceptance records should be referenced during delivery.

Top-Level Directories ​

PathDescription
include/C++ header files defining core framework, network, peripheral, system service, security auth and utility interfaces
src/Firmware source code implementation, organized by include/ module divisions
web-src/Web console source files including CSS, page fragments, runtime modules, admin modules and i18n
data/LittleFS file system source data; data/www is built from web-src, compressed for device-side Web resources
scripts/Build, deploy, Web asset processing, test matrix and diagnostic scripts
test/PlatformIO native/host test code, mocks and test utilities
docs/User manual, development guide, peripheral/protocol/scenario docs and project maintenance docs
dist/Release firmware output directory, generated by scripts, should not be manually maintained
.pio/PlatformIO build cache, library dependencies, temporary file system staging and test output, should not be committed
platformio.iniPlatformIO master config defining chip environments, unified flags, hardware overrides, dependencies and extra scripts
README.md, README.en.mdProject entry descriptions in Chinese and English
setup-toolchain.ps1Local toolchain initialization helper script

Firmware Source Code ​

include/ ​

PathDescription
include/core/FastBee core framework, chip capabilities, peripheral config, peripheral execution, task and rule types
include/network/Network management, Web config, routing context, request handler declarations
include/security/User, role, permission, session and authentication management
include/systems/File system, logging, OTA, NTP, configuration, task and other system service interfaces
include/peripherals/Sensor, display, GPIO, bus and other peripheral abstraction interfaces
include/utils/Common utilities such as PSRAM JSON document, string/response helpers

src/ ​

PathDescription
src/main.cppFirmware boot entry, initializes framework, network, Web, peripherals and system tasks
src/core/Framework lifecycle, peripheral management, peripheral executor, rule scheduling and other core logic
src/network/WiFi/AP/STA, Web server, route registration, request context and network state
src/network/handlers/REST API route implementations: system, network, peripheral, batch, log, file, auth
src/security/Login authentication, session management, Token and Cookie compatibility logic
src/systems/File system, logging, OTA, task management, time sync, system status
src/peripherals/Concrete peripheral driver and sensor read/write implementations

When modifying APIs, also check src/network/handlers/, Web frontend calls, scripts/device-api-test-matrix.json and related documentation.

Web Console ​

PathDescription
web-src/css/Web console CSS, unified widget styles maintained here
web-src/js/Startup, request handling, state management, notifications, module loading and other common runtime code
web-src/modules/runtime/Device runtime page modules: dashboard, network, peripherals, peripheral execution
web-src/modules/admin/Admin page modules: logs, users and rule scripts
web-src/pages/HTML pages and dialog fragments
web-src/i18n/Internationalization resources
data/www/Compressed assets written to device LittleFS after build, usually generated by scripts

After modifying Web source, use scripts\build-web-modules.js, scripts\gzip-www.js or scripts\deploy.ps1 to generate device-side assets. Do not modify only data/www/*.gz without updating web-src source files.

Configuration Data ​

PathDescription
data/config/peripherals.jsonDefault peripheral configuration and templates
data/config/users.jsonDefault users, roles, security config and session policy
data/www/Device-side Web static assets and pages

Default configuration must work across all nine release environments. When adding an optional capability, verify that unavailable pages stay hidden and APIs return a documented unavailable status.

Scripts Directory ​

Scripts are located in the scripts/ directory of the FastBee-Arduino firmware repository, not in this documentation repository.

Core groups:

GroupKey Files
Test Matrixtest-all.ps1, device-api-test-matrix.json, smoke-test-device.ps1, soak-test-device.ps1
Deploy & Releasedeploy.ps1, build-all-artifacts.ps1, collect-artifacts.ps1, fastbee-artifacts.py
Web Buildbuild-web-modules.js, gzip-www.js, generate-sw-manifest.js, web-smoke-test.js
Quality Checkscheck-utf8-text.js, validate-i18n.js, web-profile.js, web-asset-report.js
Diagnosticsserial-diagnostics.py, kill-stale-processes.py

Test Directory ​

Test code is located in the test/ directory of the FastBee-Arduino firmware repository, not in this documentation repository.

FileCoverage Focus
test_main.cppTest entry and base framework
test_web_api.cppWeb API behavior
test_network_config.cppNetwork configuration
test_mqtt_protocol.cppMQTT configuration and protocol
test_system_stability.cppStability and boundary conditions
test_e2e_scenarios.cppCombined scenarios

Real device API tests are not in test/ but executed via scripts\smoke-test-device.ps1 and scripts\soak-test-device.ps1.

Documentation Directory ​

PathDescription
overview.mdProject overview
quick-start.mdQuick start
testing.mdTest matrix and pre-release verification
project-structure.mdThis file, directory and key file description
architecture.mdSystem architecture
core-framework.mdCore framework overview
development-guide.mdDevelopment guide
user-manual.mdUser manual
examples/Peripheral and scenario examples
peripherals/Peripheral configuration reference
periph-exec/Peripheral execution rules, triggers and actions
protocols/MQTT, Modbus and other protocol docs
system/System management, feature state and configuration

Generated Artifacts & Cleanup Rules ​

Path/FileTypeHandling
.pio/PlatformIO build cacheCan be deleted and regenerated
dist/business/firmware/Release firmware outputGenerated by build-all-artifacts.ps1
data/www/*.gzCompressed Web assetsGenerated by Web build scripts, must be retained before release
scripts/*.pycPython runtime cacheCan be deleted, should not be committed
compile_commands.jsonCompilation databaseCan be generated by tools, used for IDE/clangd
upload_log.txtLocal flash logDebug artifact, should not be maintained as source

Modification Sync Rules ​

Modification TypeSync Check Required
New APIWeb calls, scripts/device-api-test-matrix.json, related docs
Auth/session changessmoke/soak, browser login, Users page, role and permission APIs
Network/4G/Ethernet changesNetwork pages, MQTT status, device smoke matrix
Web style changesweb-src/css/main.css, related page logs and Web smoke
Build capability changesplatformio.ini, hardware/environment docs, capability tests and release artifacts
Default config changesdata/config/*.json, first-boot and factory reset flows

FastBee | fastbee.cn