MCPcopy Create free account
hub / github.com/Arbarwings/tauri-v2-nextjs-monorepo

github.com/Arbarwings/tauri-v2-nextjs-monorepo @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
32 symbols 89 edges 36 files 0 documented · 0% updated 19mo ago★ 90

Browse by type

Functions 23 Types & classes 9
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Tauri v2 + Next.js Monorepo Tauri v2 + Next.js Monorepo

This repository contains the source code of the blog post Tauri v2 with Next.js: A Monorepo Guide. It demonstrates how to build a cross-platform application using Tauri v2 for desktop and mobile apps, and Next.js for web services.

Features

  • Next.js for web and API services.
  • Tauri v2 for building lightweight and performant native desktop and mobile apps.
  • Monorepo setup powered by TurboRepo.
  • Shared components built with TailwindCSS, Shadcn, and Lucide for a consistent UI across platforms.
  • Reusable backend API using Next.js API routes.
  • Cross-platform deployment for Web, iOS, Android, Windows, macOS, and Linux.

Getting Started

Prerequisites

Ensure the following tools are installed:

  • Node.js (v22+)
  • pnpm (v8+)
  • Rust (Install Rust)
  • Xcode (for iOS development) (Optional)
  • Android Studio (for Android development) (Optional)

Installation

  1. Clone the repository:

bash git clone https://github.com/Arbarwings/tauri-v2-nextjs-monorepo.git cd tauri-v2-nextjs-monorepo

  1. Install dependencies:

bash pnpm install

Running the Apps

Web (Next.js):

pnpm --filter web dev

Desktop (Tauri):

pnpm --filter native dev

Mobile (iOS/Android via Tauri):

Refer to the Tauri Mobile Guide for additional setup.

Shared Components

The packages/ui directory contains shared UI components, hooks, and utilities built with:

These components ensure consistency across web, desktop, and mobile platforms.

API Endpoints

The backend API for text analysis is powered by Next.js API routes. The main endpoint is:

  • POST /api/text-analysis

  • Request body: { "text": "Your text here" }

  • Response:

    json { "success": true, "data": { "id": "unique-id", "timestamp": "2025-01-27T12:00:00Z", "analysis": { "wordCount": 100, "charCount": 500, "mostFrequentWord": "example", "sentimentScore": 1.5 } } }

Folder Structure

.
├── apps
│   ├── web        # Next.js app for web and API
│   ├── native     # Tauri app for desktop and mobile
├── packages
│   ├── ui         # Shared components, styles, and utilities
│   ├── typescript-config # Shared TypeScript configurations
│   ├── eslint-config # Shared ESLint configurations
└── turbo.json     # TurboRepo configuration

Commands

  • pnpm dev: Start the development server for all apps.
  • pnpm tauri: Exposes the Tauri CLI for running the desktop or mobile app.
  • pnpm tauri dev: Start the Tauri desktop app in development mode.
  • pnpm tauri android dev: Start the Tauri android app in development mode.
  • pnpm tauri ios dev: Start the Tauri iOS app in development mode.
  • pnpm lint: Lint the codebase using ESLint.
  • pnpm format: Format the codebase using Prettier.
  • pnpm clean: Remove all build artifacts.
  • pnpm check-types: Check TypeScript types.
  • pnpm shadcn: Exposes the Shadcn CLI for generating components.

Contributing

Contributions are welcome! Please fork the repository and create a pull request with your changes.

License

This project is licensed under the MIT License.


References

Extension points exported contracts — how you extend this code

browse all types & interfaces →

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 19
Class 6
Method 4
Interface 2
Enum 1

Languages

TypeScript66%
Kotlin22%
Rust12%

Modules by API surface

packages/ui/src/lib/api.ts8 symbols
packages/ui/src/views/analyzeTextView.tsx3 symbols
apps/native/src-tauri/gen/android/buildSrc/src/main/java/com/my_tauri_nextjs_monorepo/app/kotlin/RustPlugin.kt3 symbols
apps/native/src-tauri/gen/android/buildSrc/src/main/java/com/my_tauri_nextjs_monorepo/app/kotlin/BuildTask.kt3 symbols
apps/web/app/api/text-analysis/route.ts2 symbols
apps/native/src-tauri/src/lib.rs2 symbols
packages/ui/turbo/generators/config.ts1 symbols
packages/ui/src/types/text-analysis.ts1 symbols
packages/ui/src/lib/utils.ts1 symbols
packages/ui/src/components/button.tsx1 symbols
apps/web/next.config.ts1 symbols
apps/web/app/page.tsx1 symbols

For agents

$ claude mcp add tauri-v2-nextjs-monorepo \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page