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)