> Markdown version of https://www.imranjan.cn/projects/p-lcims for AI agents and other programs. It carries the same public information as the web page. Built 2026-11-30.

July 2025 to now, in production use

# LCIMS Cloud

Business management for real-estate developers, with a built-in AI agent

Since July 2025 I have been building this management system for real-estate developers, covering units, sales and payments, property fees, leasing, construction contracts and approvals; two developers now use it in production. Its built-in agent, Xiaocheng, answers questions about live business data and prepares payments and registrations that staff confirm before anything is written.

Tags: Enterprise Software, AI Agent, Full-Stack Development, RBAC and Approvals

![LCIMS Cloud](https://www.imranjan.cn/images/projects/lcims-cloud-2026/cover.en.svg)

### Project resources

The demo runs on made-up data and switches between English and Chinese. A short form on the sign-in page gets you a 7-day account, Xiaocheng included; the data resets every day.

[Try the live demo](https://lcims.imranjan.me)

## Why I built it

I know the owner of a property development company in my hometown. The company had been using an old Java system that still looked and worked much as it would have around 2015\. They handled reservations and sales contracts, kept home payments separate from taxes collected on buyers’ behalf, settled monthly property fees, collected rent on shops and requested construction payments as work progressed. The software was cumbersome and its modules did not work together. Different departments kept entering the same buyer and unit, then spent time reconciling their records by hand.

I spent time learning how the business worked and what each person did between a buyer reserving a home and receiving the keys. I started LCIMS Cloud in July 2025\. I designed the interface using the five SAP Fiori design principles (role-based, adaptive, simple, coherent, and delightful). I used Claude and Codex to speed up development. When finance records a payment, the unit and buyer are already there from the sales registration. Sales, collections, property management, leasing and construction contracts share business rules, and approval decisions go back on the original record.

Two small to mid-sized property developers in my hometown now use it. The first went live on 3 May 2026 and the second in July of the same year. Each has its own instance, with separate processes, a separate database and its own files.

![The business dashboard: projects, units, sold and unsold counts, customers and total sales, with a live activity feed on the left and a sell-through board per project on the right](https://www.imranjan.cn/images/projects/lcims-cloud-2026/dashboard.en.jpg)

The dashboard shows total units, units sold and total sales to date.

## Business functions

### Property sales and management

Sales staff choose a building, floor and unit. Homes, shops, parking spaces and storage rooms can be registered individually or imported from a template. An individual or company has one customer record that can be used for a purchase or a lease.

![Unit matrix for Building 1 with floors, unit numbers and their sale status](https://www.imranjan.cn/images/projects/lcims-cloud-2026/unit-matrix.en.jpg)

Units in Building 1 are arranged by floor and colour-coded by sales status.

#### Sale registration and receipts

The sales office picks an available unit from the floor plan and records the buyer, agreed price and deposit. A price below the unit’s floor price goes for approval. Before registering the sale, the system checks that the unit is still available. Sold units, units under review and units withheld from sale by management cannot be sold again.

Registration creates the deposit receipt. Finance then records each payment against the purchase price. Money collected on the buyer’s behalf, such as deed tax and contributions to the building maintenance fund, has separate receipts. Only payments towards the purchase price reduce the balance due.

![Below-floor-price approval for room 502 showing the floor price and the proposed sale price](https://www.imranjan.cn/images/projects/lcims-cloud-2026/approval-detail.en.jpg)

The approval request for unit 502 lists the floor price and the proposed sale price.

#### Final floor area, handover and property fees

In China an off-plan home can be sold before its final floor area has been measured. Once the measurement is available, the developer settles the difference against the contract. A refund needs approval, and the cashier attaches the bank receipt after payment. The handover document can be issued once the area has been settled and the purchase price collected in full.

Property fees accrue from the month of handover. For a January bill, February and March are grace months and collection starts in April. If late charges are enabled, they start on 1 May. The monthly report shows the amount billed, paid and outstanding for each unit.

![Monthly property fee status: one row per payer, twelve months each showing paid, due, overdue or not billed](https://www.imranjan.cn/images/projects/lcims-cloud-2026/property-monthly.en.jpg)

The property fee report lists each unit’s payment status by month.

Managers can check unsold units, collections and outstanding balances by development. Finance can export land appreciation tax reports and the working papers for tax settlement.

### Construction contracts

The construction team files each contract with its variations and attachments. Finance requests payment as work progresses and checks the remaining contract balance before approval. Invoice amounts and tax are entered separately, so the ledger shows both the amount left to pay and payments still awaiting invoices.

![Design contract with payments, invoices, remaining balance and individual payment requests](https://www.imranjan.cn/images/projects/lcims-cloud-2026/contract-detail.en.jpg)

Two payment requests appear under the design contract.

### Leasing

1. Register and review
2. Collect rent
3. Renewal date or arrears
4. Settle the deposit

The first rent payment and security deposit are recorded separately. Staff collect rent for each period and can follow up on overdue amounts. When a lease ends they settle the deposit. Any outstanding penalty can still be collected.

![Lease ledger with shops, tenants, dates and the status of each agreement](https://www.imranjan.cn/images/projects/lcims-cloud-2026/rental-ledger.en.jpg)

The lease ledger lists each shop, its tenant, the lease dates and the status of the agreement.

### Business documents

Finance can print a receipt when a payment comes in. Handover produces a confirmation form, and payment and refund approvals carry the approvers’ signatures. Reservation agreements and lease documents also take their details from the original transaction. The examples below are in Chinese.

![Sample payment receipt with amount, payment method and company stamp](https://www.imranjan.cn/images/projects/lcims-cloud-2026/doc-receipt.jpg)

The receipt lists the unit, the amount received and the payment method.

![Sample handover form with the unit, final balance and signature fields](https://www.imranjan.cn/images/projects/lcims-cloud-2026/doc-handover.jpg)

The handover form lists the unit details and the final amounts due and paid.

![Sample contract payment approval with amount, decisions and signatures](https://www.imranjan.cn/images/projects/lcims-cloud-2026/doc-payment-approval.jpg)

The contract payment approval form shows the amount and the approvers’ signatures.

- **Shared services**: Administrators assign employee roles and module access. Eight kinds of request, including below-floor-price sales, cancellations, lease reviews and construction payments, go to the approval centre. Teams share notifications, document numbering, signatures and an audit trail.
- **Scheduled work**: Monthly property bills are generated automatically. Scheduled jobs send collection and due-date notices, remove records past their retention period and prepare reminders Xiaocheng can show each employee.
See Xiaocheng, the business assistant

## System architecture

The Vue 3 admin application connects to one FastAPI backend. Sales, property management, leasing, contracts and approvals have separate business logic and share a PostgreSQL database. Alembic handles schema changes. Scheduled jobs issue property bills, follow up arrears and deliver reminders.

![Diagram of one company's instance: Nginx, the FastAPI back end with its API layer, real-estate core, contracts, leasing, documents, platform, background jobs and Xiaocheng, with data and model providers on the right](https://www.imranjan.cn/images/projects/lcims-cloud-2026/architecture.en.svg)

The architecture diagram shows the management interface, business modules and database for one company.

### Modules, staff permissions and approvals

I enable modules for each company. Its administrator then sets staff permissions within those modules. The seven built-in roles draw on 95 permissions. Of these, 36 control menus and pages, and 59 control operations or data access. Turning off a module preserves the company’s records.

![The permission page for the finance role: menus and pages on the left, actions and data on the right](https://www.imranjan.cn/images/projects/lcims-cloud-2026/permissions.en.jpg)

The finance role’s permissions page lists menus, pages, actions and data access.

A member of staff may have access to a sale while its protected amounts appear as \*\*\*. Without financial access they cannot download a sales receipt or purchase agreement. Property fees, rent and contract payment approval documents use their own permission rules.

![Unit price, total and deposit for the same home, shown as amounts in one role and as asterisks in another](https://www.imranjan.cn/images/projects/lcims-cloud-2026/finance-compare.en.jpg)

The unit price, total price and deposit for unit 102 appear as amounts in the sales adviser’s view and as asterisks in the cashier’s view.

For each of eight approval types, the administrator specifies the stages, eligible staff or roles, and the number of signatures needed. Eligibility is checked against the reviewer’s current post. Final approval checks the underlying transaction again, including whether a unit is still available or a contract has enough headroom for a payment.

![Configuration of a below-floor-price approval with levels, roles and approval counts](https://www.imranjan.cn/images/projects/lcims-cloud-2026/approval-config.en.jpg)

The below-floor-price sale settings list the approving roles and the number of approvals required at each level.

A login is valid only on the instance that issued it. Its eight-hour lifetime can renew up to 24 hours after sign-in. Changing a password, disabling an account or forcing sign-out invalidates its existing credentials.

### Stack

#### Admin app

Vue 3ViteElement PlusPiniaECharts

#### Backend

FastAPIPython 3.12SQLAlchemy 2Pydantic

#### Database

PostgreSQL 16Alembic

#### Documents and reports

ReportLabpypdfpypdfium2OpenPyXL

#### Assistant

DeepSeekQwen

#### Tests

pytestPlaywright

#### Runtime

Nginxsystemd

## Xiaocheng, the business assistant

Staff open Xiaocheng on the page they are working on. They can ask how much the company collected each month, which tenants owe rent or how much remains unpaid on a construction contract. The assistant queries the system under the employee’s own permissions.

Xiaocheng has 20 query tools, two helpers and 11 transaction tools. It can consult seven business guides covering areas such as sales, property fees and leasing. A statistics answer includes a table and the basis of the calculation.

Monthly sales collections in the demo. Switch to the table to check the amounts behind the chart.

### Recording a payment

When an employee gives a unit, amount and payment method, Xiaocheng calculates the result and shows the proposed receipt and remaining balance. On confirmation, the server checks permissions and the current balance again before recording the payment. If the company disables direct execution, the card opens a prefilled form for the employee to review and submit.

A CNY 180,000 transfer for room 102\. After confirmation, the new receipt appears at the top of the payments list.

![Sequence diagram of a confirmed action: messages between the employee, Xiaocheng, the business API, the database and the model provider; the rehearsal writes and rolls back, and after confirmation the payment and its receipt commit together](https://www.imranjan.cn/images/projects/lcims-cloud-2026/confirm-sequence.en.svg)

Xiaocheng previews the payment for unit 102 and the system records it after the employee confirms.

### Tasks and reminders

Staff can prepare an arrears follow-up, reconcile month-end figures or check contract payments. Tasks save their progress and continue when the employee leaves the page. Each selected item in a batch is submitted separately. A normal task segment allows 50 combined model and tool calls, or 200 for arrears follow-up or a custom plan. Each segment is capped at CNY 2 and 30 minutes, and each task at 500 calls, CNY 10 and two hours. Scheduled reminders query the database directly. Unchanged results are skipped, and changes during quiet hours are checked afterwards.

Select an overdue account and confirm it to create a collection task for the responsible employee.

### Invoices, contracts and bank receipts

Staff can upload up to five files at a time, with a 20 MiB limit per file and a 50-page limit per PDF. Text PDFs are parsed on the company server. Sending a scan to a model requires both company permission and the employee’s consent for that document. Each extracted field links back to its source page and text for review before it can be used. Temporary files are retained for one to seven days.

Open a field’s source on the uploaded invoice, compare the amounts with the original, then save the reviewed fields.

### Company settings and costs

The administrator selects DeepSeek or Qwen, sets daily limits per employee and for the company, and can pause the service. Provider keys are encrypted and only their last four characters are displayed. Customer names are replaced with aliases before a model call. Identity numbers, phone numbers and bank account numbers stay on the server. The system reserves the cost of a call in advance. Administrators can see usage but cannot read staff conversations.

### Business evaluation

On 24 November 2026 I ran the same 27 questions three times on one product version with DeepSeek’s deepseek-flash model and its default settings. Each round began with a reset test database, and each question started a new conversation.

The three rounds passed 25, 26 and 25 questions, for 76 passes in 81 attempts (93.8%). Of the 27 questions, 24 passed every round, two passed twice and one never passed.

Results for each of the 27 tasks

| Task                                                                   | Rounds passed |
| ---------------------------------------------------------------------- | ------------- |
| List approvals waiting for me                                          | 3 / 3         |
| Withdraw a submitted contract payment request                          | 3 / 3         |
| Check amounts paid and outstanding on a construction contract          | 3 / 3         |
| Greet the assistant                                                    | 3 / 3         |
| Ask what the assistant can do                                          | 3 / 3         |
| Open the property billing page                                         | 3 / 3         |
| Remember a preferred currency display unit                             | 3 / 3         |
| Count homes sold each month this year                                  | 3 / 3         |
| Compare this month’s sales collections with last month’s               | 0 / 3         |
| Find households with overdue property fees                             | 3 / 3         |
| List property fee payments for a development                           | 3 / 3         |
| Ask whether waste collection can be paid separately                    | 3 / 3         |
| Find when late charges start                                           | 3 / 3         |
| Look up rent arrears as a property employee                            | 2 / 3         |
| Find leases expiring in the next 30 days                               | 3 / 3         |
| List tenants in arrears and total unpaid rent                          | 3 / 3         |
| Find what is due after lease approval                                  | 3 / 3         |
| Check the purchase balance for a unit                                  | 3 / 3         |
| Find a buyer’s units and outstanding balances                          | 3 / 3         |
| Find a rented unit by the customer’s phone number                      | 3 / 3         |
| Find the five largest outstanding purchase balances                    | 3 / 3         |
| Look up receipts for a particular unit                                 | 3 / 3         |
| Ask whether deed tax and maintenance funds reduce the purchase balance | 3 / 3         |
| Find the refund procedure when the measured area is smaller            | 3 / 3         |
| Prepare a home payment by bank transfer                                | 3 / 3         |
| Prepare a customer record from personal details                        | 3 / 3         |
| Request a payment entry without permission to confirm it               | 2 / 3         |

Asked to compare this month’s sales receipts with last month’s, Xiaocheng missed the required previous-period parameter in all three rounds. A property manager asking about rent arrears received one answer without the required word for permission. When a finance employee could not record a payment through Xiaocheng, one answer omitted the required reference to the payment page. Both questions passed in the other two rounds.

Rules check the required tools and their order, arguments, terms in the answer, confirmation cards and runtime errors. Outgoing messages are checked for sensitive numbers. The evaluation covers these business requirements and does not rate prose quality.

The application recorded CNY 0.1983, 0.1645 and 0.1525 per round. Mean time per question was 6.2, 5.8 and 5.6 seconds respectively.

## Deployment and operations

Each company has its own backend process, database and login, uploads, runtime directory and keys. On a shared server, Nginx routes each domain to a separate service managed by systemd. At startup the service checks that its instance, company and environment match the database binding.

The application login can connect only to its own business database and cannot create databases or roles. Setup revokes the default database connection privilege before granting access to the company account.

![Three instances on one Ubuntu server: company A production, company A staging and company B production, each with its own backend process, database, uploads and runtime directories and keys; Nginx routes each domain, production instances back up daily to an off-site copy, staging is restored from company A's production backup, and the deployment tool's nine operations are listed on the right](https://www.imranjan.cn/images/projects/lcims-cloud-2026/deployment.en.png)

Three instances on one server each have their own process, database, directories and keys, and staging is restored from company A’s production backup.

### Installation and upgrades

One instance starts at two CPU cores, 4 GB of memory and 40 GB of disk on Ubuntu 24.04\. Each additional instance needs about 1 GB of memory and 10 GB of disk. Servers in mainland China can install dependencies from local mirrors and fetch a release from a reachable repository.

I wrote the deployment tool to prepare a server, create an instance, enable HTTPS, manage modules, back up, restore, upgrade, remove an instance, and check versions and health. Certificates renew automatically. Nginx rate-limits sign-ins and passes streamed assistant responses without buffering.

I restore a recent production backup into staging before trying an upgrade. Staging retains its own identity and keys. Xiaocheng and scheduled jobs are disabled there. Before scheduling production downtime I can inspect the version changes and see whether the release includes a database migration.

![Upgrade order: while the service runs, try the release on staging and preview the changes; during downtime, stop the service, back up, switch the code, install dependencies, migrate the database, sync reference data, build the admin app, start the service and run a health check; the backup from step 2 is used to roll back, and a failed step leaves the service stopped](https://www.imranjan.cn/images/projects/lcims-cloud-2026/upgrade.en.svg)

The nine numbered steps run during downtime, and the backup from step 2 is the way back to the old version.

### Backup and recovery

Each instance backs up at 02:30 and retains the latest 14 sets. Each set contains the database, uploaded files and signatures, role grants, and a manifest written last. The manifest records the instance identity and checksums for the database and uploads. Copies can be kept off-server for recovery after a host failure.

Restore checks the backup files and their instance identity, then backs up the current data before replacing it. Recovery on another server starts with an instance of the same name and the original keys. After restoring the database and uploads, the tool migrates the database, starts the service and runs a health check. Removing an instance also requires a final backup.

Delivery includes a business manual, an employee guide to Xiaocheng and an operations manual. I built an operator console for managing a larger customer base. With two customers today, I use the deployment tool for routine operations.

![Opening pages of the business manual and the Xiaocheng employee guide, in Chinese](https://www.imranjan.cn/images/projects/lcims-cloud-2026/manuals.jpg)

The LCIMS Cloud business manual and the Xiaocheng employee guide are open to their first pages.

## Hard problems

### A rehearsal that leaves no trace

The confirmation card has to match what will really happen, and the surest way is to run the real business flow. But the real flow takes receipt numbers, sends notifications and writes files, so every rehearsal would leave a gap in the numbering and a stray notification.

A rehearsal runs the full business flow inside a transaction that is rolled back as a whole at the end: numbers go back with it, notifications are undone, and newly written files are deleted. Only the system itself can start a rehearsal; requests from outside cannot enter one.

### A dropped connection after confirming

The employee confirms, the business data commits, and the connection drops or the service restarts before the result comes back. A retry could then collect the same payment twice.

Every action has a receipt that commits in the same transaction as the business data. Retries and recovery at start-up check the receipt first: if it exists, they return the original result; if its content does not match, they refuse.

### Two people changing one contract

Two colleagues submit payment applications for the same construction contract at once, or one cancels while the other executes the payment. Each reads a state that says “allowed”, and both succeed.

Operations that check before they change first lock the contract in the database and then decide on its latest state, so operations on one contract run one after another. Where a parent and a child record must both be locked, they are always locked in the same order, so two requests never wait on each other.

### What “today” means on a server

Cloud servers usually run on UTC. Between midnight and 8 a.m. Beijing time the server's date is still the day before, so late-fee days, expiry reminders and the arrears runs on the 1st and 15th are all a day off.

Business dates are always calculated in Beijing time, by the same rule in the back end and the admin interface, whatever the server's time zone.

### Not a cent out

A home's price is floor area times unit price, and that figure flows into settlement, refunds, late charges and tax reports. Stored as floating-point numbers, money, areas and rates pick up small errors along the way, and the cents stop matching.

All 86 money, area, unit price and rate fields are stored as fixed-point decimals: money to the cent, areas to four decimal places, unit prices and rates to six. When existing data is upgraded, the migration checks every column first. If it finds more decimal places than the new type allows, it stops and lists where they are for a person to review instead of rounding them away.

### Finished business stays put

If the price, deposit or buyer could still be edited after settlement or handover, the receipts, purchase agreements and handover forms already printed would no longer match the system.

After settlement the price and deposit cannot be edited directly, and after handover neither the buyer nor the price can. Every change to a sale goes into the sales log, and a switch between two customers with the same name is told apart by customer ID. Reversing a first rent payment voids the original receipt and keeps it on record.

### Automated tests

The backend has 866 tests and the admin app has 43 unit tests. The browser suites contain 41 business cases and 23 Xiaocheng cases. Before each merge, CI checks the backend, database migrations, the admin app build and types, unit tests and a core set of browser cases. Xiaocheng’s routine tests use scripted model responses. The real-model evaluation is run separately.

## Other pages

- [Home](https://www.imranjan.cn/index.md)
- [About me](https://www.imranjan.cn/about.md)
- [Projects](https://www.imranjan.cn/projects.md)
- [Photography](https://www.imranjan.cn/gallery.md)
- [imranjan.cn](https://www.imranjan.cn/projects/p-portfolio.md)
- [Open-source tools](https://www.imranjan.cn/projects/p-open-source.md)
- [Gatehouse](https://www.imranjan.cn/projects/p-gatehouse.md)
- [PlusOne](https://www.imranjan.cn/projects/p-plusone.md)
- [Gantry](https://www.imranjan.cn/projects/p-gantry.md)
- [BYOF Agent](https://www.imranjan.cn/projects/p-byof-agent.md)
- [Shopping Copilot by KI](https://www.imranjan.cn/projects/p-shopping-copilot.md)
- [Look2Act](https://www.imranjan.cn/projects/p-look2act.md)
- [AccessAudit - On-Chain Access Approval & Audit System](https://www.imranjan.cn/projects/p-accessaudit.md)
- [Eye Touch - Real-time Eye Tracking and Gaze Control System](https://www.imranjan.cn/projects/p-eyetouch.md)
- [China Collegiate Computer Competition—Mobile Application Innovation Contest](https://www.imranjan.cn/projects/p-yigui.md)
- [Nilufar Restaurant Expense Management System](https://www.imranjan.cn/projects/p-nilufar.md)
- [Voice-Interactive LED Light Panel](https://www.imranjan.cn/projects/p-led.md)
- ["Mengsheng Cup" Electronic Design Competition](https://www.imranjan.cn/projects/p-msb.md)
- [NUS SOC SWS 2024](https://www.imranjan.cn/projects/p-nus.md)

中文版本：https://www.imranjan.cn/zh/projects/p-lcims.md
