Tutorial Guide & Project Creation
- You are new to the Lovrabet ecosystem
- You want to do custom development but do not know where to start
- You want a step-by-step complete example
- Master the full development process: from project creation to deployment
- Build a customer management module independently (list, detail, form, report)
- Understand how the tools (CLI, SDK, MCP, SQL) work together
Estimated Time: 60-90 minutes (can be completed in sections)
What Are We Building?
We will build a Customer Management System from scratch with the following features:
| Feature | Description | What You Will Learn |
|---|---|---|
| Customer List | Display customer data with filtering and pagination | Basic SDK queries |
| Customer Detail | Click to view detailed customer information | Data association queries |
| Add Customer | Fill in a form and save to the database | Data creation |
| Edit Customer | Modify existing customer information | Data update |
| Sales Report | Aggregate customer sales data | Custom SQL |
| Data Validation | Validate data before saving | Backend Function |
Final Result: A complete business module ready for production use.
Learning Path
📦 Phase 1: Preparation (10 min)
└── [1. Environment Setup & Project Creation](#1-environment-setup--project-creation)
📦 Phase 2: Core Features (30 min)
├── [2. List Page: Pagination & Filtering](./scenario-data-list)
├── [3. Detail Page: View & Edit Data](./scenario-data-detail)
└── [4. Form Page: Create & Update Data](./scenario-data-form)
📦 Phase 3: Advanced Features (30 min)
├── [5. Master-Detail: Transactional Processing for Orders & Order Items](./scenario-master-detail)
├── [6. Join Query: Display Customer Info in Orders](./scenario-multi-table)
└── [7. Report Page: Sales Statistics with SQL](./scenario-data-report)
📦 Phase 4: Expert Features (20 min)
├── [8. Data Validation: Backend Interception of Invalid Data](./scenario-bf-pre-validation)
├── [9. Data Masking: Phone & ID Card Processing](./scenario-bf-post-validation)
└── [10. Complex Statistics: SQL in Backend Function](./scenario-bf-sql)
📦 Phase 5: Deployment (10 min)
└── [11. Build & Deploy](#11-build--deploy)
1. Environment Setup & Project Creation
1.1 Prerequisites
Before you begin, make sure you have the following:
| Requirement | Details | How to Get |
|---|---|---|
| Node.js | Version >= 18 | Official Download |
| Code Editor | VS Code recommended | Official Download |
| Lovrabet Account | Registered | Sign Up |
| App AppCode | App created | Get it from the workspace after creating an app |
AppCode is your app's unique identifier on the Lovrabet platform. You can find it in Lovrabet Workspace - App Settings - Basic Info, in a format like app-c4c89304.
1.2 Install the CLI Tool
The CLI (command-line tool) helps you quickly create projects, generate code, and deploy.
Open a terminal (PowerShell or Git Bash for Windows users) and run:
# Install CLI
npm install -g @lovrabet/rabetbase-cli@latest
# Verify installation
rabetbase --version
If you see the version number, the installation was successful.
1.3 Login to Your Account
rabetbase auth login
This will automatically open your browser to log in to your Lovrabet account. After a successful login, the terminal will display:
✔ Login successful! Credentials saved locally
Future CLI commands will automatically use this login state.
1.4 Create a Project
# Create project
rabetbase project create
The CLI will ask you a few questions:
* Project name: customer-management
* App AppCode [optional]: app-c4c89304 ← Enter your AppCode
* Auto-pull API config? ▶ Yes ← Select Yes
✔ Copying project files
✔ Updating project config
✔ Installing npm dependencies
✔ Pulling API config
🎉 Project created successfully!
cd customer-management
rabetbase run start
The CLI automatically fetches all dataset information for your app from the platform and generates SDK code. This way, your IDE can autocomplete field names and types as you write code.
1.5 Start the Development Server
cd customer-management
rabetbase run start
Your browser will automatically open http://localhost:5173, where you can see the project's initial page.
1.6 Configure AI Assistance (Highly Recommended)
If you use Cursor or Claude Code, installing the Rabetbase Skill allows AI to understand your business data and generate more accurate code.
# Install Rabetbase Skill (global install, only once)
npx skills add lovrabet/rabetbase --global
After installation, the AI assistant will automatically recognize the rabetbase command and can directly help you perform data queries, code generation, and more.
- AI can automatically retrieve your table structure
- Generated code has 100% accurate field names
- Complex queries (JOINs, aggregations) can be written by AI
- 3-5x development efficiency boost
Phase 1 Complete!
You have now:
- Installed the CLI tool
- Created a project
- Started the development server
- Configured AI assistance (optional)
Next Step: Start building the Customer List Page, the most fundamental feature and your starting point for learning the development workflow.
11. Build & Deploy
When you have finished all feature development, you can build and deploy to production.
11.1 Build the Project
rabetbase run build
After the build completes, the dist/ directory will contain two files:
dist/
├── index.js # JavaScript code
└── index.css # Stylesheet
11.2 Upload to CDN
Upload these two files to your CDN or server and obtain HTTPS URLs:
https://cdn.example.com/customer-management/index.jshttps://cdn.example.com/customer-management/index.css
You can use Alibaba Cloud OSS, Tencent Cloud COS, your own server (HTTPS required), or free hosting services like Vercel or Netlify.
11.3 Set Menu Names (Important)
Before syncing menus, make sure your pages have correct display names. The CLI extracts menu names using the following priority:
displayName > Component Name > File Path
Recommended: Use displayName
function CustomerList() {
// ...
}
// Set the menu display name
CustomerList.displayName = "Customer List";
export default CustomerList;
Arrow function style:
const CustomerList = () => {
// ...
};
CustomerList.displayName = "Customer List";
export default CustomerList;
| Method | Example | Menu Name |
|---|---|---|
| displayName (Recommended) | Component.displayName = "Customer List" | Customer List |
| Component Name | function CustomerList() | CustomerList |
| File Path | src/pages/customer/list.tsx | customer/list |
11.4 Sync Menus to Workspace
For first-time deployment, use the sync command to create menus:
rabetbase menu sync
The CLI will scan your local pages and let you select which menus to sync:
Menu Name Local Remote
Customer List ✓ ✗ (needs creation)
Customer Detail ✓ ✗ (needs creation)
Sales Report ✓ ✗ (needs creation)
* Select menus to sync:
[✓] Customer List
[✓] Customer Detail
[✓] Sales Report
* JS URL: https://cdn.example.com/customer-management/index.js
* CSS URL: https://cdn.example.com/customer-management/index.css
√ Menus created successfully
Now open the Lovrabet Workspace and you will see your developed pages in the menu.
11.5 Subsequent Iterative Updates
After modifying code and redeploying, use the update command to batch-update resource URLs:
# 1. Rebuild
rabetbase run build
# 2. Upload to CDN (get new URLs)
# https://cdn.example.com/customer-management/index-v2.js
# https://cdn.example.com/customer-management/index-v2.css
# 3. Batch update all menu resource URLs
rabetbase menu update
sync vs update
| Command | Purpose | Use Case |
|---|---|---|
menu sync | Create new menus | First deployment, adding new pages |
menu update | Update resource URLs | Redeploying after code changes |
- Main & Sub-application Architecture -- Understanding Lovrabet's micro-frontend architecture
- Sync Menus to Workspace -- Complete sync/update command reference
- SDK Configuration -- Production environment configuration
Congratulations!
You have completed the full learning journey from zero to one, mastering:
| Skill | Description |
|---|---|
| CLI Usage | Create projects, build, deploy, menu sync |
| SDK Queries | filter, getOne, create, update |
| Custom SQL | Complex reports, statistical analysis |
| Backend Function | Data validation, business logic |
| AI-Assisted Development | Configure MCP for AI to understand your business |
What to Learn Next
Deep Dive
- SDK Introduction -- Complete SDK overview
- Filter API -- Advanced query techniques
- SQL API -- Custom SQL details
- Backend Function -- Backend business logic extension
- Error Handling -- Exception capture and handling
Architecture & Deployment
- Main & Sub-application Architecture -- Micro-frontend integration details
- Sync Menus to Workspace -- Complete deployment workflow
- CLI Command Reference -- All CLI commands
Other Resources
- Best Practices -- Development standards and performance optimization
- FAQ -- Check here first when you run into issues
- OpenAPI Documentation -- Direct API calls from mini-programs and apps
- MCP Configuration -- Advanced AI-assisted development