aadarsh-nextjs-starter
v1.0.2
Published
A CLI tool to create Next.js 14 projects with TailwindCSS, utilities, and developer tools
Maintainers
Readme
🚀 Aadarsh Next.js Starter
A CLI tool to create Next.js 14 projects with modern tools and utilities for rapid development.
✨ Features
- Next.js 14 with App Router
- TailwindCSS for styling
- Custom Fonts (Geist Sans & Mono)
- React Hot Toast with custom styling
- Axios for API calls
- Developer Tools:
FrontendStatescomponent for debugging- Comprehensive utility functions
- API error handling
- Path Aliases (
@/*imports) - Environment Variables setup
🚀 Quick Start
Create a new project:
npx aadarsh-nextjs-starter my-awesome-project
cd my-awesome-project
npm run devOr install globally:
npm install -g aadarsh-nextjs-starter
aadarsh-nextjs-starter my-awesome-project📁 Project Structure
src/
├── app/
│ ├── layout.js # Root layout with toast setup
│ ├── page.js # Home page
│ └── globals.css # Global styles
├── components/
│ └── FrontendStates.jsx # State debugging component
├── lib/
│ └── utils.js # Utility functions
└── fac/
└── fac.js # API configuration🛠️ Utilities Included
FrontendStates Component
import FrontendStates from "@/components/FrontendStates";
const MyComponent = () => {
const [user, setUser] = useState({ name: "John", age: 25 });
return (
<div>
<FrontendStates states={{ user, count: 5 }} />
</div>
);
};API Utilities
import { handleApiResponseWithToast, cn } from "@/lib/utils";
// For client-side API calls
try {
const response = await axios.get("/api/users");
handleApiResponseWithToast(response.data);
} catch (error) {
handleApiErrorWithToast(error);
}
// Conditional classnames
const buttonClass = cn("btn", { "btn-active": isActive });🔧 Environment Variables
Create .env.local:
NEXT_PUBLIC_BACKEND_URL=http://localhost:8000📜 Scripts
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint
🤝 Contributing
Feel free to submit issues and enhancement requests!
📄 License
MIT License - see LICENSE file for details.
