@tscircuit/fake-snippets v0.0.12
TSCircuit Snippets
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.
Features
- 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
Getting Started
Prerequisites
- Bun (latest version)
Installation
- Clone the repository:
git clone https://github.com/tscircuit/snippets.git
cd snippets
- Install dependencies:
bun install
Running the Development Server
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.
Testing the AI in Development
Create a .env
file with the following:
VITE_USE_DIRECT_AI_REQUESTS=true
VITE_ANTHROPIC_API_KEY=<your-key-here>
Building for Production
To build the project for production:
bun run build
This will create a production-ready build in the dist
directory.
Project Structure
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
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.
Contributing
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.
Example Snippets
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Inspired by val.town, codesandbox.io, and v0.dev
- Built with React, Vite, and Tailwind CSS
For more information, visit tscircuit.com.