Ever dreamed of having your own AI-powered creative space? Open Canvas lets you interact with an AI through chat, generating and modifying text and code directly on a canvas. This guide simplifies the local setup process, turning you into an AI canvas maestro! 🎨
🗝️ Key Ingredients: Gathering Your Supplies
Before diving in, let’s gather the essential ingredients for our AI recipe. Think of it like prepping for a coding culinary adventure! 🧑🍳
- Yarn: The package manager that ties everything together. Make sure it’s installed on your system.
- API Keys: You’ll need keys for OpenAI and Anthropic (and optionally Google Vertex AI and Fireworks) to unlock the power of these LLMs.
- Supabase Account: This free service handles user authentication, acting as the gatekeeper to your canvas.
- LangGraph CLI: This command-line tool orchestrates the LangGraph server, the brains behind the operation.
- LangSmith Account: Provides the API key needed for LangGraph CLI, connecting you to the LangChain ecosystem.
🏗️ Building the Foundation: Setting Up Authentication
Supabase is our authentication fortress. Setting it up is straightforward:
- Create a new Supabase project (e.g., “Open Canvas”).
- Navigate to Project Settings -> API and copy your Project URL and Anonymous API Key. These are your secret codes! 🤫
- In your
.env
file (copied from.env.example
), paste these keys into the corresponding fields. - Enable email authentication in the Supabase Authentication settings. You can optionally add GitHub and Google logins too.
🧠 Wiring the Brain: Running the LangGraph Server
The LangGraph server is the heart of Open Canvas. Here’s how to bring it to life:
- Install the LangGraph CLI using the command from the LangGraph documentation.
- Run
langraph up --watch -d -p 54367
(including your LangSmith API key if not already set in your environment). This command summons the server, ready to process your AI requests. 🪄
🎨 Painting the Interface: Starting the Web Server
With the backend ready, let’s launch the visual interface:
- Run
yarn dev
in your terminal. This command paints the canvas onto your screen, ready for your creative input. 🖌️ - Open your browser and navigate to the local URL (usually
http://localhost:3000
).
✨ Unleashing Your Creativity: Interacting with Open Canvas
Now the fun begins! Type your requests into the chat window and watch the AI generate text or code on the canvas. Try something like “Write me a to-do app in React” and witness the magic! ✨
🧰 Resource Toolbox
Here are the essential tools for your Open Canvas journey:
- Open Canvas GitHub Repository: Your central hub for all things Open Canvas.
- LangSmith: Sign up for a free account to get your LangSmith API key.
- LangGraph CLI: Download and install the command-line interface.
- Supabase: Create a free account to manage user authentication.
- OpenAI: Get your OpenAI API key to access their powerful language models.
- Anthropic: Obtain your Anthropic API key for another LLM option.
- Google Vertex AI: (Optional) Get your Google Vertex AI API key for additional model access.
- Fireworks: (Optional) Obtain your Fireworks API key for another LLM option.
- Yarn: Download and install the Yarn package manager.
By following these steps, you’ll have your own local instance of Open Canvas, ready to bring your AI-powered ideas to life. Experiment, explore, and create! 🎉