A modern web application for creating, sharing, and viewing OpenSCAD 3D models with real-time preview capabilities.
- Create OpenSCAD Models: Professional code editor using CodeMirror
- Real-time 3D Preview: Instant GLB generation and 3D model viewing using Google Model Viewer
- Model Sharing: Share your OpenSCAD creations with the community
- Search & Browse: Find models by title, description, tags, or author
- Download Models: Export models as
.scadfiles for local use
- Interactive Code Editor:
- Dark theme with Monaco/Menlo fonts
- Real-time code validation
- 3D Model Processing:
- Automatic SCAD to GLB conversion
- Color support and material handling
- Optimized for web viewing
- Responsive Design: Works seamlessly on desktop and mobile devices
- Database Integration: PostgreSQL with Drizzle ORM for data persistence
- File Storage: Firebase Storage integration for GLB files
- Frontend: SvelteKit 2, TypeScript, CodeMirror 6
- Backend: Node.js, SvelteKit API routes
- Database: PostgreSQL with Drizzle ORM
- 3D Processing: OpenSCAD CLI integration
- 3D Viewer: Google Model Viewer
- File Storage: Firebase Admin SDK
- Styling: Custom CSS with responsive design
- Development: Vite, TypeScript, Docker Compose
- Node.js 18+ or Deno
- PostgreSQL database
- OpenSCAD installed and available in PATH
- Firebase project (for GLB storage)
git clone <repository-url>
cd scadnpm install
# or with Deno
deno installStart PostgreSQL using Docker Compose:
npm run db:startSet up your database schema:
npm run db:pushCopy the example environment file:
cp .env.example .envEdit .env with your configuration:
DATABASE_URL="postgres://root:mysecretpassword@localhost:5432/local"
# Add Firebase credentials and other required variablesnpm run devVisit http://localhost:5173 to see the application.
npm run dev- Start development servernpm run dev -- --open- Start development server and open browser
npm run db:start- Start PostgreSQL with Docker Composenpm run db:push- Push schema changes to databasenpm run db:generate- Generate migration filesnpm run db:migrate- Run database migrationsnpm run db:studio- Open Drizzle Studio for database management
npm run build- Create production buildnpm run preview- Preview production buildnpm run check- Type check the project
src/
βββ routes/ # SvelteKit routes
β βββ +page.svelte # Home page - browse models
β βββ create/ # Create new SCAD file
β βββ [scad]/ # View/edit individual SCAD file
β βββ admin/ # Admin dashboard
β βββ reports/ # Usage reports
β βββ api/ # API endpoints
βββ lib/
β βββ server/
β βββ db/ # Database schema and connections
β βββ [utilities] # Server-side utilities
βββ static/
βββ models/ # Static 3D model files
- Professional code editor
- Real-time 3D preview generation
- Default example code showing common OpenSCAD shapes
- Form validation and error handling
- Edit existing models with live preview updates
- Save changes to database and Firebase Storage
- Download models as
.scadfiles - Responsive split-panel design
- Browse all public models
- Search functionality across titles, descriptions, and tags
- Grid view with 3D previews
- Click to view/edit models
- Converts OpenSCAD code to GLB format using OpenSCAD CLI
- Handles colors and materials
- Optimizes file size for web delivery
- Fallback handling for processing errors
- User authentication and profile information
- Tracks creation timestamps
- Model metadata (title, description, tags)
- OpenSCAD source code storage
- File size and download tracking
- Firebase Storage GLB URLs
- Public/private visibility controls
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and test thoroughly
- Commit your changes:
git commit -m "Add feature" - Push to your branch:
git push origin feature-name - Open a Pull Request
For support or questions about this OpenSCAD sharing platform, please open an issue in the repository.