A full-stack, type-safe application with Bun and React featuring server-side rendering and unified runtime.
Discover other templates that might interest you based on similar technologies and use cases.
A full-featured application built using the latest Next.js conventions with end-to-end type safety powered by Igniter.js.
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 modern full-stack application built with TanStack Start featuring type-safe routing and server functions.
@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 Bun and React. This template provides a solid foundation for creating modern, high-performance web applications with an end-to-end type-safe API layer.
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-bun-react-app
Install Dependencies
bun install
Configure Environment Variables
Create a .env
file in the root of this starter (igniter-js/apps/starter-bun-react-app/.env
) and add your Redis connection URL:
# .env
REDIS_URL="redis://127.0.0.1:6379"
Run the Development Server
bun run dev
This command starts the Bun server with hot-reloading enabled. Your application will be available at http://localhost:3000
.
This starter combines a Bun server, a React front-end, and an Igniter.js API into a single, cohesive application.
src/index.tsx
)The src/index.tsx
file is the main entry point. It uses Bun's native serve
function to handle incoming requests.
/api/v1/*
are forwarded to the Igniter.js API router.index.html
file, allowing the React application to handle client-side routing.src/igniter.router.ts
)The back-end API is defined using Igniter.js.
src/igniter.ts
)src/igniter.router.ts
)src/features/example/controllers/example.controller.ts
)src/app/
)The user interface is a standard React application.
src/app/_app.tsx
)src/app/Home.tsx
)src/components/ui
)src/igniter.client.ts
)Igniter.js automatically generates a type-safe client based on your API router definition.
api
object in src/igniter.client.ts
is your gateway to the back-end.The project follows a feature-based architecture to promote scalability and separation of concerns.
src/
├── app/ # Core React application components (Pages)
├── components/ # Shared, reusable UI components
├── features/ # Business logic, grouped by feature
│ └── example/
│ ├── controllers/ # API endpoint definitions
│ └── presentation/ # Feature-specific React components/hooks
├── lib/ # Utility functions
├── services/ # Service initializations (Redis, Prisma, etc.)
├── igniter.ts # Igniter.js core instance
├── igniter.client.ts # Auto-generated type-safe API client
├── igniter.context.ts # Application context definition
├── igniter.router.ts # Main API router
└── index.tsx # Application entry point (Bun server)
bun run dev
: Starts the development server with hot-reloading.bun run start
: Starts the application in production mode.bun run build
: Builds the application for production deployment.To learn more about Igniter.js and its powerful features, check out the official documentation:
This starter is licensed under the MIT License.