Namisite TPI ERP
Features How it works Pricing Architecture FAQ Contact See live demo ↗ Start free trial

System design & architecture

How TPI ERP is built

One Laravel application serves the public website, the superadmin panel and every customer company's own workspace. This page explains the parts, how data is kept separate, how an inspection moves from purchase order to release note, and how the service is billed and secured.

1

code base for every host

6

user roles, least privilege

7

inspection stage states

0

passwords stored

On this page

01 · Overview

What the system does

TPI ERP runs the day-to-day work of a third party inspection agency: vendor purchase orders and their items, inspection stages, inspector visits, site reports with photos, technical review, the Inspection Report (IR) number and the Inspection Release Note (IRN). Customers can follow their own orders, and the agency is told by email at every step.

Design goals

  • Simple to host: runs on ordinary shared hosting (PHP + MySQL + one cron line)
  • Each company's data fully separate
  • Works on an inspector's phone at site
  • Nothing for users to install or remember

Technology

  • Laravel 13 on PHP 8.3+
  • MySQL / MariaDB (strict mode)
  • Blade views, Tailwind CSS and Alpine.js, no build step
  • Database queue, cache and sessions

Quality

  • Automated feature tests for workflow, numbering, portal, emails and SaaS
  • Tests run on SQLite and on MariaDB strict mode
  • Activity log of every important action

02 · System context

Who uses it, and through which address

The host name in the browser decides what the application shows. All addresses point at the same installation.

System context: people, addresses, the application and its services PEOPLE Visitors & prospectspricing, trial sign-up Namisite superadminworkspaces, plans, invoices Agency staffadmin, coordinator, tech head Inspectorson the phone, at site Customersread-only client logins ADDRESSES tpierp.namisite.comwebsite, pricing, sign-up, this page superadmin-tpierp.namisite.comsuperadmin panel (/admin) {name}-tpierp.namisite.comone workspace per company,e.g. acme-tpierp.namisite.comown tables, files, logins, mailsender name; custom domain option demo-tpierp.namisite.comlive demo = the primary workspace TPI ERP Laravel 13 application ResolveTenant (host) Website + superadmin Inspection workspace Customer portal Mail + queue jobs Scheduler (billing) HTTPS SERVICES MySQL / MariaDBsaas_* central tablest{id}_* per workspace Private file storagePO files, photos, perworkspace folder SMTP mail serversign-in codes, workflowand billing emails Cron (every minute)schedule:runqueues, billing, cleanup

03 · Components

Building blocks inside the application

A classic layered Laravel design. Business rules sit in small support classes that can be tested on their own, controllers stay thin, and everything slow (email) goes through the queue.

Presentation

Blade views

Server-rendered pages, A4 print layouts for IR / IRN

Tailwind + Alpine

Loaded from CDN, mobile-first, no npm build

Branded emails

Shared layout, journey tracker, buttons

Public website

Landing, pricing, sign-up, this page

HTTP layer

ResolveTenant

Runs first: host → portal or workspace

SaasOnly / TenantOnly

Wrong host gets 404, never a login page

auth · active

Signed in and still active

subscription

Past due banner, suspended = read-only

Application

Masters

Clients, vendors, units, stages

Vendor POs & items

PO no., control no., stages, files

Assignments & reports

Visits, photos, review, IR / IRN

Portal, reports, settings

Customer view, CSV export, activity log

Domain services

StageStatus

Stage state machine and labels

Sequences

Yearly counters for TPI / CN / IR / IRN numbers

TenantManager · Provisioner

Switch database, files, mail; create workspaces

Billing · Limits

Invoices, GST, life cycle; plan limits

Infrastructure

MySQL connections

central + tenant

Private disk

storage/app/private

Database queue

jobs table per workspace

Scheduler

one cron line drives all

04 · Request lifecycle

What happens on every page load

