Green Market Place is a sustainable product website designed with principles of sustainable web development and user-friendly design. This e-commerce platform not only allows users to explore and purchase sustainable products but also educates them about the product development process. To further its mission of promoting sustainability, the platform features a blog section where users can read and contribute content about sustainability.
- E-commerce Functionality: Browse and purchase sustainable products.
- Education on Sustainability: Gain insights into the production process of items.
- Integrated Blog System: Read and write articles related to sustainability.
- Sustainable Web Development Practices: Designed with eco-friendly web principles.
The project consists of a single repository hosting both backend and frontend codebases.
- Framework: Built on Express.js.
- Database: Uses MongoDB for storing data.
- Environment Configuration: The
.env
file must include the following:MONGO_URI
: Connection string to your MongoDB instance.JWT_SECRET
: Secret key for signing JSON Web Tokens (JWT).
- Node.js Version: The project uses Node.js version
v22.9.0
, specified in the.nvmrc
file for environment consistency. - Code Quality Tools:
- Prettier: For consistent code formatting.
- ESLint: This is used to identify and fix JavaScript code issues.
- Framework: Developed using Next.js.
- State Management: Configured with a persistent Redux store using Thunk middleware for efficient state management and asynchronous actions.
- Placement: The frontend code is located in the
frontend
folder within the repository.
- Node.js: Ensure you have
v22.9.0
installed (recommended to use nvm). - Git: For cloning the repository.
- MongoDB: A running MongoDB instance (local or cloud).
- Package Manager: Either npm or yarn.
-
Clone the Repository:
git clone [email protected]:fahad-git/green-market-place.git cd green-market-place
-
Set Node Version:
nvm use
If
nvm
is not installed, install Node.js versionv22.9.0
manually. -
Install Dependencies: Navigate to the root directory and run:
npm install
Repeat the process in the
frontend
directory:cd frontend npm install
-
Configure Environment Variables: In the backend root directory, create a
.env
file and configure the following:MONGO_URI=mongodb+srv://<username>:<password>@cluster0.mongodb.net/<database-name>?retryWrites=true&w=majority JWT_SECRET=your-secret-key
Replace
<username>
,<password>
,<database-name>
, andyour-secret-key
with your specific details. -
Run the Backend: In the root directory:
npm start
-
Run the Frontend: In the
frontend
directory:npm run dev
-
Access the Application: Open your browser and navigate to
http://localhost:3000
(default port for Next.js).
We welcome contributions to improve the Green Market Place! Please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature-name
- Commit changes:
git commit -m "GMP-1234: Add your descriptive message here"
- Push to your branch:
git push origin feature/your-feature-name
- Open a Pull Request.
This project is open-source and available under the MIT License.
"This project, Green Market Place, was developed as part of the Specialization in Web Technology course to fulfil its academic requirements."