files-structure-generator
Advanced tools
Comparing version
{ | ||
"name": "files-structure-generator", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "A utility to generate a predefined file and folder structure from a JSON configuration.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
143
README.md
@@ -1,8 +0,14 @@ | ||
JSON Template Files | ||
A collection of JSON templates to streamline your project setup! Each template offers a well-structured mix of files and folders commonly used in various project types. | ||
Templates Overview | ||
๐ Template 1: Basic Project Structure (template1.json) | ||
json | ||
Copy code | ||
# files-structure-generator | ||
**JSON Template Files** | ||
*A collection of JSON templates to streamline your project setup!* | ||
Each template offers a well-structured mix of files and folders commonly used in various project types. | ||
--- | ||
## ๐ Templates Overview | ||
### ๐ Template 1: Basic Project Structure (`template1.json`) | ||
```json | ||
{ | ||
@@ -13,8 +19,11 @@ "src": {}, | ||
} | ||
src: Main source code directory. | ||
hello: Example directory. | ||
hii: Example directory. | ||
๐ Template 2: Application Structure (template2.json) | ||
json | ||
Copy code | ||
``` | ||
- **`src`**: Main source code directory. | ||
- **`hello`**: Example directory. | ||
- **`hii`**: Example directory. | ||
--- | ||
### ๐ Template 2: Application Structure (`template2.json`) | ||
```json | ||
{ | ||
@@ -35,8 +44,11 @@ "app": { | ||
} | ||
app: Main application directory with main.js and a config subfolder containing config.js. | ||
components: Reusable components directory, including header.js and footer.js. | ||
services: Service layer with api.js for external APIs. | ||
๐จ Template 3: Static Assets and Styling (template3.json) | ||
json | ||
Copy code | ||
``` | ||
- **`app`**: Main application directory with `main.js` and `config.js`. | ||
- **`components`**: Reusable components (e.g., `header.js`, `footer.js`). | ||
- **`services`**: Service layer for APIs with `api.js`. | ||
--- | ||
### ๐จ Template 3: Static Assets and Styling (`template3.json`) | ||
```json | ||
{ | ||
@@ -56,8 +68,11 @@ "assets": { | ||
} | ||
assets: Directory for static assets with images and fonts subfolders. | ||
styles: CSS/SCSS files directory, including main.css and theme.css. | ||
scripts: JavaScript files, with app.js and utils.js for application logic. | ||
๐ง Template 4: Configuration and Environment (template4.json) | ||
json | ||
Copy code | ||
``` | ||
- **`assets`**: Directory for images and fonts. | ||
- **`styles`**: CSS/SCSS files (`main.css`, `theme.css`). | ||
- **`scripts`**: JavaScript files for app logic (`app.js`, `utils.js`). | ||
--- | ||
### ๐ง Template 4: Configuration and Environment (`template4.json`) | ||
```json | ||
{ | ||
@@ -77,8 +92,11 @@ "config": { | ||
} | ||
config: Configuration files, including default.json and production.json. | ||
env: Environment settings, with .env and .env.example files. | ||
logs: Log directory, including app.log and error.log. | ||
๐ Template 5: Web Application Essentials (template5.json) | ||
json | ||
Copy code | ||
``` | ||
- **`config`**: Configuration files (`default.json`, `production.json`). | ||
- **`env`**: Environment files (`.env`, `.env.example`). | ||
- **`logs`**: Log files (`app.log`, `error.log`). | ||
--- | ||
### ๐ Template 5: Web Application Essentials (`template5.json`) | ||
```json | ||
{ | ||
@@ -98,8 +116,11 @@ "public": { | ||
} | ||
public: Directory for public assets, with index.html and favicon.ico. | ||
views: HTML templates, including home.html and about.html. | ||
routes: JavaScript route definitions with index.js and api.js. | ||
๐๏ธ Template 6: Model-Controller-Middleware (template6.json) | ||
json | ||
Copy code | ||
``` | ||
- **`public`**: Public assets (`index.html`, `favicon.ico`). | ||
- **`views`**: HTML templates (`home.html`, `about.html`). | ||
- **`routes`**: JavaScript route files (`index.js`, `api.js`). | ||
--- | ||
### ๐๏ธ Template 6: Model-Controller-Middleware (`template6.json`) | ||
```json | ||
{ | ||
@@ -119,8 +140,11 @@ "models": { | ||
} | ||
models: Database models with user.js and product.js. | ||
controllers: Controller logic for userController.js and productController.js. | ||
middlewares: Middleware functions, including auth.js and errorHandler.js. | ||
๐งช Template 7: Testing Structure (template7.json) | ||
json | ||
Copy code | ||
``` | ||
- **`models`**: Database models (`user.js`, `product.js`). | ||
- **`controllers`**: Controllers (`userController.js`, `productController.js`). | ||
- **`middlewares`**: Middleware functions (`auth.js`, `errorHandler.js`). | ||
--- | ||
### ๐งช Template 7: Testing Structure (`template7.json`) | ||
```json | ||
{ | ||
@@ -138,14 +162,27 @@ "tests": { | ||
} | ||
tests: Main testing directory. | ||
unit: Unit tests, with user.test.js and product.test.js. | ||
integration: Integration tests, with userIntegration.test.js and productIntegration.test.js. | ||
Usage | ||
Choose a template, copy its structure into your structure.json file, then run: | ||
``` | ||
- **`tests`**: Main testing directory. | ||
- **`unit`**: Unit tests (`user.test.js`, `product.test.js`). | ||
- **`integration`**: Integration tests (`userIntegration.test.js`, `productIntegration.test.js`). | ||
bash | ||
Copy code | ||
npm run generate | ||
This command will create the files and folders according to your structure.json configuration. | ||
--- | ||
License | ||
This project is licensed under the MIT License. | ||
## ๐ Usage | ||
1. **Choose a template**: Select the appropriate template for your project. | ||
2. **Add to `structure.json`**: Copy the structure of the template you chose into your `structure.json` file. | ||
3. **Run command**: | ||
```bash | ||
npm run generate | ||
``` | ||
This command will create files and folders based on your `structure.json` configuration. | ||
--- | ||
## ๐ License | ||
This project is licensed under the [MIT License](./LICENSE). | ||
--- | ||
> **Note**: Feel free to modify these templates to suit your specific project requirements. |
6616
3.42%182
26.39%