# ja_cli

**ja_cli** is a fast, developer-friendly CLI tool for scaffolding React projects with built-in best practices and a modern pastel gradient UI theme. It takes care of common project setup complexities, so you can focus on building features instead of boilerplate.

---

## Features

- One-step scaffolding – Create React projects instantly with curated defaults.  
- Pastel gradient UI – Stylish, modern design baked into templates.  
- Route protection – Includes `ProtectedRoute` and `AdminRoute` middleware for authentication-based routing. Only users with valid tokens can access protected pages.  
- Endpoint collections – Centralized API endpoints for simplified service calls.  
- Axios setup – Preconfigured Axios instance with interceptors for consistent API requests.  
- Notification helpers – Integrated with **SweetAlert (swal)** and **React-Toastify** for smooth user feedback and alerts.  
- Socket client – Built-in `socket.client.js` for seamless Socket.IO integration.  
- DataLake helper – Convenient storage utility for tokens, usernames, and other essential client-side data.  
- Helpers library – Pre-built utilities (`axios.js`, `notification.js`, `endpoints.js`, `dataLake.js`) to save development time.  

---

## Installation

Make sure you have [Node.js](https://nodejs.org/) installed.

Install `ja_cli` globally:

```bash
npm install -g ja_cli
```

Or run it directly via `npx`:

```bash
npx ja_cli
```

---

## Usage

Start scaffolding your React project with:

```bash
ja_cli
```

You’ll be guided through interactive prompts to choose project name, template type, and additional options (such as including a sample login page).

---

## Project Structure Highlights

A generated project comes with a production-ready folder setup:

```
src/
 ├── helpers/
 │   ├── axios.js          # Axios setup with interceptors
 │   ├── dataLake.js       # Utility for storing tokens, usernames, etc.
 │   ├── endpoints.js      # API endpoints collection
 │   └── notification.js   # SweetAlert + React-Toastify notifications
 │
 ├── middleware/
 │   ├── AdminRoute.jsx    # Restricts access to admin-only pages
 │   └── ProtectedRoute.jsx# Protects routes for authenticated users
 │
 ├── plugins/
 │   └── socket.client.js  # Socket.IO client integration
 │
 ├── routes/
 │   ├── AdminRoutes.jsx   # Admin-specific routes
 │   └── AppRoutes.jsx     # Main application routes
```

This structure ensures scalability, maintainability, and security from the start.

---

## Example Workflow

```bash
$ ja_cli
? Enter project name: my-awesome-app
? Choose project template: React + TailwindCSS
? Include sample login page? Yes
Creating project...
Installing dependencies...
Project setup complete!

Next steps:
cd my-awesome-app
npm start
```

---

## Contributing

Contributions are welcome.  
Open issues or submit pull requests to suggest new features, improve existing utilities, or enhance CLI performance.

---

## License

MIT License © 2025 Jay Tyagi

---

## Contact

For questions or support, contact: **jaytyagi08@gmail.com**
