This repository contains the code for the API and client side of a web application built using Express.js/Node.js, MongoDB, and React. The repository is structured into two main folders: api
and client
.
The api
folder contains the server-side code responsible for handling requests, interacting with the database, and serving data to the client. It is built using Express.js, a popular web application framework for Node.js, and utilizes MongoDB as the database for storing and retrieving data.
The client
folder contains the client-side code written in React, a JavaScript library for building user interfaces. It focuses on the user interface components and handles the interactions with the server-side API endpoints.
To set up the project locally, follow the instructions below:
- Node.js (version 18.15.0 or higher)
- MongoDB (version 6.0.6 or higher)
git clone https://github.com/krish3957/E-commerce.git
cd repository
To set up the API server, follow the instructions below:
cd api
npm install
- Create a .env file based on the .env.example template provided
- Update the necessary environment variables with your own configuration
npm start
The API server should now be running on http://localhost:5000.
cd client
npm install
- Create a .env file based on the .env.example template provided
- Update the necessary environment variables with your own configuration
npm start
The React development server should now be running on http://localhost:3000.
Once the installation and setup steps are complete, you can use the web application by accessing http://localhost:3000 in your web browser.
The application consists of a user interface built with React, allowing users to interact with the API endpoints provided by the Express.js server in the api folder. The server communicates with the MongoDB database to store and retrieve data.
Contributions to this repository are welcome. If you want to contribute, please follow these steps:
-Fork the repository. -Create a new branch for your feature or bug fix. -Make the necessary changes in your branch. -Commit your changes with descriptive commit messages. -Push your changes to your forked repository. -Submit a pull request to the original repository.
Please ensure that your code follows the project's coding conventions and includes appropriate documentation when necessary.