Skip to content

Divar is a peer-to-peer marketplace platform built with Node.js and Express, allowing users to buy and sell items directly from one another. Leveraging MongoDB as the database and Mongoose for seamless data communication, Divar provides a user-friendly interface for listing advertisements, browsing available items, and facilitating transactions.

Notifications You must be signed in to change notification settings

SobhanHaghverdi/divar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Divar

Divar is a peer-to-peer marketplace platform built with Node.js and Express, allowing users to buy and sell items directly from one another. Leveraging MongoDB as the database and Mongoose for seamless data communication, Divar provides a user-friendly interface for listing advertisements, browsing available items, and facilitating transactions. Join us in creating a vibrant community where users can easily connect and trade!

Table of Contents

Features

  • User authentication and authorization using JWT
  • Advdertisements listing and browsing
  • Image uploads for advertisements
  • Responsive design for mobile and desktop
  • Error handling and validation
  • API documentation using Swagger

Technologies Used

  • Node.js
  • Express
  • MongoDB
  • Mongoose
  • EJS (Embedded JavaScript templating)
  • Multer (for file uploads)
  • dotenv (for managing environment variables)
  • jsonwebtoken (for authorization settings in cookies)
  • Swagger (for API documentation)

Installation

  1. Clone the repository:

git clone https://github.com/SobhanHaghverdi/divar.git

  1. Navigate to the project directory:

cd divar

  1. Install the dependencies:

npm install

  1. Set up your environment variables by creating a .env file in the root directory.

  2. Start the server:

npm start

Usage

Once the server is running, you can access the application at http://localhost:${your_port}. You can register, log in, and start listing or browsing items.

Directory Structure

divar/

  • ├── README.md
  • ├── package.json
  • ├── server.js
  • ├── public/
  • │ ├── assets/
  • │ ├── dist/
  • │ ├── home/
  • │ └── uploads/
  • ├── src/
  • │ ├── app-routes.js
  • │ ├── common/
  • │ │ ├── constants/
  • │ │ │ ├── cookie-enum.js
  • │ │ │ └── env-enum.js
  • │ │ ├── guard/
  • │ │ │ └── authorization-guard.js
  • │ │ ├── messages/
  • │ │ │ └── auth-messages.js
  • │ │ ├── middlewares/
  • │ │ │ ├── global-error-handler.js
  • │ │ │ └── not-found-handler.js
  • │ │ └── utils/
  • │ │ ├── auto-bind.js
  • │ │ ├── multer.js
  • │ │ └── object-helper.js
  • │ ├── config/
  • │ │ ├── mongoose-config.js
  • │ │ └── swagger-config.js
  • │ └── modules/
  • │ ├── advertisement/
  • │ ├── advertisement-option/
  • │ ├── auth/
  • │ ├── category/
  • │ └── user/
  • ├── views/
  • │ ├── layouts/
  • │ │ ├── auth/
  • │ │ ├── panel/
  • │ │ └── website/
  • │ └── pages/
  • │ ├── index.ejs
  • │ ├── auth/
  • │ ├── home/
  • │ └── panel/

Environment Variables

Create a .env file in the root directory of your project with the following content:

  • PORT=3000
  • NODE_ENV="development"
  • MONGODB_URL="your_mongodb_connection_string"
  • NESHAN_API_KEY="your_neshan_api_key"
  • JWT_SECRET_KEY="your_jwt_secret_key"
  • COOKIE_SECRET_KEY="your_cookie_secret_key

Make sure to replace the placeholder values with your actual credentials.

About

Divar is a peer-to-peer marketplace platform built with Node.js and Express, allowing users to buy and sell items directly from one another. Leveraging MongoDB as the database and Mongoose for seamless data communication, Divar provides a user-friendly interface for listing advertisements, browsing available items, and facilitating transactions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published