Getting Started with wexts
Everything you need to build your first full-stack application with wexts. Get up and running in minutes.
Prerequisites
Installation
The fastest way to get started is using the create-wexts-app CLI. This will scaffold a complete full-stack application with all the best practices built-in.
npx wexts my-app
cd my-app
pnpm install
pnpm devProject Created!
http://localhost:3000 (frontend) and http://localhost:5050 (backend).Project Structure
After installation, your project will have the following structure:
1my-app/2├── apps/3│ ├── web/ # Next.js frontend4│ │ ├── app/5│ │ ├── components/6│ │ ├── features/7│ │ └── lib/8│ └── api/ # NestJS backend9│ ├── src/10│ ├── prisma/11│ └── test/12├── packages/13│ ├── ui/ # Shared UI components14│ ├── shared/ # Shared types & DTOs15│ └── config/ # Shared config16├── package.json17└── turbo.jsonKey Features Overview
RPC Auto-Linking
Call backend functions from your frontend with full type safety. No manual API definitions needed.
Powerful CLI
Generate components, services, and modules with a single command. Boost your productivity.
Type Safety
End-to-end TypeScript from database to UI. Catch errors at compile time, not runtime.
Modern Stack
Built with Next.js 16, React 19, NestJS 10. Always using the latest and greatest.
Creating Your First Endpoint
Let's create a simple endpoint to see how RPC auto-linking works. First, create a new service in your backend:
npx wexts generate service helloThis will create a new service file. Update it with your logic:
1import { Injectable } from '@nestjs/common';23@Injectable()4export class HelloService {5 async sayHello(name: string): Promise<string> {6 return `Hello, ${name}! Welcome to wexts.`;7 }8}Now you can call this from your frontend with full type safety:
1'use client';23import { useWexts } from '@/lib/wexts-client';45export default function Page() {6 const wexts = useWexts();78 const handleClick = async () => {9 // Fully typed! Your IDE knows about sayHello10 const result = await wexts.hello.sayHello('World');11 console.log(result); // "Hello, World! Welcome to wexts."12 };1314 return <button onClick={handleClick}>Say Hello</button>;15}Magic! ✨
Next Steps
Now that you have a basic understanding, explore these topics:
- Learn more about RPC Auto-Linking
- Explore the Fusion Insight GUI
- Check out the API Reference
- See complete examples
Need help? Join our Discord community or open an issue on GitHub.