Skip to content

Warecorp/odoo-doo

Repository files navigation

Odoo Doo - Comprehensive Odoo Data Browser

Full-stack application for exporting, storing, and browsing Odoo ERP data locally.

πŸ“Š Data Flow

Odoo Instance (XML-RPC)
    ↓ (Python export scripts)
JSON Data Files (odoo-data/)
    ↓ (Node.js import script)
SQLite Database (backend/database.sqlite)
    ↓ (Express REST API)
Next.js Frontend (React + Tailwind)

All code is consolidated in this single directory!

πŸš€ Features

  • Dashboard - Overview statistics, charts, and recent activity
  • Employee Directory - Card grid with avatars, skills matrix, org chart
  • Timesheets - FullCalendar week/month views with filtering
  • Planning - Resource scheduling calendar
  • Projects - Kanban task boards, project management
  • CRM - Sales pipeline with drag-drop Kanban
  • AI Assistant - Natural language queries with Claude (Haiku/Sonnet/Opus)

πŸ“¦ Tech Stack

Frontend:

  • Next.js 14 (Static Export)
  • React Query for data fetching
  • shadcn/ui components
  • FullCalendar for timesheet/planning views
  • Recharts for analytics
  • Tailwind CSS with Odoo-inspired styling

Backend:

  • Node.js + Express
  • SQLite database (300MB from JSON import)
  • Anthropic Claude AI integration
  • Static file serving for employee avatars

πŸ› οΈ Setup

Prerequisites

  • Node.js 18+
  • npm or yarn

Installation

  1. Clone and install dependencies:
cd ~/odoo-doo
npm install
cd frontend && npm install
cd ../backend && npm install
  1. Import Odoo data to SQLite:
cd ~/odoo-doo/backend
npm run import

This will process ~300MB of JSON files and create database.sqlite (takes 2-3 minutes).

  1. Configure environment:
# Backend (.env optional)
PORT=3001

# Frontend
NEXT_PUBLIC_API_URL=http://localhost:3001

πŸƒ Development

Run both frontend and backend concurrently:

cd ~/odoo-doo
npm run dev

Or run separately:

# Terminal 1 - Backend
cd backend
npm run dev

# Terminal 2 - Frontend
cd frontend
npm run dev

Access:

🎯 First-Time Setup

  1. Navigate to http://localhost:3000
  2. Browse dashboard, employees, timesheets
  3. Go to AI Assistant page
  4. Enter your Anthropic API key (starts with sk-ant-api03-...)
  5. Ask questions like:
    • "Show me hours logged by employees this month"
    • "Which employees have Python skills?"
    • "What's the current sales pipeline value?"

πŸ“Š Database Overview

After import, you'll have:

  • 130 employees with avatars and skills
  • 700K+ timesheet entries spanning multiple years
  • 50 projects with 3,000+ tasks
  • 4,000+ CRM leads in sales pipeline
  • 80K+ planning slots for resource scheduling

πŸ—οΈ Project Structure

odoo-doo/
β”œβ”€β”€ frontend/              # Next.js application
β”‚   β”œβ”€β”€ app/              # Pages (Dashboard, Employees, etc.)
β”‚   β”œβ”€β”€ components/       # UI components
β”‚   └── lib/              # Utils
β”œβ”€β”€ backend/              # Express API
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ database/    # Schema & connection
β”‚   β”‚   β”œβ”€β”€ models/      # Data access layer
β”‚   β”‚   β”œβ”€β”€ routes/      # API endpoints
β”‚   β”‚   β”œβ”€β”€ ai/          # Claude integration
β”‚   β”‚   └── import/      # JSON β†’ SQLite import
β”‚   └── database.sqlite  # Generated database
β”œβ”€β”€ binaries/            # Employee avatars & images (880MB)
└── api/                 # Azure Functions (for deployment)

🎨 Key Pages

Route Description
/ Dashboard with stats and charts
/employees Employee directory with search/filters
/employees/skills Skills matrix view
/employees/org-chart Organizational hierarchy
/timesheets Calendar view of logged hours
/planning Resource scheduling calendar
/projects Kanban task boards
/crm Sales pipeline Kanban
/ai-chat Claude-powered Q&A

πŸ”Œ API Endpoints

Endpoint Description
GET /api/dashboard/overview Dashboard statistics
GET /api/employees Employee list (paginated)
GET /api/employees/:id Employee details with skills
GET /api/timesheets/calendar Calendar events for date range
GET /api/projects/meta/kanban Kanban board data
GET /api/crm/pipeline CRM pipeline by stage
POST /api/ai/query Natural language query

πŸš€ Azure Deployment

Prerequisites

  • Azure CLI installed
  • Azure Static Web Apps account

Deploy

  1. Build the frontend:
cd frontend
npm run build
  1. Upload database to Azure: Upload backend/database.sqlite to Azure Blob Storage or include in deployment.

  2. Deploy to Azure Static Web Apps:

az staticwebapp create \
  --name odoo-doo \
  --resource-group <your-resource-group> \
  --source . \
  --location "East US 2" \
  --branch main \
  --app-location "frontend" \
  --output-location "dist" \
  --api-location "api"
  1. Set environment variables:
az staticwebapp appsettings set \
  --name odoo-doo \
  --setting-names ANTHROPIC_API_KEY=<your-key>

Performance Tips for Minimal Azure Instance

The stack is optimized for minimal resources:

  • SQLite eliminates separate database server
  • Static export removes Next.js server overhead
  • Serverless functions scale to zero when idle
  • Pagination prevents loading large datasets
  • Indexes on date/employee/project fields

πŸ“ AI Assistant Usage

The AI Assistant uses Claude to query your data. Example queries:

Employee Queries:

  • "Who are the managers in Engineering?"
  • "Show me employees with React and Python skills"
  • "List all employees in the Poland office"

Timesheet Queries:

  • "How many hours did John Smith log last week?"
  • "Show total hours by project this month"
  • "Who worked on the Toro project in January?"

CRM Queries:

  • "List opportunities over $50K in Negotiation stage"
  • "What's the conversion rate from Lead to Opportunity?"
  • "Show top 10 deals by value"

Project Queries:

  • "Which projects have overdue tasks?"
  • "Show task completion rate by project"
  • "List all In Progress tasks for Life Fitness"

🎯 Odoo-Style Features

  • Purple sidebar (#714B67) matching Odoo branding
  • Kanban boards with drag-drop (CRM, Projects)
  • Calendar views for timesheets and planning
  • Avatar grids for employees
  • Badge colors for priorities and statuses
  • Breadcrumb navigation

πŸ”’ Security Notes

  • AI API key stored server-side (never exposed to client)
  • CORS configured for specific origins
  • Helmet.js security headers
  • Input sanitization on all endpoints
  • SQLite prepared statements prevent injection

πŸ“ˆ Future Enhancements

  • Real-time collaboration with WebSockets
  • Excel/CSV export functionality
  • Advanced filters and saved views
  • Mobile-responsive optimizations
  • Role-based access control
  • Data sync from live Odoo instance

πŸ› Troubleshooting

Import fails:

  • Ensure /home/markteskey/odoo-legacy/odoo-data exists
  • Check Node.js version (18+)
  • Verify 2GB+ free disk space

Frontend won't start:

  • Delete frontend/.next and rebuild
  • Run npm install in frontend directory
  • Check port 3000 is available

Backend API errors:

  • Verify database.sqlite exists
  • Check backend is running on port 3001
  • Review backend console for errors

Images not loading:

  • Verify binaries directory exists and contains subdirectories (hr_employee, res_partner, etc.)
  • Check image paths in database
  • Ensure static file middleware is configured

πŸ“„ License

This project is for internal use with Warecorp Odoo data.

πŸ‘₯ Contributors

Built with OpenCode AI assistant.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •