|
1 |
| -This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). |
| 1 | +# Manim AI (v0 Animation) |
| 2 | + |
| 3 | +v0 Manim uses AI to create beautiful mathematical animations from simple text prompts. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- AI-powered generation of Manim code from natural language prompts |
| 8 | +- Automatic rendering of animations as videos |
| 9 | +- Chat interface for iterative refinement of animations |
| 10 | +- Support for multiple AI models (OpenAI and Groq) |
| 11 | +- History tracking of all generated animations |
| 12 | +- User authentication via Clerk |
| 13 | + |
| 14 | +## Tech Stack |
| 15 | + |
| 16 | +- **Frontend**: Next.js 14 with App Router, React, TailwindCSS, shadcn/ui |
| 17 | +- **Backend**: Node.js, Python (Manim server) |
| 18 | +- **Database**: Convex |
| 19 | +- **Authentication**: Clerk |
| 20 | +- **AI**: OpenAI, Groq |
| 21 | +- **Animation Engine**: Cairo/OpenGL |
2 | 22 |
|
3 | 23 | ## Getting Started
|
4 | 24 |
|
5 |
| -First, run the development server: |
| 25 | +### Prerequisites |
| 26 | + |
| 27 | +- Node.js 18+ and npm/pnpm |
| 28 | +- Python 3.9+ |
| 29 | +- Docker (for Manim server) |
| 30 | +- Convex database |
| 31 | + |
| 32 | +### Environment Setup |
| 33 | + |
| 34 | +1. Clone the repository: |
| 35 | + ```bash |
| 36 | + git clone https://github.com/yashksaini-coder/manim-ai |
| 37 | + cd manim-ai |
| 38 | + ``` |
| 39 | + |
| 40 | +2. Install frontend dependencies: |
| 41 | + ```bash |
| 42 | + pnpm install |
| 43 | + ``` |
| 44 | + |
| 45 | +3. Create a `.env` file in the root directory with the following variables: |
| 46 | + ``` |
| 47 | + # Deployment used by `npx convex dev` |
| 48 | + CONVEX_DEPLOYMENT=dev:your-deployment-id # team: your-team-name, project: your-project-name |
| 49 | +
|
| 50 | + NEXT_PUBLIC_CONVEX_URL=https://your-deployment-id.convex.cloud |
| 51 | +
|
| 52 | + NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key |
| 53 | + CLERK_SECRET_KEY=your_clerk_secret_key |
| 54 | +
|
| 55 | + NEXT_PUBLIC_CLERK_FRONTEND_API_URL=https://your-clerk-frontend-api-url |
| 56 | + DATABASE_URL=postgresql://username:password@your-database-host/your-database-name?sslmode=require |
| 57 | +
|
| 58 | + # SERVER APIs |
| 59 | + NEXT_PUBLIC_SERVER_PROCESSOR=http://127.0.0.1:5000 |
| 60 | + PORT=5000 |
| 61 | +
|
| 62 | + OPENAI_API_KEY=your_openai_api_key |
| 63 | + GROQ_API_KEY=your_groq_api_key |
| 64 | +
|
| 65 | + USE_LOCAL_STORAGE=true |
| 66 | + BASE_URL=http://localhost:5000/ |
| 67 | +
|
| 68 | + # Digital ocean space |
| 69 | + DO_SPACES_ACCESS_KEY=your_do_spaces_access_key |
| 70 | + DO_SPACES_ACCESS_SECRET=your_do_spaces_access_secret |
| 71 | + DO_SPACES_REGION=your_do_spaces_region |
| 72 | + DO_SPACES_BUCKET=your_do_spaces_bucket |
| 73 | + DO_SPACES_ENDPOINT=https://your-bucket.your-region.digitaloceanspaces.com |
6 | 74 |
|
7 |
| -```bash |
8 |
| -npm run dev |
9 |
| -# or |
10 |
| -yarn dev |
11 |
| -# or |
12 |
| -pnpm dev |
13 |
| -# or |
14 |
| -bun dev |
15 |
| -``` |
| 75 | + FLASK_APP=app.py |
| 76 | + ``` |
16 | 77 |
|
17 |
| -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. |
| 78 | +4. Set up the database with convex: |
| 79 | + ```bash |
| 80 | + npx convex dev |
| 81 | + pnpx convex dev |
| 82 | + ``` |
18 | 83 |
|
19 |
| -You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. |
| 84 | +### Running the Manim Server |
20 | 85 |
|
21 |
| -This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. |
| 86 | +1. Navigate to the manim-server directory: |
| 87 | + ```bash |
| 88 | + cd manim-server |
| 89 | + ``` |
22 | 90 |
|
23 |
| -## Learn More |
| 91 | +2. Start the Docker container: |
| 92 | + ```bash |
| 93 | + docker-compose up -d |
| 94 | + ``` |
24 | 95 |
|
25 |
| -To learn more about Next.js, take a look at the following resources: |
| 96 | +### Running the Frontend |
26 | 97 |
|
27 |
| -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. |
28 |
| -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. |
| 98 | +1. Start the development server: |
| 99 | + ```bash |
| 100 | + pnpm dev |
| 101 | + ``` |
29 | 102 |
|
30 |
| -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! |
| 103 | +2. Open [http://localhost:3000](http://localhost:3000) in your browser. |
31 | 104 |
|
32 |
| -## Deploy on Vercel |
| 105 | +### Adding New AI Models |
33 | 106 |
|
34 |
| -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. |
| 107 | +To add support for new AI models: |
35 | 108 |
|
36 |
| -Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. |
| 109 | +1. Add the API key to your `.env` file |
| 110 | +2. Create a new integration in `src/lib/ai-models.ts` |
| 111 | +3. Update the UI in `src/components/chat/ChatInput.tsx` to include the new model |
0 commit comments