Skip to content

This application offers seamless drawing, shape modification, AI-powered shape recognition, and the ability to save projects to a gallery for future interaction and editing, providing a smooth and user-friendly experience.

Notifications You must be signed in to change notification settings

exslym/tldraw-editor

Repository files navigation

Tldraw Editor

An advanced, yet intuitive, shape editing tool built with modern web technologies. This application offers seamless drawing, shape modification, AI-powered shape recognition, and the ability to save projects to a gallery for future interaction and editing, providing a smooth and user-friendly experience.
For the AI features is used free model Qwen2.5 VL 72B Instruct (FREE).
Authentication is not implemented, and draws data is stored in localStorage since this is a test project. However, a database can be integrated, and authentication can be configured if needed.

Demo View on Vercel

✨ Features

  • Draw & Edit – Create and modify sketches with an easy-to-use canvas.
  • Save Projects – Save your projects to the gallery for easy access and future editing.
  • Shape Modification – Select a shape and easily switch between different geometric shapes using a dedicated button.
  • Project Gallery – Organize your saved projects in the gallery, preview them, and manage them effortlessly.
  • Export Options - Download your work in multiple formats, including SVG and PNG.
  • AI Shape Recognition – Select a hand-drawn shape and press the AI button to convert it into a precise geometric form.
  • User-Friendly Design – Clean UI with responsive layout and easy navigation.
  • Responsive & Adaptive UI – The editor is fully optimized for desktops, tablets, and mobile devices.

📸 Screens

🏠 Home Page

Home Screenshot

(back to top)


🖌 Gallery Page

Gallery Screenshot

(back to top)


🖌 Editor Page

Editor Screenshot

(back to top)


🛠 Technologies Used

Frontend

  • Next.js – Provides SSR and API routes, ensuring fast and efficient rendering.
  • React – Enables dynamic and component-based UI interactions.
  • TailwindCSS – A utility-first CSS framework for quick and beautiful styling.
  • Shadcn/UI – Delivers high-quality UI components for a smooth user experience.
  • Tldraw – The core library behind the drawing editor, providing shape manipulation tools.
  • Toaster (react-hot-toast) – Cares of rendering all notifications emitted.

Backend

  • tRPC – Ensures type-safe API communication between frontend and backend.
  • Zod – Used for input validation and schema enforcement.
  • Lodash Debounce – Optimizes auto-save by reducing redundant API calls.

(back to top)


🚀 Getting Started

✅ Prerequisites

  • Node.js (v16 or later)
  • npm (v8 or later)

📦 Installation

  1. Clone the repository:
git clone https://github.com/exslym/vidext_test_task.git
cd vidext_test_task
  1. Install dependencies:
npm install
  1. Create a .env file in the root of the project
  2. Sign in the OPENROUTER.AI ( via Google or Github)
  3. Choose and click on prefered visual understanding model (Qwen2.5 VL 72B Instruct (FREE) is used in this project)
  4. Then go to tab API and click Create API key
  5. Add your key as NEXT_OPENROUTER_API_KEY in .env

(back to top)


🏃 Running the App Locally

  1. Start the development server:
npm run dev
  1. Open your browser and go to:
http://localhost:3000

🏃 Test API calls

  1. After runnig the app locally open a new browser tab and navigate to the following route:
http://localhost:3000/test-api
  1. Available API Methods for Testing:
Get Data
Set Data
Delete All Data
Recognize Shape

The testing interface is intended for local development and debugging purposes only.


🏗 How to Use

  • Go to the Editor – Navigate to the editor page from the homepage.
  • Draw & Edit Shapes – Use the interactive canvas to create and modify shapes.
  • Modify a Shape – Select a shape and click the Modify Shape button to change its type.
  • Recognize a Shape (AI) – Select a shape and click Recognize Shape (AI) to detect its type.
  • Save Project – Save your projects and see them in the gallery page.
  • Go to the Gallery – Navigate to the gallery page from the homepage or editor page and there you can edit or delete your projects.

(back to top)


About

This application offers seamless drawing, shape modification, AI-powered shape recognition, and the ability to save projects to a gallery for future interaction and editing, providing a smooth and user-friendly experience.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published