Skip to content

tariqul420/next-ts-starter

Repository files navigation

Next.js TypeScript Starter Template

Next.js TypeScript Starter

A modern, feature-rich Next.js starter template with TypeScript, built with best practices and developer experience in mind. This template provides a solid foundation for building scalable web applications with a focus on performance, security, and developer experience.

🌟 Why Choose This Template?

  • Production Ready: Built with best practices and optimized for production
  • Developer Experience: Excellent DX with TypeScript, ESLint, and Prettier
  • Modern Stack: Uses the latest features of Next.js 15 and React 19
  • Scalable: Well-organized project structure for growing applications
  • Secure: Built-in authentication and security best practices
  • Maintainable: Clean code architecture and comprehensive documentation

πŸš€ Features

Core Features

  • ⚑️ Next.js 15 with App Router
  • πŸ”₯ TypeScript for type safety
  • 🎨 Tailwind CSS for styling
  • πŸ” Clerk Authentication
  • πŸ“ TipTap Rich Text Editor
  • 🎯 Redux Toolkit for state management
  • 🎨 Radix UI Components
  • πŸŒ™ Dark/Light mode support
  • πŸ“± Responsive design
  • 🎯 ESLint & Prettier configuration
  • πŸš€ Turbopack for faster development

Advanced Features

  • πŸ”„ Server-side rendering (SSR)
  • πŸ“± Progressive Web App (PWA) ready
  • πŸ” SEO optimized
  • 🎯 Performance optimized
  • πŸ”’ Security best practices
  • πŸ“Š Analytics ready
  • 🌐 Internationalization ready
  • πŸ§ͺ Testing setup included

πŸ› οΈ Getting Started

Prerequisites

  • Node.js 18.17 or later
  • npm, yarn, or pnpm
  • Git

Installation

  1. Clone the repository:
git clone https://github.com/tariqul420/next-ts-starter.git
cd next-ts-starter
  1. Install dependencies:
npm install
# or
yarn install
# or
pnpm install
  1. Set up environment variables:
cp .env.example .env.local
  1. Update the .env.local file with your credentials:
# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_publishable_key
CLERK_SECRET_KEY=your_secret_key

# Database (if using)
DATABASE_URL=your_database_url

# Other configurations
NEXT_PUBLIC_APP_URL=http://localhost:3000

Development

Run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev

Open http://localhost:3000 with your browser to see the result.

Building for Production

npm run build
# or
yarn build
# or
pnpm build

Running Production Build

npm run start
# or
yarn start
# or
pnpm start

πŸ“ Project Structure

β”œβ”€β”€ app/                    # App router pages and layouts
β”‚   β”œβ”€β”€ (auth)/            # Authentication routes
β”‚   β”œβ”€β”€ (dashboard)/       # Dashboard routes
β”‚   β”œβ”€β”€ api/               # API routes
β”‚   └── layout.tsx         # Root layout
β”œβ”€β”€ components/            # Reusable UI components
β”‚   β”œβ”€β”€ ui/               # Basic UI components
β”‚   β”œβ”€β”€ forms/            # Form components
β”‚   └── shared/           # Shared components
β”œβ”€β”€ constant/             # Constants and configuration
β”œβ”€β”€ hooks/                # Custom React hooks
β”œβ”€β”€ lib/                  # Utility functions and libraries
β”œβ”€β”€ models/               # Database models
β”œβ”€β”€ public/               # Static assets
β”œβ”€β”€ types/                # TypeScript type definitions
└── ...

🎯 Key Features in Detail

Authentication

  • Clerk integration for secure authentication
  • Protected routes and API endpoints
  • User profile management
  • Social login support
  • Role-based access control

UI Components

  • Radix UI primitives for accessible components
  • Custom styled components with Tailwind CSS
  • Responsive design patterns
  • Dark/Light mode support
  • Loading states and animations

State Management

  • Redux Toolkit for global state
  • Local state with React hooks
  • Server state management
  • Persistent state with local storage
  • State synchronization

Rich Text Editor

  • TipTap integration
  • Custom extensions
  • Markdown support
  • Image upload
  • Code highlighting

πŸš€ Deployment

Vercel Deployment

  1. Push your code to GitHub
  2. Import your repository to Vercel
  3. Configure environment variables
  4. Deploy!

Other Platforms

  • Netlify
  • AWS Amplify
  • Digital Ocean
  • Heroku

πŸ“š Development Guidelines

Code Style

  • Follow TypeScript best practices
  • Use ESLint and Prettier
  • Write meaningful commit messages
  • Document your code

Git Workflow

  1. Create a new branch
  2. Make your changes
  3. Write tests
  4. Submit a pull request

Testing

  • Unit tests with Jest
  • Integration tests with Cypress
  • E2E tests with Playwright

πŸ”§ Troubleshooting

Common Issues

  1. Module not found

    npm install
    # or
    yarn install
  2. TypeScript errors

    npm run type-check
    # or
    yarn type-check
  3. Build errors

    npm run build
    # or
    yarn build

Performance Optimization

  • Use React.memo for expensive components
  • Implement code splitting
  • Optimize images
  • Use proper caching strategies

πŸ“š Learn More

Documentation

Community

🀝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

How to Contribute

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a pull request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘₯ Author

πŸ™ Acknowledgments


⭐️ If you like this project, please give it a star on GitHub!

πŸ“ž Support

If you need help or have questions, please:

  • Open an issue
  • Join our Discord community
  • Contact the maintainer

πŸ”„ Updates

Stay updated with the latest changes by:

  • Watching the repository
  • Following the author
  • Checking the releases page

Made with ❀️ by Tariqul Islam

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors