Developer Guide
Welcome to TimberView. This documentation is for the IT team that will install and support the application.
Monorepo containing Timberview client and server logic.
Overall
Client (/client)
Build: Vite
Framework: React
UI: Radix UI
Maps: OpenLayers
Data: TanStack / React Query
Routing: React Router
State: Zustand
E2E: Cypress
Server (/server)
Express & TypeScript
PostgreSQL + Prisma ORM
Multer (file uploads)
Puppeteer (PDF reports)
Mailer (/mailer)
Email generation sent to users
Uses React Email: https://react.email/
Database Engine
Engine: PostgreSQL with PostGIS
Core entities:
userspropertiesassessmentsassessment_requestsparcelsmanual_formsreportsfeedback
Other
User docs:
/mfa-docs(Sphinx)Auth: Auth0
Attachments:
/attachmentsScripts:
/scriptsCache: Redis
Ports
Port |
Service |
|---|---|
5173 |
Vite dev server (HMR) |
4000 |
Express API / production |
6379 |
Local Redis |
Local Setup
Prerequisites
Node.js v22
npm
PostgreSQL with PostGIS
Redis
Docker (optional)
Required env keys are in envs/.env.sample.
Install and setup
Clone the repo.
Set up environment variables:
Copy
envs.jsonintoenvs/Run:
node ./scripts/create-env.mjsCopy
.env.local→.env
Install dependencies:
npm installCreate database
mfa.Run:
npm run rebuild-envs:use
Run:
prisma migrate reset
Start Redis.
Adjust env settings if needed.
Start app:
npm run start
Work in Development Mode
Command:
npm run start
Notes:
Uses Vite dev server + Express
HMR enabled
Server runs via nodemon
Gotchas
Attachments may not display on port 5173
Firefox auth may be flaky
Work in Prod Mode
Command:
npm run start:prod
Serves app at:
http://localhost:4000
Running via Docker
npm run build-image
npm run run-image
Running Local Env Against Other DBs
Run:
npm run rebuild-envs
Copy DB config into
envs.localStart:
npm run start
Running Tests
Unit Tests
npm run test
Cypress (E2E)
npm run start:test
npm run test:cypress
Creating a New Admin User
User signs up (no profile)
Get Auth0 details
Run:
INSERT INTO users (id, user_type, email, first_name, last_name)
VALUES ('[ID]', 'admin', '[EMAIL]', '[FIRST NAME]', '[LAST NAME]');
Prisma ORM & Database
DB Version
Postgres v17.9
PostGIS v3.6.3
Migrations
npx prisma migrate dev --name NAME_YOUR_MIGRATION
Reset DB
npx prisma migrate reset
Database Seeding
Defined in:
/server/prisma.config.ts
Seed script:
Creates admin user
Render Setup
Hosting: https://render.com
Environments
Dev → demo.timberview.app
Prod → timberview.app
Database
Hosted PostgreSQL
Persistent Disk
Mounted at
/attachments
Email System
Uses React Email.
Preview:
cd mailer
npm run dev
Rebuild:
cd mailer
npm run build
Deploying
Development
Push to
main
Production
git fetch --all
git checkout production
git rebase origin/main
git push
Misc Topics
Renaming a Column
ALTER TABLE "TABLE"
RENAME COLUMN "OLD_COLUMN_NAME" TO "NEW_COLUMN_NAME";
Environment Variables
Edit
envs/envs.jsonRun:
node ./scripts/create-env.mjs
DNS
Managed via Hostgator
Follow Render DNS docs
Auth0
Shared tenant across environments
Sentry
Used for error monitoring
Redis
Used for caching
Troubleshooting
Check Render logs
Run locally:
npm run build
NPM Scripts
Script |
Description |
|---|---|
npm run start |
Dev server |
npm run start:prod |
Production build |
npm run build |
Build all |
npm run test |
Run tests |
User Documentation (mfa-docs)
Setup:
Install Python & pip
Create virtual environment
Install:
pip install -r mfa-docs/requirements.txt
Build:
npm run build:docs
Output:
mfa-docs/build
Last Updated: Jun 26, 2026