start-ui-web
๐ Start UI [web] is an opinionated UI starter from the ๐ป Beastudio Team with โ๏ธ Node.js, ๐ฆ TypeScript, โ๏ธ React, ๐ฆ TanStack Start, ๐จ Tailwind CSS, ๐งฉ shadcn/ui, ๐ React Hook Form, ๐ oRPC, ๐ Prisma, ๐ Better Auth, ๐ Storybook, ๐งช Vitest, ๐ญ Playwright
Top Related Projects
The React Framework
Set up a modern web app by running one command.
Next generation frontend tooling. It's fast!
RedwoodGraphQL
โก๏ธ The Missing Fullstack Toolkit for Next.js
The best way to start a full-stack, typesafe Next.js app
Quick Overview
Start UI Web is a comprehensive starter kit for building modern web applications. It provides a solid foundation with pre-configured tools and best practices, allowing developers to quickly set up and start working on their projects using React, Next.js, and TypeScript.
Pros
- Comes with a pre-configured setup, saving time on initial project configuration
- Includes essential tools and libraries like React Query, Chakra UI, and React Hook Form
- Implements best practices for code structure, testing, and accessibility
- Provides a scalable architecture suitable for both small and large projects
Cons
- May have a learning curve for developers unfamiliar with all the included technologies
- Some developers might find the opinionated structure limiting for certain project types
- Regular updates to the included libraries might require occasional maintenance
- The comprehensive nature of the starter kit could be overwhelming for beginners
Code Examples
- Using the custom
useToasthook for notifications:
import { useToast } from '@/components/Toast';
const MyComponent = () => {
const toast = useToast();
const handleClick = () => {
toast({
title: 'Success',
description: 'Action completed successfully',
status: 'success',
});
};
return <button onClick={handleClick}>Show Toast</button>;
};
- Implementing a protected route using the
withAuthHOC:
import { withAuth } from '@/features/auth';
const ProtectedPage = () => {
return <div>This page is protected and requires authentication</div>;
};
export default withAuth(ProtectedPage);
- Using the
useAccounthook to access user information:
import { useAccount } from '@/features/account';
const ProfileComponent = () => {
const { account, isLoading } = useAccount();
if (isLoading) return <div>Loading...</div>;
return (
<div>
<h1>Welcome, {account.firstName}</h1>
<p>Email: {account.email}</p>
</div>
);
};
Getting Started
To get started with Start UI Web, follow these steps:
-
Clone the repository:
git clone https://github.com/BearStudio/start-ui-web.git -
Install dependencies:
cd start-ui-web yarn install -
Set up environment variables:
cp .env.example .env.local -
Start the development server:
yarn dev -
Open your browser and navigate to
http://localhost:3000to see the application running.
Competitor Comparisons
The React Framework
Pros of Next.js
- More mature and widely adopted framework with extensive documentation and community support
- Built-in performance optimizations, including automatic code splitting and server-side rendering
- Seamless integration with Vercel's deployment platform for easy scaling and hosting
Cons of Next.js
- Steeper learning curve for developers new to React or server-side rendering concepts
- Less opinionated structure, requiring more setup and configuration for larger projects
- May introduce complexity for simple static websites that don't require advanced features
Code Comparison
Next.js:
import { useRouter } from 'next/router'
function ActiveLink({ children, href }) {
const router = useRouter()
const style = { color: router.asPath === href ? 'red' : 'black' }
return <a href={href} style={style}>{children}</a>
}
Start-UI-Web:
import { Link, useLocation } from 'react-router-dom'
function ActiveLink({ children, to }) {
const location = useLocation()
const isActive = location.pathname === to
return <Link to={to} className={isActive ? 'active' : ''}>{children}</Link>
}
Both examples show how to create an active link component, but Next.js uses its built-in routing system, while Start-UI-Web relies on React Router.
Set up a modern web app by running one command.
Pros of create-react-app
- Widely adopted and maintained by Facebook, ensuring long-term support and updates
- Extensive documentation and community resources available
- Simpler setup process with fewer initial configuration options
Cons of create-react-app
- Less opinionated structure, requiring more setup for advanced features
- Limited built-in TypeScript support compared to start-ui-web
- Fewer pre-configured tools and libraries out of the box
Code Comparison
start-ui-web:
import { Button } from '@chakra-ui/react';
import { useTranslation } from 'react-i18next';
export const MyComponent = () => {
const { t } = useTranslation();
return <Button>{t('common:submit')}</Button>;
};
create-react-app:
import React from 'react';
function App() {
return (
<div className="App">
<button>Submit</button>
</div>
);
}
export default App;
The start-ui-web example showcases built-in Chakra UI components and internationalization support, while create-react-app provides a more basic starting point for customization.
Next generation frontend tooling. It's fast!
Pros of Vite
- Faster build times and hot module replacement
- Lightweight and flexible, suitable for various project types
- Large ecosystem with extensive plugin support
Cons of Vite
- Less opinionated, requiring more setup for complex projects
- Smaller community compared to some established bundlers
- May have compatibility issues with older browsers without additional configuration
Code Comparison
Start-ui-web (Next.js configuration):
module.exports = {
reactStrictMode: true,
i18n: {
locales: ['en', 'fr'],
defaultLocale: 'en',
},
}
Vite (vite.config.js):
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react()],
})
Start-ui-web provides a more comprehensive boilerplate with pre-configured features like internationalization, while Vite offers a minimal configuration focused on fast development and building. Start-ui-web is built on Next.js, providing server-side rendering capabilities out of the box, whereas Vite is primarily a build tool that can be used with various frameworks, including React, Vue, and Svelte.
RedwoodGraphQL
Pros of GraphQL
- Integrated GraphQL support for efficient data fetching and manipulation
- Part of a full-stack framework (RedwoodJS) for seamless front-end and back-end development
- Strong typing system for improved code reliability and developer experience
Cons of GraphQL
- Steeper learning curve for developers new to GraphQL concepts
- Potentially more complex setup compared to REST-based approaches
- May introduce overhead for simple applications that don't require advanced data querying
Code Comparison
GraphQL query example:
query {
users {
id
name
email
}
}
Start-UI-Web API call example:
const response = await fetch('/api/users');
const users = await response.json();
Summary
GraphQL offers powerful data querying capabilities and is part of a comprehensive full-stack framework, making it suitable for complex applications. Start-UI-Web provides a more straightforward approach with REST-based APIs, which may be preferable for simpler projects or developers more familiar with traditional API structures. The choice between the two depends on project requirements, team expertise, and scalability needs.
โก๏ธ The Missing Fullstack Toolkit for Next.js
Pros of Blitz
- Full-stack framework with built-in authentication and database integration
- Zero-API approach, eliminating the need for separate API layer
- Stronger focus on scalability and enterprise-level applications
Cons of Blitz
- Steeper learning curve due to its comprehensive nature
- Less flexibility in choosing individual components or technologies
- Opinionated structure may not suit all project types
Code Comparison
Start-UI-Web (Next.js based):
import { NextPage } from 'next';
import { useTranslation } from 'react-i18next';
const HomePage: NextPage = () => {
const { t } = useTranslation();
return <h1>{t('home:title')}</h1>;
};
Blitz:
import { BlitzPage } from '@blitzjs/next';
import { useQuery } from '@blitzjs/rpc';
import getUsers from 'app/users/queries/getUsers';
const HomePage: BlitzPage = () => {
const [users] = useQuery(getUsers);
return <ul>{users.map(user => <li key={user.id}>{user.name}</li>)}</ul>;
};
Start-UI-Web focuses on providing a customizable starting point for web applications with Next.js, while Blitz offers a more opinionated, full-stack approach. Start-UI-Web allows for greater flexibility in choosing technologies and structuring the project, whereas Blitz provides a more integrated experience with built-in features like authentication and database access. The code comparison highlights the differences in data fetching and component structure between the two approaches.
The best way to start a full-stack, typesafe Next.js app
Pros of create-t3-app
- Offers a more opinionated and streamlined setup process for T3 stack projects
- Includes built-in TypeScript support and type safety out of the box
- Provides seamless integration with tRPC for type-safe API development
Cons of create-t3-app
- Less flexibility in terms of UI components and design system compared to start-ui-web
- May have a steeper learning curve for developers unfamiliar with the T3 stack
- Limited customization options for project structure and configuration
Code Comparison
start-ui-web:
import { Button } from '@chakra-ui/react';
export const MyComponent = () => (
<Button colorScheme="primary">Click me</Button>
);
create-t3-app:
import { Button } from '@trpc/react-query';
export const MyComponent = () => (
<Button variant="primary">Click me</Button>
);
Both repositories provide boilerplate code for React-based web applications, but they differ in their focus and included technologies. start-ui-web emphasizes a comprehensive UI toolkit with Chakra UI, while create-t3-app prioritizes type safety and full-stack development with the T3 stack. The code comparison shows the difference in UI component usage between the two projects.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
รฐยยย Start UI [web] is an opinionated frontend starter repository created & maintained by the BearStudio Team and other contributors. It represents our team's up-to-date stack that we use when creating web apps for our clients.
Technologies

รขยยรฏยธย Node.js, รฐยยยฆ TypeScript, รขยยรฏยธย React, รฐยยยฆ TanStack Start, รฐยยยจ Tailwind CSS, รฐยยงยฉ shadcn/ui, รฐยยย React Hook Form, รฐยยย oRPC, รฐยยย Prisma, รฐยยย Better Auth, รฐยยย Storybook, รฐยยงยช Vitest, รฐยยยญ Playwright
Documentation
For detailed information on how to use this project, please refer to the documentation. The documentation contains all the necessary information on installation, usage, and some guides.
Requirements
- Node.js >= 22
- pnpm
- Docker (or a PostgreSQL database)
Getting Started
pnpm create start-ui -t web myApp
That will scaffold a new folder with the latest version of รฐยยย Start UI [web] รฐยยย
Setup your IDE
- VS Code
cp .vscode/settings.example.json .vscode/settings.json
- Zed
cp .zed/settings.example.json .zed/settings.json
Installation
cp .env.example .env # Setup your env variables
pnpm install # Install dependencies
pnpm dk:init # Init docker
pnpm db:init # Init the db
[!NOTE] Quick advices for local development
- DON'T update the EMAIL_SERVER variable, because the default value will be used to catch the emails during the development.
Run
pnpm dk:start # Only if your docker is not running
pnpm dev
[!NOTE] Don't want to use docker?
Setup a PostgreSQL database (locally or online) and replace the DATABASE_URL environment variable. Then you can run
pnpm db:pushto update your database schema and then runpnpm db:seedto seed your database.
Emails in development
Maildev to catch emails
In development, the emails will not be sent and will be catched by maildev.
The maildev UI is available at 0.0.0.0:1080.
Preview emails
Emails templates are built with react-email components in the src/emails folder.
You can preview an email template at http://localhost:3000/api/dev/email/{template} where {template} is the name of the template file in the src/emails/templates folder.
Example: Login Code
Email translation preview
Add the language in the preview url like http://localhost:3000/api/dev/email/{template}?language={language} where {language} is the language key (en, fr, ...)
Email props preview
You can add search params to the preview url to pass as props to the template.
http://localhost:3000/api/dev/email/{template}/?{propsName}={propsValue}
Generate custom icons components from svg files
Put the custom svg files into the src/components/icons/svg-sources folder and then run the following command:
pnpm gen:icons
If you want to use the same set of custom duotone icons that Start UI is already using, checkout Phosphor
[!WARNING] All svg icons should be svg files prefixed by
icon-(example:icon-externel-link) with square size and filled with#000color (will be replaced bycurrentColor).
E2E Tests
E2E tests are setup with Playwright.
pnpm e2e # Run tests in headless mode, this is the command executed in CI
pnpm e2e:setup # Setup context to be used across test for more efficient execution
pnpm e2e:ui # Open a UI which allow you to run specific tests and see test execution
[!WARNING] The generated e2e context files contain authentication logic. If you make changes to your local database instance, you should re-run
pnpm e2e:setup. It will be run automatically in a CI context.
Production
pnpm install
pnpm storybook:build # Optional: Will expose the Storybook at `/storybook`
pnpm build
pnpm start
Show hint on development environments
Setup the VITE_ENV_NAME env variable with the name of the environment.
VITE_ENV_NAME="staging"
VITE_ENV_EMOJI="รฐยยยฌ"
VITE_ENV_COLOR="teal"
FAQ
git detect a lot of changes inside my .husky folder
You probably have updated your branch with lefthook installed instead of husky. Follow these steps to fix your hooks issue:
git config --unset core.hooksPathrm -rf ./.huskypnpm install
From now husky should have been removed; and lefthook should run your hooks correctly.
Top Related Projects
The React Framework
Set up a modern web app by running one command.
Next generation frontend tooling. It's fast!
RedwoodGraphQL
โก๏ธ The Missing Fullstack Toolkit for Next.js
The best way to start a full-stack, typesafe Next.js app
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot