A tool to generate custom Node.js/Express backend projects with predefined templates.
backendDirectory.generator.mp4
- Simple Form Interface: Easy-to-use React frontend for configuring backend components
- Customizable Structure: Generate backends with custom directory and file names
- Template-Based: Uses predefined templates for controllers, models, middleware, routes, schemas, and utilities
- ZIP Download: Automatically packages and downloads the generated backend as a ZIP file
Backend-Generator/
├── backend/ # Node.js backend server
│ ├── server.js # Express server setup
│ ├── routes/generate.js # ZIP generation endpoint
│ └── readBackend/ # Template source files
│ ├── controllers/ # Controller templates
│ ├── Models/ # Model and schema templates
│ ├── middleware/ # Middleware templates
│ ├── routes/ # Route templates
│ └── utils.js # Utility functions
├── frontend/ # React application
│ ├── src/components/ # Form component
│ └── package.json # Frontend dependencies
- Node.js (v16 or higher)
- npm or yarn
-
Clone the repository
git clone <repository-url> cd Backend-Generator
-
Install backend dependencies
cd backend npm install -
Install frontend dependencies
cd ../frontend npm install
-
Start the backend server
cd backend npm startThe backend will run on
http://localhost:3000 -
Start the frontend development server
cd frontend npm run devThe frontend will run on
http://localhost:5173 -
Open your browser and navigate to
http://localhost:5173
- Enter Directory Name: Provide a name for your main backend directory
- Configure Components: Fill in the names for:
- Controller
- Middleware
- Model
- Schema
- Utility
- Generate Backend: Click the "Generate & Download Backend" button
- Download: The application will automatically download a ZIP file containing your backend structure
The generated backend will include:
your-project-name/
├── controllers/
│ └── [controllerName].js
├── middleware/
│ └── [middlewareName].js
├── Models/
│ ├── [modelName].js
│ └── schemas/
│ └── [schemaName].js
├── routes/
│ └── [routeName].js
├── utils/
│ └── [utilName].js
├── package.json
├── package-lock.json
└── config.js
- Express.js: Web framework
- Mongoose: MongoDB ODM
- JWT: Authentication
- bcrypt: Password hashing
- archiver: ZIP file creation
- CORS: Cross-origin resource sharing
- React: UI library
- TypeScript: Type safety
- Vite: Build tool
- TailwindCSS: Styling
- Axios: HTTP client
- Lucide React: Icons
POST /generate: Generates and downloads a ZIP file with the backend structure
{
"directoryName": "string",
"controllerFileName": "string",
"middlewareFileName": "string",
"modelFileName": "string",
"routeFileName": "string",
"schemaFileName": "string",
"utilFileName": "string"
}- The backend uses Express.js with a modular structure
- Templates are stored in
backend/readBackend/ - The generate route creates ZIP files using the archiver library
- Built with React and TypeScript
- Uses Vite for fast development
- Styled with TailwindCSS
- Form validation and error handling included
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the ISC License.