create-feature-router
Version:
A CLI tool to scaffold a react-router project with any mode and a feature driven folder approach
129 lines (113 loc) β’ 3.58 kB
Markdown
for initializing a react-router app with any of the modes, and also a project scaffolding which conforms to the screaming arachitecture. A Feature based project skeleton just enough for you to get started.
<br>ποΈInitialize a React Router Project with any of the modes: Declarative | Data | Framework. <br>
<br>π¦ Built-in Feature Driven boilerplate with nice UIs<br>
<br>π§© Component templates following best practices<br>
<br>π¨ Tailwind CSS styling integration<br>
Create New Project
```
npx create-feature-router my-app
pnpm dlx create-feature-router my-app
bunx create-feature-router my-app
```
Select the React Router mode you would like to initalize the project with and follow the remaining prompts.
```
src/
βββ assets/
β βββ icons/
β β βββ index.ts
β β βββ magnifying-glass.tsx
βββ config/
β βββ constants/
β βββ auth/
βββ features/
β βββ auth/
β β βββ login.tsx
β β βββ use-login.tsx
β βββ shared/
| β βββ providers
β β β βββ app-context.tsx
β β βββ layout
β β β βββ layout.tsx
β βββ base/
β β βββ layout.tsx
βββ ui/
β βββ button/
β βββ drawer/
βββ lib/
β βββ utils/
βββ routes.ts
```
```
app/
βββ assets/
β βββ icons/
β β βββ index.ts
β β βββ magnifying-glass.tsx
βββ config/
β βββ constants/
β βββ auth/
βββ features/
β βββ auth/
β β βββ login.tsx
β β βββ use-login.tsx
β βββ shared/
| β βββ providers
β β β βββ app-context.tsx
β β βββ layout
β β β βββ layout.tsx
β βββ base/
β β βββ layout.tsx
βββ ui/
β βββ button/
β βββ drawer/
βββ lib/
β βββ utils/
βββ entry-client.ts
βββ root.tsx
βββ routes.ts
```
Pre-configured to adapt to any react router mode selected.
For framework mode, ssr is auto set as true, to turn off
Set it to false in the react-router.config.ts
use-login.tsx: Simple hook with login functionality
Flexible layout.tsx with navbar and footer
Extensible for different layout types
The generated project includes:
@tanstack/react-query
axios
tailwindcss (optional)
```json
{
"dependencies": {
"@tanstack/react-query": "^5.81.5",
"axios": "^1.6.0"
},
"devDependencies": {
"tailwindcss": "^4.1.x"
}
}
```
To contribute to this package:
Clone the repository
Install dependencies
Link for local development
Samuel Affah, Daramfon
Github: sam-c14
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
If you found this package helpful, please give it a βοΈ on GitHub!
A cli tool