A modern full-stack application built with TanStack Start featuring type-safe routing and server functions.
Discover other templates that might interest you based on similar technologies and use cases.
A full-featured real-time chat application built with Next.js and Prisma, showcasing Igniter.js's SSE-based real-time features for instant updates.
A full-featured application built using the latest Next.js conventions with end-to-end type safety powered by Igniter.js.
A full-stack, type-safe application with Bun and React featuring server-side rendering and unified runtime.
@felipebarcelospro
Fundador e Criador de Conteúdo na Vibe Dev | AI | Blockchain | Inteligência Artificial | Web3 | Startups | Crypto | SaaS | Micro-SaaS
Welcome to the Igniter.js starter for building full-stack, type-safe applications with TanStack Start. This template provides a modern, performant foundation for web applications, combining the power of Vite, file-based routing with TanStack Router, and an end-to-end type-safe API layer provided by Igniter.js.
Before you begin, ensure you have the following installed:
Follow these steps to get your project up and running:
Clone the Repository
git clone https://github.com/felipebarcelospro/igniter-js.git
cd igniter-js/apps/starter-tanstack-start
Install Dependencies
npm install
Configure Environment Variables
Create a .env
file in the root of this starter (igniter-js/apps/starter-tanstack-start/.env
) and add your database and Redis connection URLs:
# .env
DATABASE_URL="postgresql://user:password@localhost:5432/mydatabase?schema=public"
REDIS_URL="redis://127.0.0.1:6379"
Run Database Migrations
npx prisma db push
Run the Development Server
npm run dev
This command starts the Vite development server. Your application will be available at http://localhost:5173
.
This starter integrates an Igniter.js API backend directly into a TanStack Start application.
The connection point between TanStack Start and Igniter.js is a catch-all API route.
The back-end API logic is defined purely within the Igniter.js structure.
src/igniter.ts
)src/igniter.router.ts
)src/features/[feature]/controllers/
)Igniter.js automatically generates a type-safe client based on your API router.
api
object in src/igniter.client.ts
is your gateway to the back-end..useQuery()
, .useMutation()
) in your components to fetch and mutate data with full type safety.Example Client Component Usage:
// src/routes/index.tsx
'use client';
import { api } from '@/igniter.client';
export function Component() {
const { data, isLoading } = api.example.health.useQuery();
if (isLoading) return <div>Loading...</div>;
return (
<div>
<h1>Welcome to TanStack Start!</h1>
<p>API Status: {data?.status}</p>
</div>
);
}
The project combines TanStack Start's file-based routing with Igniter.js's feature-based API structure.
src/
├── components/ # Shared, reusable UI components
├── features/ # Business logic, grouped by feature
│ └── example/
│ └── controllers/ # API endpoint definitions
├── routes/ # TanStack Router: file-based routes
│ ├── api/
│ │ └── v1/
│ │ └── $.ts # Igniter.js API catch-all entry point
│ ├── __root.tsx # Root layout component
│ └── index.tsx # Component for the '/' route
├── services/ # Service initializations (Redis, Prisma, etc.)
├── igniter.ts # Igniter.js core instance
├── igniter.client.ts # Auto-generated type-safe API client
├── igniter.router.ts # Main API router
└── router.tsx # TanStack Router setup
npm run dev
: Starts the Vite development server.npm run build
: Builds the application for production.npm run start
: Starts the production server.This starter is licensed under the MIT License.