A full-stack web application for design engineers with visual flow editor and social features.



infinity.mp4
- AI Content Generation: Create text and image content using AI
- Visual Flow Editor: Drag-and-drop interface for building content workflows
- Blockchain Integration: Ethereum wallet support with Dynamic Labs
- Social Platform: Share and explore content with user profiles
- Real-time Sync: Offline-first with IndexedDB and cloud sync
- License Management: Story Protocol integration for content licensing
- Framework: React 19 + TypeScript
- Build Tool: Vite
- Styling: TailwindCSS 4
- State Management: TanStack Query + IndexedDB
- Routing: React Router
- UI Components: Radix UI + Lucide React icons
- Animations: Motion (Framer Motion alternative)
- Flow Editor: React Flow (@xyflow/react)
- Blockchain: Dynamic Labs + Wagmi + Viem
- Framework: Hono (Node.js)
- Database: PostgreSQL with Prisma ORM
- Authentication: JWT with JWKS
- File Storage: Cloudflare R2
- AI Integration: OpenRouter AI SDK
- Validation: Zod schemas
infinity/
├── apps/
│ ├── api/ # Backend API server
│ │ ├── prisma/ # Database schema & migrations
│ │ ├── src/
│ │ │ ├── services/ # Business logic
│ │ │ ├── middlewares/# Auth & validation
│ │ │ └── index.ts # Server entry point
│ │ └── package.json
│ └── web/ # Frontend React app
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── pages/ # Route components
│ │ ├── lib/ # Utilities & hooks
│ │ └── main.tsx # App entry point
│ └── package.json
├── package.json # Root workspace config
└── pnpm-workspace.yaml # PNPM workspace
- React 19
- TypeScript
- Vite
- Tailwind CSS 4
- React Router
- TanStack Query
- IndexedDB (Dexie)
- React Flow
- Dynamic.xyz (Auth)
- Motion (animations)
- Lucide React (icons)
- Hono (Node.js framework)
- TypeScript
- Prisma (PostgreSQL ORM)
- JWT authentication
- Cloudflare R2
- OpenRouter for gateway
- Zod validation
- Node.js 18+
- PNPM
- PostgreSQL database
- Cloudflare R2 bucket
- OpenRouter API key
-
Clone the repository
git clone <repository-url> cd infinity
-
Install dependencies
pnpm install
-
Environment Setup
Create
.env
files in bothapps/api/
andapps/web/
:API Environment (
apps/api/.env
):DATABASE_URL="postgresql://user:password@localhost:5432/hackathon" DYNAMIC_ENV_ID="your-dynamic-env-id" R2_ACCESS_KEY_ID="your-aws-key" R2_SECRET_ACCESS_KEY="your-aws-secret" OPENROUTER_API_KEY="your-openrouter-key"
Web Environment (
apps/web/.env
):VITE_DYNAMIC_ENVIRONMENT_ID="your-dynamic-env-id"
-
Database Setup
cd apps/api pnpm db:m # Run migrations pnpm db:g # Generate Prisma client
-
Start Development Servers
# Start both frontend and backend pnpm dev # Or start individually pnpm run:api # Backend only cd apps/web && pnpm dev # Frontend only
pnpm dev
- Start both frontend and backend in developmentpnpm run:api
- Start only the API serverpnpm biome:fix
- Format code with Biome
pnpm dev
- Start development serverpnpm build
- Build for productionpnpm start
- Start production serverpnpm db:g
- Generate Prisma clientpnpm db:m
- Run database migrationspnpm db:s
- Open Prisma Studio
pnpm dev
- Start Vite development serverpnpm build
- Build for productionpnpm preview
- Preview production build
- Post: User-generated content with media and licensing
- Flow: Visual workflow definitions
- Node: Individual nodes within flows
- License: Blockchain-based content licensing
- UUID-based IDs
- Timestamp tracking
- User relationships
- Category classification
- IP and token management
- JWT-based authentication
- JWKS for key rotation
- CORS enabled
- Input validation with Zod
- Secure file uploads to Cloudflare
POST /generate
- AI design generationPOST /upload
- File uploadPOST /upload-json
- JSON data upload
POST /sync/flow
- Save flow dataPOST /sync/node
- Save node contentDELETE /sync/node
- Delete node contentGET /sync/all
- Load flow and node data
POST /post/new
- Create new postPOST /post/update-purchase
- Update purchase statusGET /posts
- Get all posts (paginated)GET /posts/me
- Get user's postsGET /posts/category
- Get posts by category
- Custom nodes with drag-and-drop
- Connection validation
- Inter connect nodes for creativity
- Offline-first with sync
- Text generation
- Image generation
- Empty content placeholders
- Loading states
- Generation renderer
- Offline-First: IndexedDB for local storage
- Real-time Sync: Debounced backend synchronization
- AI Integration: State of the art models for design generation
- Ownership: Registered as Intellectual property in Story, seamless signless & gasless integration.
- File Storage: AWS S3 for media uploads
- Configure environment variables
- Start command:
pnpm dev
- Output directory:
dist
- Set up PostgreSQL database
- Configure environment variables
- Start command:
pnpm dev
- Fork the repository
- Create a feature branch
- Make your changes
- Run
pnpm biome:fix
to format code - Submit a pull request
This project is licensed under the MIT License.