https://github.com/rakibkhanofficial/ecommercemvc
https://github.com/rakibkhanofficial/ecommercemvc
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rakibkhanofficial/ecommercemvc
- Owner: rakibkhanofficial
- Created: 2024-02-03T13:50:28.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-03T13:52:01.000Z (over 1 year ago)
- Last Synced: 2025-01-02T03:30:43.286Z (10 months ago)
- Language: HTML
- Size: 241 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NodeJS,Mongoose,Express Project in MVC Architecture
**Supported version of nodejs >= 12**,
**Supported version of mongoose >= 6**## About
- This is a Node application, developed using MVC pattern with Node.js, ExpressJS, and Mongoose.
- MongoDB database is used for data storage, with object modeling provided by Mongoose.## Initial
1. ```$ npm install```
2. ```$ npm start```
3. Credentials- One user with User role,
# Default User credentials
**username** : Caleb.Erdman69
**password** : QpPCXqEiR8eGjOj- One user with Admin role,
# Default Admin credentials
**username** : Virgil.Jacobi19
**password** : H97DmukSybXgJTz## How to use generated APIs:
[Click here to visit documentation]( "API Documentation")## How to run with Docker ? :
- if you have docker file you can execute following command
- build the image
```$ docker build --pull --rm -f "Dockerfile" -t :latest "." ```
- execute the command
```$ docker run -p 3000:3000 ```## Folder structure:
```
├── app.js - starting point of the application
├── config
│ └── db.js - contains api database connection
├── constants - contains commonly used constants
├── controllers
│ └── platform - contains business logic
├── jobs - cron jobs
├── models - models of application
├── postman - postman collection files
├── routes - contains all the routes of application
├── services - contains commonly used services
├── views - templates
└── utils - contains utility functions
```## Detail Description of Files and folders
1. app.js
- entry point of application.2. config
- passport strategy files
- database connection files3. constants
- constants used across application.4. controllers
- Controller files that contains Business logic
```
├── controller
├── platform
└── modelNameController.js - contains CRUD Operations
```5. jobs
- Cron jobs6. middleware
- Middleware files for authentication, authorization and role-access.7. models
- Database models8. postman
- Postman collection of APIs (Import this JSON in Postman to run the APIs)9. public
- Assets used in application10. routes
```
├── routes
├── platform
├── modelNameRoutes.js - contains CRUD operation routes
└── index.js - exports model Routes
└── index.js - exports platform routes```
- index.js file, exports platform routes, imported into app.js to access all the routes.11. services
```
├── services
├── jobs - cron jobs
└── auth.js - Authentication module service```
12. utils
```
├── utils
├── validations - joi validations files for every model
├── dbService.js - Database functions
├── messages.js - Messages used in sending response
├── responseCode.js - response codes
└── validateRequest.js - validate request based on model schema```
13. env files
- You can add credentials and port, database values as per your environment(Development/Production).
- If you are running test environment then test cases will run using test database,and its configuration is there inside app.js