A modern, production-ready Next.js starter template with TypeScript, styled-components, and a comprehensive component library.
- Next.js 15+ with TypeScript
- Styled Components for styling
- Pre-built reusable components (Button, Modal, TextInput, Tabs, Spinner)
- Custom hooks library
- Theme system
- Jest testing setup
- ESLint + Prettier configuration
- Organized folder structure
- Node.js 18+
- Yarn 4.7.0 or npm
- Clone the repository:
git clone <repository-url>
cd framework-template- Install dependencies:
yarn install
# or
npm install- Create environment variables file:
cp .env.example .env.local- Run the development server:
yarn dev
# or
npm run devOpen http://localhost:3000 in your browser to see the result.
framework-template/
├── public/ # Static assets
├── src/
│ ├── components/ # Reusable UI components
│ ├── hooks/ # Custom React hooks
│ ├── layouts/ # Layout components
│ ├── pages/ # Next.js pages
│ │ └── api/ # API routes
│ ├── services/ # API services and external integrations
│ ├── utils/ # Utility functions
│ ├── constants/ # App constants and configuration
│ ├── types/ # TypeScript type definitions
│ ├── lib/ # Shared libraries
│ └── theme/ # Theme configuration
├── .eslintrc.js # ESLint configuration
├── .prettierrc # Prettier configuration
├── jest.config.js # Jest configuration
├── next.config.ts # Next.js configuration
└── tsconfig.json # TypeScript configuration
yarn dev- Start development serveryarn build- Build for productionyarn start- Start production serveryarn lint- Run ESLintyarn test- Run tests
import { Button } from '@/components';
<Button variant="primary" onClick={handleClick}>
Click me
</Button>import { Modal } from '@/components';
<Modal isOpen={isOpen} onClose={handleClose}>
Modal content
</Modal>import { TextInput } from '@/components';
<TextInput
placeholder="Enter text..."
value={value}
onChange={handleChange}
/>import { Tabs } from '@/components';
<Tabs tabs={[
{ label: 'Tab 1', content: <div>Content 1</div> },
{ label: 'Tab 2', content: <div>Content 2</div> }
]} />import { Spinner } from '@/components';
<Spinner size="large" />This project uses styled-components for styling. Theme configuration can be found in src/theme/.
Run tests with:
yarn testMIT