Projects

Automodiran

The website and CRM of a car exhibition with four branches: from the moment a car arrives to the moment it drives out of the gate.

  • #crm
  • #go
  • #react
  • #nextjs

Automodiran is a car exhibition with four branches, selling new and used cars. I built its software: the public website at automodiran.com (opens in a new tab), and the panel the staff run the business from. Everything is Persian and right-to-left, works on a phone first, and uses the Jalali calendar and toman.

An exhibition like this holds other people’s cars. A car is brought in, checked, priced, parked in one of the branches, shown to buyers, sold, and finally driven out. Every one of those steps involves money, documents and trust, and before this it lived on paper and in people’s heads.

The website

am-cars

The site lists every car in the branches, new and used, with filters for brand, budget and branch, and the price of each car is checked every 24 hours. When a price is out of date, the site doesn’t guess: it asks you to call instead. It also shows market prices for cars, takes requests to sell or trade in a car, and has a page for each branch with directions.

It is server-rendered, so every car has its own page that search engines can read.

A car’s journey, in the panel

  1. Intake. A walk-in is registered and gets a random intake code.
  2. A paid inquiry. The owner pays for the checks through a link sent by SMS.
  3. Checks. Verification, then an inspection report: a body diagram with 13 panels and a 41-point checklist.
  4. Approval by the parking manager.
  5. The custody agreement. A printed contract, and the signed scan has to be uploaded before the car’s stay becomes active.
  6. Parking. QR sheets for every car, and a price that is valid for 24 hours and renews with one click, or for many cars at once.
  7. Sale and exit. A sale record, the buyer’s cheques confirmed by finance, then a one-time exit permit that is used up at the gate.

Around that: withdrawals with their costs settled, tasks, a home screen that is a work queue for each role, and a TV view for each branch that shows the numbers without any personal details.

The print agent

The server can’t reach the printers inside a branch, so a small program runs on one computer in each branch and asks the server for work over HTTPS. When there is a contract, a QR sheet or an exit permit to print, it prints it. It is written in Go with nothing but the standard library, runs on Linux, Windows and macOS, and updates itself from the server without a server release. Its installers check each download against a checksum.

How I built it

  • Core: a Go modular monolith on PostgreSQL, with sqlc and pgx instead of an ORM, and goose for migrations. A separate worker sends SMS, runs the outbox and expires prices. Files are stored in SeaweedFS, and contracts and permits are rendered to PDF by Gotenberg.
  • Panel: a React and Vite progressive web app, so staff can add it to their phone’s home screen.
  • Website: Next.js with server rendering.

The decisions that held up best:

  • A car, its intake, its parking stay, a purchase request and a deal are separate records. A car is never “parked” because of a flag on it.
  • Every change of state is an explicit command that writes its audit row and its outbox event in the same transaction. Payments, reservations, refunds and exits are idempotent, so a double click never charges twice or lets a car out twice.
  • Modules talk through their public functions and never touch each other’s tables.
  • Permissions are denied by default and scoped to a branch.
  • Whether something is paid comes from the server’s own check with the gateway, never from the browser coming back from the payment page.
  • Every table carries the exhibition it belongs to, so the same system can serve more than one.

Where it is

The first release, operations first, is built around the parking and custody flow above. Online reservations, refunds and an accounting sync come next, and after that a marketplace, financing and commissions.

pezhvak@web:~$
↑↓move↵openescclose

keys

←→↑↓
Move between tiles
↵
Open the focused tile. Articles: start reading
QE
Home: highlights / recently updated. Gallery: filter by medium. Articles: previous / next entry
JK
Next / previous section of an article
F
Gallery work: full size
A
Home: all entries of the focused tile's section
esc
Back
1…4
Jump to a section
/
Search everything
R
Random note from the garden
M
UI sounds on / off
H
Go home