Every React team eventually runs into this:
- Different folder structures across developers
- Inconsistent naming conventions
- Missing test files
- Rewriting the same boilerplate again and again
And code reviews filled with:
โMove this fileโ
โRename this properlyโ
โWhere is the test?โ
At some point, I realized:
โ We donโt have a coding problem
โ We have a standardization problem
๐ฃ Why This Actually Hurts
This slows teams down more than we think:
- ๐ซ New developers take longer to onboard
- ๐งฉ Codebases become inconsistent
- ๐ Same feedback in every PR
- โณ Time wasted on setup instead of logic
๐ก So I Built Something
I created rgenex โ a config-driven React code generator CLI.
Define your structure once โ generate consistent code across your team automatically
๐ฌ See It in Action
๐ฆ Install
โ๏ธ Initialize Project
๐งฉ Generate Component
โก Getting Started (Takes < 1 minute)
1. Install
npm install --save-dev rgenex
2. Initialize
npx rgenex init
3. Generate
npx rgenex g component Button
๐ง The Core Idea
The real power of rgenex lies in how you use the rgenex.config.js file.
This file acts as the single source of truth for how your project should be structured.
๐งฉ Define your rules once in rgenex.config.js
๐ Enforce them automatically across your entire team
How it works:
You define your preferred language, styling, and testing setup
You specify where different types of files should live (components, hooks, pages, etc.)
You configure how each generator should behave (structure, test files, styles, etc.)
Once this is set up:
๐ Every time someone runs a generator command, rgenex follows these rules
๐ No manual decisions, no inconsistencies
This means:
โ
Every component follows the same structure
โ
Every file is placed in the correct location
โ
Every developer generates code in the same way
Instead of relying on conventions that people forgetโฆ
You enforce them automatically through configuration.
Example:
module.exports = {
language: "typescript",
styling: "scss-modules",
testing: "vitest",
paths: {
components: "src/components",
pages: "src/pages",
hooks: "src/hooks",
},
generators: {
component: {
structure: "grouped",
includeTest: true,
includeStyle: true,
},
},
};
โจ What You Get
- โก Instant scaffolding (components, hooks, pages)
- ๐งช Auto-generated test files
- ๐จ Styling support (SCSS, Tailwind, CSS)
- ๐ง Smart project detection
- ๐ฆ Zero production impact
๐ฏ Why I Built This
Iโve worked on projects where:
- Everyone had a different way of structuring files
- Boilerplate was repeated constantly
- Code reviews focused on structure instead of logic
I wanted something that:
- Enforces standards automatically
- Saves time
- Improves developer experience
๐ Try It Out
npm install --save-dev rgenex
๐ GitHub: https://github.com/asengar14/rgenex
๐ npm: https://www.npmjs.com/package/rgenex
๐ฎ Whatโs Coming Next
- Custom generators (services, APIs, etc.)
- Interactive CLI
- Plugin system
- More flexibility in templates
๐ค Would Love Your Feedback
If you try it:
- What worked well?
- Whatโs missing?
- What would make it more useful for your team?
๐ Final Thought
We spend most of our time writing logic.
But a surprising amount of time goes into:
๐ Creating files
๐ Setting up folders
๐งฑ Maintaining structure
If we automate thatโฆ
We can focus on what actually matters.
โจ Built with โค๏ธ by Aditya Singh Sengar



Top comments (0)