Sumchenko Works
RUРусская версияToggle theme
P—02 · Systems analysisProduction

TechRent

A CRM for construction equipment rental — booking with availability checks, a fleet calendar, payments, manager permissions and an audit log.

Code
Role
Analysis, design, development with Claude Code (graduation project)
Period
2026.06 → 2026.10
Status
Production
Stack
Go · PostgreSQL · React · TypeScript · Zustand · Docker · Nginx · OpenAPI · BPMN

Interface

01 / 06
Availability calendarA Gantt chart of equipment × days for September: orders by status and a bulldozer maintenance period as a yellow bar.

Problem

Small companies own equipment — excavators, cranes, dump trucks — and part of the time it sits idle. Renting it out pays, but rentals are tracked in spreadsheets and on paper. It is easy to promise one machine to two customers or hand over one that is under repair, and who owes what has to be worked out by hand. A heavyweight ERP is too expensive and too slow to roll out for this.

Solution

TechRent replaces spreadsheets with a simple web service for managers. The system checks whether equipment is free on the requested dates, calculates the rental price from the rates, tracks payments and shows who owes money. The administrator invites managers by link and grants them per-module permissions, and every change goes into an audit log.

A graduation project. I handed the finished system to a company with its own equipment fleet for review and got feedback from its head. I ran it as the analyst and architect — requirements, data model, API, role model — and wrote the code with Claude Code step by step, reviewing every step. I documented the key feature, booking, as an end-to-end case and accepted the implementation against the code, which surfaced 11 mismatches with the requirements.

Goals

  1. 01Prevent double booking and renting out broken equipment
  2. 02See the whole fleet's availability for a month in a minute
  3. 03Calculate prices and debts without manual maths
  4. 04Give managers exactly the permissions they need

Features

Equipment catalogue: daily and hourly rates, statuses, photos, maintenance periodsCustomers (companies and individuals) and their construction sitesBooking with availability checks and price calculationAvailability calendar — a Gantt chart of equipment × daysPayments with partial payment and overpayment protectionFinancial summary for a period and a list of debtorsManager invitations by link and per-module permissionsAudit log: who changed what and when, with before and after data

Key requirements

IDRequirementPriority
FR-01One piece of equipment cannot have two active orders with overlapping dates — even under concurrent requests.Must
FR-02Broken equipment cannot be booked (422); equipment under maintenance cannot be booked for those dates (409).Must
FR-03Price: several days — daily rate × days inclusive; a single day — hourly rate × hours.Must
FR-04Payments on an order cannot exceed the order total.Must
FR-05The order number ТР-year-NNN is unique and never reused after an order is deleted.Must
FR-06A manager sees and changes only the modules the administrator opened to them.Should
NFR-01Integrity at the database level: CHECK, UNIQUE, foreign keys and an EXCLUDE constraint.Must
NFR-02Every create, update and delete is logged; a logging failure does not roll back the operation.Must
NFR-03The whole system starts with a single docker compose up.Should

Scenarios

ManagerBooking equipment
  1. 01Finds free equipment in the calendar and marks the dates
  2. 02The form fills in the rates and calculates the total; the manager picks the customer and site
  3. 03In one transaction the server checks breakdowns, maintenance and overlaps
  4. 04The order gets number ТР-2026-015 and the event goes into the audit log
AdministratorInviting a manager
  1. 01Creates a manager and ticks the modules and actions they may use
  2. 02Gets a one-time link valid for 7 days and passes it on
  3. 03The manager sets their own password — the administrator never sees it
  4. 04Permissions go into the token at sign-in; the menu shows only what is allowed

Timeline

  1. Steps 1–3FoundationDocker Compose, a Go API on Chi, migrations embedded in the binary, JWT and roles.
  2. Steps 4–7Core recordsEquipment catalogue, customers and sites, orders with pricing, payments.
  3. Steps 8–11ControlAudit log, Gantt calendar, equipment maintenance, date-derived order statuses.
  4. Steps 12–14Staff and financeDetail panels, manager invitations and permissions, financial summary and debtors.
  5. AcceptanceCase and feedbackThe end-to-end booking case, 11 findings from the code and the company's feedback; all three high-severity ones and repeated numbers fixed.
  6. NextNotifications and documentsTelegram notifications, contract, invoice and certificate in PDF, fleet utilisation analytics.

Challenges

Double booking under concurrent requestsThe check and the write were separate queries. Now it is one transaction that locks the equipment row, plus an EXCLUDE constraint in the database: of 10 concurrent requests one succeeds and the rest get 409.
The form showed only part of the fleetA reviewing company with 24 machines could not find one: the server silently cut the list to 20. An explicit 400 instead of the silent clamp and a picker with server-side search.
Order numbers could repeatCOUNT + 1 handed out a taken number after a deletion. A per-year counter table: the number is issued inside the order transaction, never repeats and leaves no gaps.
Order status depends on today's dateThe database stores only planned and cancelled; active and completed are computed in SQL on read — no nightly jobs and no drift.

Outcome

A working CRM built in 14 steps — about 5,500 lines of Go and 6,500 lines of TypeScript — reviewed by a real company. An end-to-end booking case, OpenAPI, BPMN and a data dictionary; of 11 analyst findings all three high-severity ones and repeated numbers are fixed, and the races are verified with concurrent requests.

Next — server-side checks for order edit and cancel permissions, Telegram notifications and PDF documents.

Technologies

Next · P—01Mito