igniter-js

πŸ”₯ Igniter.js

The End-to-End Typesafe Full-stack TypeScript Framework

Built for Humans and Code Agents

[![npm version](https://img.shields.io/npm/v/@igniter-js/core.svg?style=flat)](https://www.npmjs.com/package/@igniter-js/core) [![TypeScript](https://img.shields.io/badge/TypeScript-5.0+-blue.svg)](https://www.typescriptlang.org/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Documentation](https://img.shields.io/badge/docs-igniterjs.com-brightgreen.svg)](https://igniterjs.com)

✨ What is Igniter.js?

Igniter.js is a modern, full-stack TypeScript framework that eliminates the friction between your backend and frontend. Define your API once, get fully-typed clients everywhereβ€”no code generation, no manual synchronization, just pure end-to-end type safety.

Perfect for building scalable APIs, real-time applications, and modern web services.

πŸš€ Quick Start

Get up and running in seconds:

# Create a new project
npx @igniter-js/cli@latest init my-app

# Or add to existing project
npm install @igniter-js/core zod

🎯 Key Features

πŸ“– Documentation & Resources

πŸ› οΈ Development

# Interactive development dashboard
npx @igniter-js/cli@latest dev

# Build your project
npm run build

# Run tests
npm test

🌟 Example

// Define your API
// features/users/controllers/users.controller.ts
export const userController = igniter.controller({
  path: '/users',
  actions: {
    getUser: igniter.query({
      path: '/:id' as const,
      handler: async ({ request, response, context, query }) => {
        const user = await context.db.user.findUnique({
          where: { id: input.id }
        });

        if (!user) {
          throw new Error('User not found');
        }

        return user;
      },
    }),
    createUser: igniter.muate({
      path: '/' as const,
      body: z.object({
        name: z.string(),
        email: z.string().email()
      })
      handler: async ({ request, response, context, query }) => {
        return await context.db.user.create({
          data: input
        });
      },
    }),
  }
})

// Use in your React app with full type safety
import { api } from './igniter.client';

function UserProfile({ userId }: { userId: string }) {
  const currentUser = api.user.getUser.useQuery({
    enabled: !!userId,
    staleTime: 5000,
    refetchOnWindowFocus: false,
    params: {
      id: userId
    },
    onSuccess: (data) => {
      console.log('Successfully fetched current user:', data);
    },
    onError: (error) => {
      console.error('Error fetching current user:', error);
    },
  });

  if (currentUser.isLoading) return <div>Loading user...</div>;
  if (currentUser.isError) return <div>Error to load user: {postsQuery.error.message}</div>;

  return (
    <div>
      <h1>{currentUser?.name}</h1>
      <p>{currentUser?.email}</p>
    </div>
  );
}

🀝 Community & Support

πŸ“„ License

MIT License - see the LICENSE file for details.


Made with ❀️ by the Igniter.js team

igniterjs.com β€’ GitHub β€’ npm