Skip to content

mannydearaujo/jarvis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Jarvis Contractor Assistant

A complete voice-first AI assistant system for contractors across multiple trades. This monorepo contains both the backend API and the React dashboard.

πŸ“¦ Project Structure

jarvis/
β”œβ”€β”€ backend/              # Node.js Express backend API
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ db/          # Database schema and connection
β”‚   β”‚   β”œβ”€β”€ routes/      # API endpoints
β”‚   β”‚   β”œβ”€β”€ services/    # Business logic (pricing, email, agent)
β”‚   β”‚   β”œβ”€β”€ types/       # TypeScript type definitions
β”‚   β”‚   └── index.ts     # Express server entry point
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ README.md
β”‚   β”œβ”€β”€ API.md           # API documentation
β”‚   └── DEPLOYMENT.md    # Deployment guide
β”‚
β”œβ”€β”€ dashboard/           # React TypeScript frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ api/         # Backend API client
β”‚   β”‚   β”œβ”€β”€ components/  # React components
β”‚   β”‚   β”œβ”€β”€ store/       # Zustand state management
β”‚   β”‚   β”œβ”€β”€ App.tsx
β”‚   β”‚   └── main.tsx
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ vite.config.ts
β”‚   └── README.md
β”‚
β”œβ”€β”€ README.md            # This file
β”œβ”€β”€ .gitignore
└── docker-compose.yml   # (Optional) Local development setup

πŸš€ Quick Start

Backend Setup

cd backend
npm install
npm run dev

Backend runs on http://localhost:3000

Dashboard Setup

cd dashboard
npm install
npm run dev

Dashboard runs on http://localhost:5173

🎯 Features

Backend API

  • Trade-Agnostic Architecture β€” Works with any contractor type (gutters, roofing, plumbing, electrical, HVAC, etc.)
  • Job Management β€” Create, update, and track jobs with measurements and materials
  • Configurable Pricing Engine β€” Support for per-unit, tiered, labor-based, and hybrid pricing models
  • Quote Generation β€” Automatically calculate and generate professional quotes
  • Email Delivery β€” Send quotes and updates via email with HTML formatting
  • Voice Command Processing β€” Extract intent and entities from natural language
  • Memory & Context β€” Store contractor profiles and job history with pgvector support
  • 38 Passing Tests β€” Comprehensive test coverage for pricing, voice extraction, and agent logic

Frontend Dashboard

  • Job Management β€” Create, view, and manage jobs with client details
  • Quote Generation & Tracking β€” Generate quotes and track email delivery status
  • Professional UI β€” Modern gradient design with responsive layout
  • Real-time Updates β€” Live status updates for jobs and quotes
  • Contractor Settings β€” Manage profile and communication preferences
  • Email Integration β€” Send quotes directly to clients with delivery tracking

πŸ›  Tech Stack

Backend

  • Runtime: Node.js 22+
  • Framework: Express 4
  • Database: PostgreSQL + pgvector
  • Language: TypeScript
  • Testing: Vitest
  • Email: Nodemailer
  • Voice: OpenAI Realtime API (integration ready)

Frontend

  • Framework: React 19
  • Language: TypeScript
  • Build Tool: Vite
  • State Management: Zustand
  • HTTP Client: Axios
  • Styling: CSS3

πŸ“– Documentation

  • Backend API: See backend/API.md for full API documentation
  • Backend Setup: See backend/README.md for backend-specific instructions
  • Dashboard: See dashboard/README.md for frontend-specific instructions
  • Architecture: See backend/ARCHITECTURE.md for system design details
  • Deployment: See backend/DEPLOYMENT.md for deployment instructions

πŸ”§ Environment Variables

Backend

Create .env in the backend/ directory:

DATABASE_URL=postgresql://user:password@localhost:5432/jarvis_db
NODE_ENV=development
PORT=3000
OPENAI_API_KEY=sk-...
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USER=your-email@gmail.com
EMAIL_PASSWORD=your-app-password
JWT_SECRET=your-secret-key-here

Frontend

Create .env in the dashboard/ directory:

REACT_APP_API_URL=http://localhost:3000/api

πŸ“Š API Endpoints

Contractors

  • POST /api/contractors β€” Create contractor
  • GET /api/contractors/:id β€” Get contractor
  • GET /api/contractors β€” List contractors
  • PUT /api/contractors/:id β€” Update contractor
  • DELETE /api/contractors/:id β€” Delete contractor

Jobs

  • POST /api/jobs β€” Create job
  • GET /api/jobs/:id β€” Get job
  • GET /api/jobs β€” List jobs
  • PUT /api/jobs/:id β€” Update job
  • DELETE /api/jobs/:id β€” Delete job

Quotes

  • POST /api/quotes β€” Generate quote
  • GET /api/quotes/:id β€” Get quote
  • GET /api/quotes β€” List quotes
  • POST /api/quotes/:id/send β€” Send quote via email

Voice Processing

  • POST /api/voice/extract β€” Extract intent and entities from text
  • POST /api/agent/command β€” Process voice command

πŸ§ͺ Testing

Backend Tests

cd backend
npm run test:run

Runs 50+ tests covering:

  • Pricing engine calculations
  • Voice intent extraction
  • Quote generation
  • Email formatting
  • Agent logic

🚒 Deployment

Docker

docker-compose up

Production Build

Backend:

cd backend
npm run build
npm start

Dashboard:

cd dashboard
npm run build
npm run preview

Cloud Deployment

  • Vercel: Deploy dashboard to Vercel, backend to Railway/Render
  • Heroku: Use Procfile for backend, dashboard on Vercel
  • AWS: ECS for backend, S3 + CloudFront for dashboard
  • DigitalOcean: App Platform for both

See backend/DEPLOYMENT.md for detailed instructions.

πŸŽ“ Voice Commands

The system supports 7 voice command families:

  1. Start Job β€” "Start a new job for John Smith"
  2. Add Measurements β€” "Add 100 feet of gutter"
  3. Add Materials β€” "Add 10 sheets of aluminum"
  4. Build Quote β€” "Generate a quote for this job"
  5. Schedule Delivery β€” "Schedule delivery for tomorrow"
  6. Message Contractor β€” "Send a message to the client"
  7. Lookup Job β€” "Look up the previous job for this customer"

πŸ“± Mobile Support

The dashboard is fully responsive and works on:

  • Desktop (Chrome, Firefox, Safari, Edge)
  • Tablet (iPad, Android tablets)
  • Mobile (iPhone, Android phones)

πŸ” Security

  • Environment variables for sensitive data
  • JWT authentication ready
  • Email validation
  • Input sanitization
  • CORS configured for production

πŸ“ License

MIT

🀝 Contributing

  1. Create a feature branch: git checkout -b feature/your-feature
  2. Commit changes: git commit -am 'Add feature'
  3. Push to branch: git push origin feature/your-feature
  4. Open a Pull Request

πŸ“ž Support

For issues, questions, or suggestions, please open an issue on GitHub or contact the development team.

πŸ—Ί Roadmap

  • OpenAI Realtime API integration for live voice transcription
  • Advanced analytics dashboard
  • PDF quote export
  • Customizable email templates per trade
  • React Native mobile app
  • Multi-language support
  • Contractor marketplace
  • Integration with accounting software

Built with ❀️ for contractors everywhere

About

Complete voice-first AI assistant system for contractors: backend API + React dashboard

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors