Production level folder strcuture for a mern stack app

*1. Client *

# Create folders
mkdir -p src/schema
mkdir -p src/utils
mkdir -p src/layouts src/routes src/pages/client src/pages/dashboard
mkdir -p src/redux/features/permission
mkdir -p src/redux/features/role
mkdir -p src/redux/features/loading
mkd…


This content originally appeared on DEV Community and was authored by Arshan Nawaz

*1. Client *

# Create folders
mkdir -p src/schema
mkdir -p src/utils
mkdir -p src/layouts src/routes src/pages/client src/pages/dashboard
mkdir -p src/redux/features/permission
mkdir -p src/redux/features/role
mkdir -p src/redux/features/loading
mkdir -p src/redux/features/auth
mkdir -p src/redux/middlewares
mkdir -p src/redux/actions

# Create files with path comments
echo "// src/schema/user.schema.js" > src/schema/user.schema.js

echo "// src/utils/formatDate.js" > src/utils/formatDate.js
echo "// src/utils/api.js" > src/utils/api.js
echo "// src/utils/EndPoints.js" > src/utils/EndPoints.js


echo "// src/layouts/ClientLayout.jsx" > src/layouts/ClientLayout.jsx
echo "// src/layouts/DashboardLayout.jsx" > src/layouts/DashboardLayout.jsx
echo "// src/routes/ClientRoutes.jsx" > src/routes/ClientRoutes.jsx
echo "// src/routes/DashboardRoutes.jsx" > src/routes/DashboardRoutes.jsx
echo "// src/routes/AppRouter.jsx" > src/routes/AppRouter.jsx
echo "// src/pages/client/Home.jsx" > src/pages/client/Home.jsx
echo "// src/pages/client/About.jsx" > src/pages/client/About.jsx
echo "// src/pages/dashboard/DashboardHome.jsx" > src/pages/dashboard/DashboardHome.jsx
echo "// src/pages/dashboard/Settings.jsx" > src/pages/dashboard/Settings.jsx

echo "// src/redux/features/permission/permission.slice.js" > src/redux/features/permission/permission.slice.js
echo "// src/redux/features/role/role.slice.js" > src/redux/features/role/role.slice.js
echo "// src/redux/features/loading/loading.slice.js" > src/redux/features/loading/loading.slice.js
echo "// src/redux/features/permission/permission.service.js" > src/redux/features/permission/permission.service.js
echo "// src/redux/features/role/role.service.js" > src/redux/features/role/role.service.js
echo "// src/redux/features/auth/auth.slice.js" > src/redux/features/auth/auth.slice.js
echo "// src/redux/features/auth/auth.service.js" > src/redux/features/auth/auth.service.js
echo "// src/redux/store.js" > src/redux/store.js
echo "// src/redux/rootReducer.js" > src/redux/rootReducer.js
echo "// src/redux/actions/actionTypes.js" > src/redux/actions/actionTypes.js
echo "// src/redux/middlewares/loading.middleware.js" > src/redux/middlewares/loading.middleware.js

2. Server

# Create the main source folders
mkdir -p src/controllers
mkdir -p src/middlewares
mkdir -p src/models
mkdir -p src/routes
mkdir -p src/utils
mkdir -p src/config
mkdir -p src/schema

# Create the public folder and profile folder
mkdir -p public/profile

# Create files with path comments in src/controllers
echo "// src/controllers/auth.controller.js: Controller for authentication-related routes" > src/controllers/auth.controller.js

# Create files with path comments in src/middlewares
echo "// src/middlewares/auth.middleware.js: Middleware for authentication" > src/middlewares/auth.middleware.js

# Create files with path comments in src/models
echo "// src/models/auth.model.js: Mongoose schema for authentication" > src/models/auth.model.js

# Create files with path comments in src/routes
echo "// src/routes/auth.route.js: Routes for authentication-related endpoints" > src/routes/auth.route.js

# Create files with path comments in src/utils
echo "// src/utils/example.utils.js: Example utility function" > src/utils/example.utils.js

# Create files with path comments in src/config
echo "// src/config/db.config.js: Configuration for database connection" > src/config/db.config.js
echo "// src/config/env.config.js: Configuration for environment variables" > src/config/env.config.js

# Create files with path comments in src/schema
echo "// src/schema/user.schema.js: Schema for user model" > src/schema/user.schema.js


This content originally appeared on DEV Community and was authored by Arshan Nawaz


Print Share Comment Cite Upload Translate Updates
APA

Arshan Nawaz | Sciencx (2024-08-17T13:30:14+00:00) Production level folder strcuture for a mern stack app. Retrieved from https://www.scien.cx/2024/08/17/production-level-folder-strcuture-for-a-mern-stack-app/

MLA
" » Production level folder strcuture for a mern stack app." Arshan Nawaz | Sciencx - Saturday August 17, 2024, https://www.scien.cx/2024/08/17/production-level-folder-strcuture-for-a-mern-stack-app/
HARVARD
Arshan Nawaz | Sciencx Saturday August 17, 2024 » Production level folder strcuture for a mern stack app., viewed ,<https://www.scien.cx/2024/08/17/production-level-folder-strcuture-for-a-mern-stack-app/>
VANCOUVER
Arshan Nawaz | Sciencx - » Production level folder strcuture for a mern stack app. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/08/17/production-level-folder-strcuture-for-a-mern-stack-app/
CHICAGO
" » Production level folder strcuture for a mern stack app." Arshan Nawaz | Sciencx - Accessed . https://www.scien.cx/2024/08/17/production-level-folder-strcuture-for-a-mern-stack-app/
IEEE
" » Production level folder strcuture for a mern stack app." Arshan Nawaz | Sciencx [Online]. Available: https://www.scien.cx/2024/08/17/production-level-folder-strcuture-for-a-mern-stack-app/. [Accessed: ]
rf:citation
» Production level folder strcuture for a mern stack app | Arshan Nawaz | Sciencx | https://www.scien.cx/2024/08/17/production-level-folder-strcuture-for-a-mern-stack-app/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.