Example: an inspector opens acme-tpierp.namisite.com/my-inspections.

  1. 1

    Host lookup

    ResolveTenant finds the workspace by its address (or custom domain). Unknown → "workspace not found"; closed → 403.

  2. 2

    Switch context

    The tenant connection, table prefix, file folder, app URL, company name and mail sender are set for this request only.

  3. 3

    Host guard

    Workspace routes refuse portal hosts and the other way round, before any login check.

  4. 4

    Sign-in check

    Session cookie for this workspace; user must be active (and its client active for customers).

  5. 5

    Subscription

    Trial / active pass. Past due shows a banner. Suspended allows reading and printing only.

  6. 6

    Controller

    Role check, query scoped to the user (own visits, own client), view rendered, action logged.

05 · Multi-tenancy

Every company in its own workspace

One installation, many companies. Isolation is done at the data layer, not with a "company id" on every row, so a missed filter in one screen can never show another company's data.

WhatHow it is kept separate
Database tablesOwn prefix (t12_vendor_pos…) in the shared tenant database, or a dedicated database
Files & photosOwn private folder workspaces/{name}, served only after a permission check
Logins & sessionsOwn users, sign-in codes and session table; cookies are per host
Queue & emailsOwn jobs table; emails go out under the company's own name
Settings & numbersOwn number formats, counters, company details and mail settings
Central dataPlans, workspaces, invoices, payments live only in saas_* tables, never visible inside a workspace

Provisioning a new workspace

  1. 1Sign-up. Company, contact, workspace name and plan; email verified with a 6-digit code. Reserved names (www, admin, demo…) are refused.
  2. 2Record. A saas_tenants row is created with status Trial and the trial end date.
  3. 3Build. Provisioner runs all workspace migrations under the new prefix and creates the file folder.
  4. 4Seed. Default stages and units, company details, and the first administrator.
  5. 5Ready. "Your workspace is ready" email with the address; the admin signs in at once.

Schema changes reach every workspace with one command (tenants:migrate); any artisan command can run per workspace.

06 · Inspection workflow

From purchase order to release note

Each inspection stage of each item moves through a small state machine. Quantities are tracked per stage, so part of a lot can be approved while the balance is inspected again.

Inspection stage state machine Pendingitem stage ticked Assignedinspector, dates, qty Awaiting reviewreport + photos in ApprovedIR no. issued IRN releasedclient notified On holdsame inspector fixes Rejectedre-inspection due coordinator inspector approve release hold resubmit reject new visit for the balance quantity partial approval: balance qty can be assigned again

Numbers

PO TPI/{FY}/{SEQ}, item CN-{SEQ}, IR/{FY}/{SEQ}, IRN/{FY}/{SEQ}. FY is the Indian financial year; counters restart each April and are issued inside a database transaction, so two people never get the same number.

Quantity rules

Item quantities are checked against the PO. Each visit offers a quantity; the report splits it into accepted and rejected. A stage is complete when the approved quantity reaches the stage total.

Documents

PO files, stage control files and site photos are private. IR and IRN print as A4 pages (print or save as PDF) for staff and for the customer.

07 · Roles & access

Who can do what

ActionAdminCoordinatorTechnical headInspectorViewerCustomer
Masters, staff, settings ✓ · · · · ·
Create vendor POs and items ✓ · · · · ·
Assign inspectors, upload control files ✓ ✓ · · · ·
Submit inspection reports · · · ✓own visits · ·
Approve / hold / reject, IR and IRN ✓ · ✓ · · ·
See POs, reports, export ✓ ✓ ✓ · ✓ ·
Own client's orders, IR / IRN · · · · · ✓read-only
Subscription page ✓ · · · · ·

Superadmins are a separate kind of account with their own sign-in, guard and session table; they manage workspaces from the outside and have no login inside a customer's workspace.

08 · Email flows

The right person is told at every step

Every email is queued (the page answers at once) and sent by the scheduler within about a minute. Workflow emails share one branded layout with a five-step journey tracker and one clear button.

