Skip to content

About

TrakFlow keeps your projects, crews, materials, and tools moving together, from the first delivery to the final walkthrough. Rebuild (formerly EZTrack) using Next.js (v2)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

55 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TrakFlow

This is a Next.js (full stack) app designed to help construction teams track tools and materials, reduce shrinkage, and save money.

Table of Contents

Getting Started

Local Development

This app is designed to run locally for development. You’ll need Node.js and a Supabase project.

Tech Stack Docs

For the current stack overview and the project documentation map, see docs/tech-stack.md. For app-level rules around organizations, projects, materials, tools, and invites, see docs/business-logic.md.

Required Software

  1. Node.js (v20 or higher recommended) Download from https://nodejs.org/ Verify installation:
node -v
  1. Supabase Account Sign up at https://supabase.com/ and create a project.

About The env File

You must create your own .env.local file based on the provided .env.example.

The .env.local file contains sensitive configuration values that must never be committed or pushed to any repository under any circumstances.

Set the following variables in .env.local:

NEXT_PUBLIC_SUPABASE_URL=your-supabase-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
RESEND_API_KEY=your-resend-api-key
RESEND_FROM_EMAIL="TrakFlow <[email protected]>"
SUPABASE_PROJECT_ID=your-project-id
TRAKFLOW_BOOTSTRAP_TEST_PASSWORD=your-shared-test-password
NEXT_PUBLIC_APP_URL=http://localhost:3000

Minimum required to run the app:

  • NEXT_PUBLIC_SUPABASE_URL
  • NEXT_PUBLIC_SUPABASE_ANON_KEY

Required only for the hosted bootstrap flow:

  • SUPABASE_SERVICE_ROLE_KEY
  • TRAKFLOW_BOOTSTRAP_TEST_PASSWORD

Required only for foreman invite emails:

  • RESEND_API_KEY
  • RESEND_FROM_EMAIL
  • NEXT_PUBLIC_APP_URL

Optional:

  • SUPABASE_PROJECT_ID

Get the Supabase values from your Supabase project dashboard. Keep the shared bootstrap password only in .env.local.

Connecting to Supabase

  • NEXT_PUBLIC_SUPABASE_URL should match your Supabase project’s API URL.
  • NEXT_PUBLIC_SUPABASE_ANON_KEY is your project’s anon/public key.
  • SUPABASE_SERVICE_ROLE_KEY is required for the shared hosted dev bootstrap flow.
  • TRAKFLOW_BOOTSTRAP_TEST_PASSWORD is the shared password reset onto the seeded test accounts during bootstrap reruns.
  • RESEND_API_KEY and RESEND_FROM_EMAIL are used by Resend for foreman invite emails.
  • NEXT_PUBLIC_APP_URL is used to build absolute invite links.

Repo Bootstrap

See docs/repo-bootstrap.md for:

  • the hosted Supabase workflow for teammates
  • the local Supabase + Docker workflow for migration work
  • the shared hosted bootstrap script and test accounts
  • the local seed strategy

Backend and Data Boundaries

TrakFlow uses Next.js Server Components, server actions, and Supabase as the backend. Keep backend code readable by preserving these boundaries:

  • lib/dal/* is the data access layer. Use it for focused database reads, safe row mapping, and reusable query helpers.
  • app/services/* owns business workflows. Use it for server actions, mutations, permission checks, cache invalidation, storage coordination, and Supabase RPC orchestration.
  • supabase/migrations/* owns schema, RLS, indexes, triggers, and database functions.
  • Supabase functions should be reserved for atomic, security-sensitive, or concurrency-sensitive workflows such as checkout, return, invite claiming, material usage logging, and generated counters.
  • Avoid putting UI behavior, page-specific copy, component state, or workflow decisions in DAL helpers or Supabase functions.
  • Add production database changes as new migrations. Do not edit old migrations after they may have been applied to a shared or hosted project.

When optimizing data loading, remove request waterfalls first, then narrow selected columns, add focused indexes for real query paths, and verify the query plan in Supabase.

API Routes

This app uses Next.js API routes for backend logic. You can add new endpoints under the app/api/ directory.

Useful Commands

All commands are run from the project root.

  • Install dependencies:
npm install
  • Start the development server:
npm run dev

Open http://localhost:3000 in your browser.

  • Build for production:
npm run build
  • Start production server:
npm run start
  • Lint the code:
npm run lint
  • Bootstrap the shared hosted dev project:
npm run db:bootstrap:hosted -- --confirm-hosted-dev

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.

About

TrakFlow keeps your projects, crews, materials, and tools moving together, from the first delivery to the final walkthrough. Rebuild (formerly EZTrack) using Next.js (v2)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages