Bilal Ahmed
This Node.js application integrates models for handling collections and documents, MongoDB for data storage, Express Validator for input validation, and Bcrypt for password protection. Follow the steps below to set up and run the project.
-
Clone the repository:
git clone https://github.com/BilalSaeedAlam/basic-ecommerce-node-backend.git
-
Navigate to the project directory:
cd your-node-app
-
Install Node modules:
npm install
This will install all the necessary dependencies specified in the
package.json
file.
-
MongoDB Setup:
Make sure you have MongoDB installed and running. Update the MongoDB connection string in the
config/keys.js
file.// config.js module.exports = { // Other configurations... mongoURI: "your-mongodb-connection-string", };
-
Express Validator and Bcrypt:
The application uses Express Validator for input validation and Bcrypt for password protection. Ensure that these are properly integrated into your routes and controllers.
-
Start the server:
npm start
This will start the server at
http://localhost:3000
by default. -
Access the application:
Open your web browser and navigate to
http://localhost:3000
to access the application.
The project utilizes models for handling collections and documents. These models can be found in the models
directory. Make sure to customize them based on your application requirements.
MongoDB is used as the database for storing data. The mongoose
library is employed for interacting with MongoDB. Ensure that your MongoDB instance is properly configured and accessible.
Express Validator is integrated into the application for input validation. Validators can be found in the validators
directory. Customize these validators according to your input requirements.
Bcrypt is used for password protection. Passwords should be hashed before storing them in the database. The bcrypt
library is used for this purpose. Make sure to handle user authentication securely using hashed passwords.
Feel free to provide feedback or contribute to the project by opening issues or pull requests on the GitHub repository.
Happy coding!
** JSON Web Token ** ** Authorization Middleware ** ** User Login Authorization ** ** Product Schema and API **