Inside a workspace

Visit assigned or changedInspector (cc coordinator)
Report submitted / resubmittedAll active technical heads
Approved with IR no.Inspector (cc coordinator)
On hold, with reasonInspector (cc coordinator)
Rejected, with next stepInspector (cc coordinator)
IRN releasedInspector, coordinator, client's customer logins
Sign-in codeThe person signing in
WelcomeNew staff or customer login

From the service

Sign-up verification codeThe person signing up
Workspace readyThe new workspace admin
Tax invoice issued / reminderWorkspace billing contact
Payment receivedWorkspace billing contact
Demo / contact / plan-change enquiryAll superadmins
Superadmin sign-in codeThe superadmin

Customer copies show only their PO, item, stage and IR / IRN numbers, never internal remarks. Each workspace can switch workflow emails and the customer IRN email on or off, and preview every email with sample data.

09 · Subscriptions & billing

Workspace life cycle

A daily job (saas:billing, 9 AM IST) issues invoices and moves workspaces between states. Payments are recorded by the superadmin; nothing is charged automatically and data is never deleted for non-payment.

Subscription state machine Trial 14 days, full use Active paid period Payment due works, with a banner Suspended read-only Cancelled closed, data kept invoice paid period ends unpaid +7 grace days superadmin closes trial ends without payment payment recorded → active again at once

Invoices

Renewal invoice 7 days before the period ends. GST 18%: CGST + SGST inside the seller's state, IGST otherwise. Numbered per financial year.

Plan limits

Checked inside the workspace at the moment of use: active staff, active customer logins, POs per month, file storage, and features such as the customer portal, export and workflow emails.

Commercial terms

A one-time setup fee of ₹10,000 is charged extra on any plan and is non-refundable. The minimum subscription period on any plan is 6 months. Any specific add-ins for modules, changes, or AI model adoption are charged extra, and are implemented on the basis of a shared proposal and a signed agreement.

10 · Security

Secure by design

🔑

Passwordless sign-in

A 6-digit code by email: stored hashed, valid 10 minutes, single use, 5 tries, 5 sends an hour. Same reply whether or not the email exists, so accounts cannot be discovered.

🧱

Tenant isolation

Separate tables or database, file folder, sessions and queue per workspace. The host decides the workspace before any code reads data.

👤

Least privilege

Six roles checked on every action. Inspectors see only their own visits; customers only their own client's orders, never vendor PO files or review notes.

📁

Private files

Uploads live outside the public web folder and are streamed only after a permission check. Size and type are limited.

🛡️

Web protections

HTTPS everywhere, CSRF tokens on every form, escaped output, validated input, rate limits on sign-in, sign-up and enquiry forms, a honeypot against form spam.

🧾

Audit trail

Activity log of who did what and from which IP; superadmin actions on workspaces are recorded as workspace history.

🚫

Inactive means blocked

Deactivating a user, or a client, ends access at the next request. Imported legacy accounts start inactive.

🔒

Separate admin plane

Superadmins use their own guard, OTP table, session table and cookie, on their own host.

🕒

Consistent time

Times stored in UTC and shown in India time; financial-year numbering follows Indian rules.

11 · Scaling & roadmap

Room to grow

The design starts small on purpose and has clear next steps that do not change the core.

When neededStep
Large customerMove the workspace to a dedicated database (already supported per workspace)
Online paymentsPayment gateway (e.g. Razorpay) for invoices and auto-renewal
Many workspacesWildcard DNS and SSL, Redis for queue and cache, a VPS or container host
Lots of photosObject storage (S3-compatible) behind the same private-file checks
Self-service plan changesUpgrade / downgrade from the Subscription page with pro-rated invoices
IntegrationsRead-only API for customers' ERPs; AI-assisted report checks on request

See it working

Open the live demo, or start a free 14-day trial with your own workspace.