DEV Community

buildlogmmd
buildlogmmd

Posted on

Starting a New Project with Next.js + TypeScript

๐Ÿงฑ 1. Create the project

npx create-next-app@latest your-project-name \ --typescript \ --app \ --tailwind \ --eslint \ --src-dir \ --import-alias "@/*" 
Enter fullscreen mode Exit fullscreen mode

This command sets up a modern and clean base including:

  • โœ… App Router
  • โœ… TypeScript support
  • โœ… TailwindCSS for styling
  • โœ… ESLint for clean code
  • โœ… src/ as root directory
  • โœ… @/ alias for cleaner imports

๐Ÿ“ 2. Suggested folder structure

/app โ† routes using App Router /src โ”œโ”€โ”€ components โ† reusable UI components โ”œโ”€โ”€ data โ† mock data โ”œโ”€โ”€ context โ† global state โ”œโ”€โ”€ hooks โ† reusable logic โ”œโ”€โ”€ types โ† TypeScript types โ””โ”€โ”€ styles โ† global styles /public โ””โ”€โ”€ images โ† local assets 
Enter fullscreen mode Exit fullscreen mode

๐Ÿงช 3. First commit

git init git add . git commit -m "chore: initialize Next.js app with TypeScript and Tailwind" 
Enter fullscreen mode Exit fullscreen mode

๐Ÿ’ก This setup is ready to scale. It works for MVPs, real-world products.

โœ๏ธ Part of my devlog at buildlogmmd โ€” clear structure, focused progress.

Top comments (0)