Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ACC Cost Management Interface

A local application for querying and managing cost information from Autodesk Construction Cloud (ACC) API with automated reporting capabilities.

Features

  • 🔐 3-Legged OAuth Authentication - Secure authentication flow with persistent sessions
  • 💰 Cost Data Queries - View budgets, contracts, cost items, and change orders
  • 📊 Automated Reports - Schedule automatic cost data retrieval and reporting
  • ⚛️ React + TypeScript UI - Modern, type-safe frontend interface
  • 🔄 Real-time Updates - Webhook support for cost management events

Architecture

  • Frontend: React 18 + TypeScript + Vite
  • Backend: Node.js + Express + TypeScript
  • Database: SQLite (for token storage and scheduling)
  • Authentication: 3-legged OAuth 2.0
  • Scheduler: node-cron for automated reports

Prerequisites

  1. Node.js >= 18.0.0
  2. npm >= 9.0.0
  3. Autodesk Platform Services Account

Setup

1. Install Dependencies

npm run install:all

2. Configure Environment Variables

Copy .env.example to .env and fill in your credentials:

cp .env.example .env

Edit .env:

APS_CLIENT_ID=your_client_id_here
APS_CLIENT_SECRET=your_client_secret_here
APS_CALLBACK_URL=http://localhost:3000/api/auth/callback
SESSION_SECRET=generate_a_random_string

3. Run the Application

Development mode (runs both frontend and backend):

npm run dev

The application will be available at:

Usage

Initial Authentication

  1. Open the app in your browser
  2. Click "Login with Autodesk"
  3. Complete the OAuth flow
  4. Your tokens will be securely stored for automatic report generation

Querying Cost Data

  • Budgets: View all project budgets with detailed breakdowns
  • Contracts: Access contract information and terms
  • Cost Items: Query individual cost entries
  • Change Orders: Track cost modifications

Automated Reports

Configure automatic reports in the Settings panel:

  • Set schedule using cron syntax
  • Choose which cost data to include
  • Reports are generated and saved automatically

API Endpoints

Authentication

  • GET /api/auth/login - Initiate OAuth flow
  • GET /api/auth/callback - OAuth callback handler
  • GET /api/auth/status - Check authentication status
  • POST /api/auth/logout - Clear session

Cost Management

  • GET /api/cost/budgets - List all budgets
  • GET /api/cost/budgets/:id - Get specific budget
  • GET /api/cost/contracts - List all contracts
  • GET /api/cost/contracts/:id - Get specific contract
  • GET /api/cost/items - List cost items
  • GET /api/cost/change-orders - List change orders

Reports

  • GET /api/reports - List scheduled reports
  • POST /api/reports - Create new report schedule
  • DELETE /api/reports/:id - Delete report schedule
  • GET /api/reports/:id/run - Manually trigger report

Development

Project Structure

acc-cost-interface/
├── client/                 # React frontend
│   ├── src/
│   │   ├── components/    # React components
│   │   ├── services/      # API client services
│   │   ├── types/         # TypeScript type definitions
│   │   ├── hooks/         # Custom React hooks
│   │   └── App.tsx        # Main app component
│   └── package.json
├── server/                # Node.js backend
│   ├── src/
│   │   ├── routes/        # API routes
│   │   ├── services/      # Business logic
│   │   ├── middleware/    # Express middleware
│   │   ├── models/        # Database models
│   │   └── index.ts       # Server entry point
│   └── package.json
└── package.json           # Root package.json

Tech Stack

Frontend:

  • React 18
  • TypeScript
  • Vite
  • React Router
  • Axios
  • TailwindCSS (for styling)

Backend:

  • Node.js
  • Express
  • TypeScript
  • better-sqlite3 (database)
  • node-cron (scheduling)
  • express-session (session management)

Security Considerations

  • OAuth tokens are stored securely in SQLite database
  • Session secrets should be strong random strings
  • Never commit .env file to version control
  • The app should run on a secure server for production use
  • Consider implementing token encryption at rest

Resources

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages