Docs · Website · Twitter · discord · Quickstart · Online Playground
TSCircuit Snippets is a web application for creating, sharing, and managing circuit designs using TypeScript and React. It provides an intuitive interface for designing circuit boards, packages, footprints, and 3D models.
- Create and edit circuit designs using TypeScript and React
- Real-time preview of PCB layouts and 3D models
- Share and collaborate on circuit designs
- AI-assisted circuit design and error correction
- Import and export designs in various formats
- Bun (latest version)
- Clone the repository:
git clone https://github.com/tscircuit/snippets.git
cd snippets
- Install dependencies:
bun install
To start the development server:
bun run dev
This command will build the fake API and start the Vite development server. Open http://localhost:5173 in your browser to view the application.
Create a .env
file with the following:
VITE_USE_DIRECT_AI_REQUESTS=true
VITE_ANTHROPIC_API_KEY=<your-key-here>
To build the project for production:
bun run build
This will create a production-ready build in the dist
directory.
src/
: Contains the main React application codefake-snippets-api/
: Contains the mock API for developmentpublic/
: Static assetssrc/components/
: Reusable React componentssrc/hooks/
: Custom React hookssrc/pages/
: Main page componentssrc/lib/
: Utility functions and helpersplaywright-tests/
: Playwright test filesplaywright-tests/snapshots/
: Visual regression test snapshots
We use Playwright for visual regression testing. Snapshots are stored in the playwright-tests/snapshots/
directory.
To update a single snapshot run...
bun run snapshot
This will prompt you to select a specific test file to update.
We welcome contributions to TSCircuit Snippets! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by val.town, codesandbox.io, and v0.dev
- Built with React, Vite, and Tailwind CSS
For more information, visit tscircuit.com.