A modern React + TypeScript application with Material UI that demonstrates CAD model viewing using the Autodesk Platform Services (APS) Viewer.
- Modern UI: Built with Material UI components and custom theming
- 3D Model Viewer: Integrated Autodesk Viewer for CAD files
- Demo Mode: Working sample models for demonstration
- File Upload: Simulated file upload with clear feedback
- Responsive Design: Works on desktop and mobile devices
- TypeScript: Full type safety and enhanced developer experience
cad-model-autosdk-mallesh-main/
├── backend/ # Express.js API server (Demo Mode)
│ ├── server.js # Main server file with mock endpoints
│ ├── package.json # Backend dependencies
│ └── ...
├── material-ui-frontend/ # React + TypeScript + Material UI frontend
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── services/ # API and viewer services
│ │ ├── theme/ # Material UI theme
│ │ └── types/ # TypeScript interfaces
│ ├── package.json # Frontend dependencies
│ └── ...
├── .env # Environment variables (APS credentials)
└── README.md # This file
- Node.js 16+ installed
- npm or yarn package manager
cd backend
npm install
npm startServer runs on: http://localhost:3000
cd material-ui-frontend
npm install
npm run devFrontend runs on: http://localhost:3001
Navigate to http://localhost:3001 in your browser
This application runs in Demo Mode with the following features:
- Autodesk Sample House.rvt - Architectural house model
- Autodesk Sample Engine.dwg - Mechanical engine model
- Autodesk Sample Office Building.rvt - Commercial building model
- Upload functionality is simulated
- Clear feedback about demo limitations
- Instructions for production setup
- Select a Model: Use the dropdown to choose a sample model
- View in 3D: The model loads in the interactive 3D viewer
- Viewer Controls:
- Mouse: Orbit, pan, zoom
- Buttons: Fit to view, fullscreen
- Upload Files: Try the upload to see demo feedback
- Express.js API server
- Mock endpoints for demo functionality
- CORS enabled for frontend development
- Sample model URNs for Autodesk Viewer
- App.tsx: Main application with demo info banner
- ViewerComponent.tsx: 3D viewer integration with detailed logging
- ViewerService.ts: Autodesk Viewer management with error handling
- ApiService.ts: HTTP client for backend communication
- Material UI Theme: Custom Autodesk-inspired design
- Check Browser Console: Look for detailed error messages
- Try Sample Models: Use "Autodesk Sample House.rvt" first
- Network: Ensure both servers are running
- Scripts: Verify Autodesk Viewer scripts load from CDN
- "Viewer library failed to load": Check internet connection
- "Model not found": Use only the provided sample models in demo mode
- CORS errors: Ensure backend is running on port 3000
To use real Autodesk Platform Services:
-
Get APS Credentials:
- Visit https://aps.autodesk.com/
- Create an app and get Client ID/Secret
-
Update .env file:
APS_CLIENT_ID=your_client_id APS_CLIENT_SECRET=your_client_secret APS_CALLBACK_URL=http://localhost:3000/api/auth/callback -
Replace Mock Endpoints: Update
backend/server.jswith real APS SDK calls
Backend:
npm start # Start development serverFrontend:
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLint- Frontend: React 18, TypeScript, Material UI, Vite
- Backend: Node.js, Express.js
- 3D Viewer: Autodesk Platform Services Viewer
- Styling: Material UI + Emotion
- HTTP Client: Axios
- Development: Hot reload, TypeScript checking
- Try the Demo: Select "Autodesk Sample House.rvt" to see working 3D
- Explore Code: Check browser console for detailed logging
- Upload Test: Try uploading a file to see demo feedback
- Production Setup: Add real APS credentials for full functionality
🎉 Enjoy exploring 3D CAD models with this modern viewer!