Skip to content

Repository files navigation

VexBusiness

Entry flow: pick a role → enter a 4-digit PIN → land in that role's own space.

  • CEO gets the full tile-navigation space from the CEO Screen deck: Performance and Progress (→ Departments/HR, Finance, Compliance, CRM, SRM), Strategic Dashboards and Reports, Compliance, Communication(s), Task(s) & Notification(s), Schedule(s) & Notification(s), Research & Development, Branch(es), Archives, Help.
  • Finance and Accounting link through to the existing Business Setup, Transactions, and Tax screens (from the earlier VexBusiness wireframe).
  • Every other role (HR, Legal, Marketing & Sales, IT, Logistics, Operations, CRM, SRM) has its own PIN-gated space with a "coming soon" placeholder, ready to fill in once we have their screens.

All roles default to PIN 1234. Change PINs from the "Manage PINs" link on the role-select screen, or open /admin/pins directly.

Security note: this PIN gate is intentionally lightweight (a signed cookie, no accounts or passwords) — fine for an internal prototype, but swap in real authentication before this holds anything sensitive in production.

Run locally (VS Code)

  1. Open this folder in VS Code.
  2. Install dependencies:
    npm install
    
    This also runs prisma generate automatically.
  3. Create the local database and seed the roles (SQLite, zero setup):
    npx prisma migrate dev --name init
    npx prisma db seed
    
  4. Start the dev server:
    npm run dev
    
  5. Open http://localhost:3000 — pick a role, enter PIN 1234.

The local database is a single file, prisma/dev.db (already in .gitignore, won't be committed).

Deploy to Vercel

SQLite's file-based storage doesn't persist on Vercel's serverless functions, so for production you need a hosted Postgres database (Neon, Supabase, Vercel Postgres all work — Neon has a generous free tier).

  1. Get a Postgres connection string from your provider.
  2. In prisma/schema.prisma, change the datasource:
    datasource db {
      provider = "postgresql"
      url      = env("DATABASE_URL")
    }
  3. Push this project to a GitHub repo and import it in Vercel, or run vercel from this folder.
  4. In the Vercel project's Environment Variables, add:
    • DATABASE_URL — your Postgres connection string
  5. Redeploy. The build script runs prisma migrate deploy automatically, which creates the tables in your Postgres database on first deploy.

If you ever change prisma/schema.prisma again, run npx prisma migrate dev --name <change> locally to generate a new migration file, commit it, then redeploy.

Project structure

  • src/lib/roles.ts — the list of roles shown on the select screen
  • src/lib/session.ts — signed-cookie session helper
  • src/middleware.ts — protects every /space/* route, redirects to that role's PIN screen if not signed in
  • src/app/page.tsx — role select screen
  • src/app/login/[slug] — PIN pad
  • src/app/admin/pins — set each role's PIN
  • src/app/space/ceo — the full CEO tile-navigation space
  • src/app/space/[slug] — generic space for every other role
  • src/lib/transactionTypes.ts — all Action Box transaction types and their fields (edit here to add/change a transaction type)
  • src/lib/taxTypes.ts — Tax module categories and actions
  • src/lib/businessConfig.ts — business types, departments, currencies, industry sectors/sub-categories
  • src/app/setup — Business Setup + Financial Details screen
  • src/app/transactions — Action Box transaction screen
  • src/app/tax — Tax module screen
  • prisma/schema.prisma — database schema (Role, BusinessProfile, Transaction, TaxEntry)

Theme

Light creamy palette defined in tailwind.config.ts (cream background, moss green accent, warm ink text). Adjust the hex values there to restyle.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages