CLI tool that monitors and evaluates the file structure of a directory and its subdirectories to enforce a specific file structure pattern for a particular programming language
Ubuntu.20.04.on.Windows.2023-10-29.18-38-29.mp4
π Note: The structure.json
file should be placed in the project directory.
84146a28-f2a6-4c25-b2b0-b93fe91afa22.mp4
Example structure.json file
// structure.json
{
"IgnoreDir": {
".git",
"node_modules",
".next",
},
"RootFiles": {
"package.json",
"package-lock.json",
"tailwind.config.js",
"tailwind.config.ts",
"tsconfig.json",
"tslint.json",
"webpack.config.js",
"yarn.lock",
"postcss.config.js",
".eslintrc.json",
"LICENSE",
"README.md",
"CODE_OF_CONDUCT.md",
".env",
".env.local",
".gitignore",
"app.js",
},
"RootDirs": {
"public",
"src",
"tests",
"config",
"typings",
},
"NonRootFiles": {
// JS
"config/database.js",
"config/routes.js",
"config/environment.js",
// TS
"config/constants.ts",
"config/routes.ts",
},
"NonRootDirs": {
// JS
"src/controllers",
"src/models",
"src/routes",
"src/views",
// TS
"src/components",
"src/containers",
"src/services",
"src/styles",
"src/assets",
"config/env",
"config/",
},
"DirectoryFileExtensions": {
"public": {
".html":true,
".js":true,
".css":true,
},
"src": {
".ts":true,
},
},
}
Javascript and Typescript (node.js)
my-node-app/
βββ node_modules/ (Dependencies installed via npm)
βββ public/ (Static files like HTML, CSS, client-side JavaScript)
βββ src/ (Source code)
β βββ controllers/ (Route handlers)
β βββ models/ (Database models)
β βββ routes/ (Express.js route definitions)
β βββ views/ (Template files, if using a template engine)
βββ config/ (Configuration files)
β βββ database.js (Database configuration)
β βββ routes.js (Route configuration)
β βββ environment.js (Environment-specific settings)
βββ tests/ (Test files)
βββ package.json (Node.js package configuration)
βββ package-lock.json (Dependency lock file)
βββ .gitignore (Git ignore rules)
βββ .env (Environment variables, not in version control)
βββ app.js (Main application file)
βββ README.md (Documentation)
my-typescript-project/
βββ node_modules/ (Dependencies installed via npm or yarn)
βββ src/ (Source code)
β βββ components/ (Reusable UI components)
β βββ containers/ (Higher-level components that manage state)
β βββ services/ (API services, utilities, and helpers)
β βββ styles/ (CSS or SCSS files)
β βββ assets/ (Static assets like images)
βββ public/ (Publicly accessible files, e.g., index.html)
βββ tests/ (Test files)
βββ config/ (Configuration files)
β βββ env/ (Environment-specific configuration)
β βββ constants.ts (Application constants)
β βββ routes.ts (Route definitions)
βββ typings/ (Custom type definitions, if needed)
βββ .gitignore (Git ignore rules)
βββ tsconfig.json (TypeScript configuration)
βββ package.json (Node.js package configuration)
βββ package-lock.json (Dependency lock file)
βββ README.md (Documentation)
Go (Web app)
my-go-web-app/
βββ assets/ (Static assets like CSS, JavaScript, and images)
βββ templates/ (HTML templates if not using a frontend framework)
βββ cmd/ (Application entry points)
β βββ main.go (Main application entry point)
βββ internal/ (Internal application packages)
β βββ handlers/ (HTTP request handlers)
β βββ models/ (Data models)
β βββ middleware/ (HTTP middleware)
β βββ config/ (Application configuration)
βββ pkg/ (Reusable packages)
βββ vendor/ (Vendor directory for dependencies - if not using Go Modules)
βββ go.mod (Go module file)
βββ go.sum (Dependency checksum file)
βββ .gitignore (Git ignore rules)
βββ README.md (Documentation)
Go (CLI)
my-go-cli/
βββ cmd/ (Application entry points)
β βββ mycli/ (CLI application source code)
β β βββ main.go (Main CLI application entry point)
βββ internal/ (Internal application packages)
βββ pkg/ (Reusable packages)
βββ vendor/ (Vendor directory for dependencies - if not using Go Modules)
βββ go.mod (Go module file)
βββ go.sum (Dependency checksum file)
βββ .gitignore (Git ignore rules)
βββ README.md (Documentation)
PHP (Web app)
my-php-web-app/
βββ app/
β βββ Controllers/ (Controller classes)
β βββ Models/ (Model classes)
β βββ Views/ (View templates)
βββ config/ (Application configuration)
β βββ database.php (Database configuration)
βββ public/ (Publicly accessible files, e.g., index.php, assets)
βββ resources/ (Non-public resources like language files or raw assets)
βββ routes/ (Route definitions)
βββ tests/ (Test files)
βββ vendor/ (Composer dependencies)
βββ .env (Environment-specific settings)
βββ .gitignore (Git ignore rules)
βββ composer.json (Composer configuration)
βββ composer.lock (Composer lock file)
βββ README.md (Documentation)
Lua (Neovim plugin)
my-neovim-plugin/
βββ plugin/ (Your plugin's main Lua file)
βββ lua/ (Additional Lua code, organized by functionality)
β βββ my_plugin.lua (Your plugin's main Lua code)
β βββ commands.lua (Neovim commands)
β βββ mappings.lua (Key mappings)
β βββ utils.lua (Utility functions)
βββ doc/ (Documentation for your plugin)
βββ test/ (Test files for your plugin)
βββ README.md (Plugin documentation)
- Traverse through a specifed directory
- Ignore dot files
- Selection option for different kind of projects
- Restructure this project based on common convention
- Modules for each kind of project
- JavaScript (node.js)
- Go (Web app)
- Go (CLI)
- PHP (Web app)
- Lua (Neovim plugin)
- Other
- Sub directory file type validation
- Restrict file types in a specific directory
- Add CLI survey for file extension validation
- Make CLI more readable (spaces and colors)
- Documentation
- README
- Man page
- Golang executables for different platforms
- First release (compressed file and compiled program)