
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-file-structure-kit
Advanced tools
A CLI tool to set up organized file structure and initial code for React Vite projects
A modern CLI tool that sets up organized file structure and initial code for React Vite projects. This package helps you quickly add a well-organized folder structure and pre-written components to your existing Vite React project.
npm install -g react-file-structure-kit
npm install react-file-structure-kit
First, create a Vite React project using the official Vite command:
npm create vite@latest my-app -- --template react
# or for TypeScript
npm create vite@latest my-app -- --template react-ts
Navigate to your project directory and run:
cd my-app
setup-react-structure
This will automatically detect if your project is TypeScript or JavaScript and set up the appropriate file structure.
setup-react-structure --yes
This will use default settings and set up the file structure immediately.
The CLI supports the following options:
The tool automatically detects:
src/
├── components/
│ ├── common/
│ │ ├── Button.tsx
│ │ ├── Card.tsx
│ │ └── index.ts
│ └── layout/
│ ├── Navbar.tsx
│ ├── Footer.tsx
│ ├── Layout.tsx
│ └── index.ts
├── pages/
│ ├── Home/
│ │ └── HomePage.tsx
│ ├── About/
│ │ └── AboutPage.tsx
│ ├── Contact/
│ │ └── ContactPage.tsx
│ └── index.ts
├── routes/
│ └── index.ts
├── hooks/
│ ├── useLocalStorage.ts
│ ├── useDebounce.ts
│ └── index.ts
├── utils/
│ ├── helpers.ts
│ ├── constants.ts
│ └── index.ts
├── services/
│ └── api.ts
├── types/
│ └── index.ts
├── assets/
│ └── styles/
│ └── globals.css
├── App.tsx
└── main.tsx
Note: File extensions will be .tsx/.ts for TypeScript projects and .jsx/.js for JavaScript projects.
The generator creates several pre-built components:
# For JavaScript
npm create vite@latest my-app -- --template react
# For TypeScript
npm create vite@latest my-app -- --template react-ts
cd my-app
npm install
# Install the file structure kit
npm install -g react-file-structure-kit
# Run the setup
setup-react-structure
npm install
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLint
The generated file structure includes:
The package adds the following to your existing Vite React project:
react-router-dom - For client-side routingreact-icons - For beautiful icons@types/react-router-dom - TypeScript types for React Router.env - Environment variables template.env.example - Example environment file# Create a TypeScript Vite project
npm create vite@latest my-ts-app -- --template react-ts
cd my-ts-app
npm install
# Install and run the file structure kit
npm install -g react-file-structure-kit
setup-react-structure
# Create a JavaScript Vite project
npm create vite@latest my-js-app -- --template react
cd my-js-app
npm install
# Install and run the file structure kit
npm install -g react-file-structure-kit
setup-react-structure
setup-react-structure --yes
After running the setup, you can:
src/components/layout/ and src/components/common/src/pages/ and update routes in src/routes/index.tssrc/assets/styles/globals.css for global stylesvite.config.ts for build customizationsrc/services/src/types/ (TypeScript projects only)src/hooks/src/utils/If you want to modify the file structure kit itself:
src/templates.ts and add new template functionsupdatePackageJson function in src/generator.tssrc/cli.ts to add new command optionsContributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions, please:
You can learn more in the Vite documentation.
To learn React, check out the React documentation.
For TypeScript, visit the TypeScript documentation.
Happy Coding! 🎉
FAQs
A CLI tool to set up organized file structure and initial code for React Vite projects
We found that react-file-structure-kit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.