Skip to content

Repository files navigation

TimberFlow 🌲

TimberFlow is a modern, high-fidelity Multi-Tenant SaaS platform designed for sawmills, wood depots, and timber merchants. It provides a complete cloud ERP and offline-first log sheet calculator suite to streamline round wood operations from remote yards to consolidated business analytics.


🌟 Key Features

1. Visual & Interactive Landing Page

  • Modern Design: Built using Tailwind CSS v4, featuring sleek gradient accents, glassmorphic navigations, responsive mockups, and micro-animations.
  • Live Interactive Hoppus Calculator: Prospective clients can calculate round wood volume (in CuFt) and estimated pricing live on the page by adjusting sliders.
  • Dedicated Workspace Registration: Seamless business workspace registration that directs new owners directly to the billing subscription select modal (/subscription).

2. Multi-Tenant ERP & SaaS Console

  • Tenant Isolation: Complete database routing security for tenants.
  • Super Admin Portal: Control panel enabling administrators to update subscriber plans (Free, Starter, Professional, Enterprise), toggle suspension, delete tenants, and view global security audit logs.
  • Operator Directory & Scope: Invite operators with customized access permissions mapped to specific physical depots/branches.

3. Measurement Sheet & Volume Calculators

  • Hoppus (Quarter Girth) Formula: Calculates wood volume using: $$\text{Volume (CuFt)} = \left(\frac{\text{Girth (Inches)}}{4}\right)^2 \times \frac{\text{Length (Feet)}}{144}$$
  • True Cylinder Formula: Pi-based volume calculation.
  • Carry-Forward Rates: Custom log rates are carried forward automatically to new rows of the same wood species to accelerate bulk entries.
  • Common Wood Species Defaults: Option to pin common log length, quantity, and species to auto-fill new rows.
  • Sorted Wood Species: Pinned common wood species bubble to the top of selection dropdowns for rapid data logging.
  • Floating Notification Toasts: Auto-hiding toast alerts for actions like saving log logs or reporting errors.

4. Advanced Operators Entry Tools

  • Voice Assistant Logging: Hands-free speech recognition parses commands like "Teak length 12 girth 36 quantity 4" and populates the log sheet.
  • Bulk Girth Entry: Paste space-separated perimeters to auto-fill logs counts and lengths.

5. Period-Wise Business Analytics

  • Overview Tab: Graphic charts showing depot performances, wood demand distributions, and top customer volumes using Recharts.
  • Chronological Tables: Detailed Weekly (ISO Weeks), Monthly, and Yearly breakdown lists dividing Sells vs Buys aggregates and calculating net cash balances.

6. PDF Invoice Exports & Exporters

  • High-Fidelity PDF Bills: Downloads professional invoices complete with table aggregates, loading charges, transport fees, custom discounts, and signature lines.
  • Verification QR Code: Generates secure verification QR codes mapped to the invoice ID.
  • Branded Footers: Includes a "Page X of Y" and "Powered by TimberFlow" footer branding line on every page.
  • Excel Sheet Export: Instantly exports reports, wood species summaries, and charge details as Excel spreadsheets.

7. Offline-First PWA Synchronization

  • IndexedDB Storage: Stores log drafts and customer details locally when there is no internet connection.
  • Auto-Synchronization: Automatically syncs draft reports to the cloud once network connectivity is restored.

🛠️ Technology Stack

  • Frontend Framework: Next.js 16 (Turbopack) & React 19
  • Styling: Tailwind CSS v4 & Lucide Icons
  • Database: PostgreSQL (Multi-tenant routed databases)
  • ORM: Prisma Client
  • State Management: Zustand
  • Local Storage Caching: IndexedDB
  • Internationalization: next-intl (Fully localized in English en, Hindi hi, and Malayalam ml)
  • Calculations Testing: Node.js Native Test Runner

🚀 Getting Started

Prerequisites

  • Node.js (v18 or higher)
  • PostgreSQL (or use the built-in mock JSON database)

Installation

  1. Clone the repository and navigate to the project directory:

    cd TimberSaaS
  2. Install dependencies:

    npm install
  3. Set up your environment variables: Copy the default variables to a .env file in the root folder:

    # NEXTAUTH_URL should map to your local running dev port
    NEXTAUTH_URL="http://localhost:3001"
  4. Database Setup (Optional): If you have a local PostgreSQL instance running, apply the Prisma schemas:

    npx prisma migrate dev

    Note: If you do not have PostgreSQL running, set NEXT_PUBLIC_MOCK_DB="true" in your .env file to use the mock JSON file database.

  5. Start the Next.js development server:

    npm run dev

    Open http://localhost:3001 in your browser to view the application.


🧪 Verification & Testing

  • Run automated calculation tests:
    npm test
  • Verify code style and formatting:
    npm run lint
  • Build production optimized bundle:
    npm run build

About

TimberFlow is a modern, high-fidelity Multi-Tenant SaaS platform designed for sawmills, wood depots, and timber merchants. It provides a complete cloud ERP and offline-first log sheet calculator suite to streamline round wood operations from remote yards to consolidated business analytics.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages