Welcome to the OTBL (Oil & Gas / Remediation Services Management) monorepo. This project is a comprehensive digital solution designed to manage complex industrial workflows, field operations, and remediation processes such as "Oil Zapping" and "Bioremediation."
Built with a modern, scalable architecture, this monorepo streamlines the lifecycle of work orders, site activities, and project proposals.
This project uses Turborepo and PNPM for high-performance monorepo management. It is organized into distinct applications for different user roles and shared packages for reusable logic.
- web: A powerful Next.js 15 administrative dashboard for managing work orders, clients, sites, and remediation activities.
- mobile-app: An Expo-powered mobile application for field operators to track site activity and update work order status in real-time.
- server: An Express-based backend serving as the tRPC API provider, handling business logic, database orchestration, and external integrations (AWS S3, email).
- @pkg/trpc: End-to-end typesafe API definitions shared between the server and all clients.
- @pkg/db: Database schema and Drizzle ORM configuration for MySQL.
- @pkg/auth: Shared authentication logic and JWT handling.
- @pkg/schema: Zod validation schemas used across the entire stack.
- @pkg/utils: Common utility functions and helpers.
- @repo/ui: A shared React component library (Tailwind CSS, Radix UI).
- Frameworks: Next.js 15 (App Router), Expo (React Native), Express
- API: tRPC (Typesafe API)
- Database: MySQL with Drizzle ORM
- Styling: Tailwind CSS & Lucide Icons
- Validation: Zod
- Infrastructure: AWS S3 (File Storage), Nodemailer (Notifications)
- Node.js: version 18 or higher.
- PNPM: Installed globally (
npm i -g pnpm). - MySQL: A running instance for the database.
-
Install dependencies:
pnpm install
-
Environment Variables: Copy
.env.exampleto.envin the root and relevant apps/packages, then fill in your credentials. -
Database Setup:
pnpm db:generate # Generate migrations pnpm db:migrate # Apply migrations
-
Start Development:
pnpm dev
This will start the web app, mobile bundler, and server concurrently.
- Build all projects:
pnpm build - Lint codes:
pnpm lint - Type checking:
pnpm check-types - Database Studio:
pnpm db:studio(Visualize your data)
This platform manages several key remediation workflows:
- Work Orders: Lifecycle management from creation to completion.
- Site Activities: Tracking daily tasks and progress on-site.
- Oil Zapping: Specialized remediation data tracking.
- Proposals & Billing: Managing client interactions and financial tracking.