Complete Documentation

Get Started
in 5 Minutes

Everything you need to build production-ready applications with NATIWO Core.

Quick Start

1Install Packages

# Install core packages
pnpm add @natiwo/database @natiwo/api @natiwo/auth

# Install optional packages as needed
pnpm add @natiwo/cache @natiwo/queue @natiwo/storage

2Configure Database

// src/database.ts
import { getPrismaClient } from '@natiwo/database';

export const db = getPrismaClient({
  datasources: {
    db: {
      url: process.env.DATABASE_URL,
    },
  },
  log: ['query', 'error', 'warn'],
});

3Create tRPC Router

// src/routers/user.router.ts
import { createTRPCRouter, publicProcedure } from '@natiwo/api';
import { db } from '../database';

export const userRouter = createTRPCRouter({
  list: publicProcedure.query(async () => {
    return db.user.findMany();
  }),

  getById: publicProcedure
    .input(z.object({ id: z.string() }))
    .query(async ({ input }) => {
      return db.user.findUnique({
        where: { id: input.id },
      });
    }),
});

4Use in Frontend

// app/users/page.tsx
import { trpc } from '@/lib/trpc';

export default function UsersPage() {
  const { data: users } = trpc.user.list.useQuery();

  return (
    <div>
      {users?.map(user => (
        <div key={user.id}>{user.name}</div>
      ))}
    </div>
  );
}

That's it! You now have a fully type-safe API from database to UI.

Explore the Docs

Guides

Step-by-step guides for common tasks and workflows.

Coming Soon →

API Reference

Complete API documentation for all packages.

Coming Soon →

CLI Tools

Command-line tools for scaffolding and code generation.

Coming Soon →