This repository contains the backend RESTful API service for the PreOwned Marketplace platform. Built with Node.js, Express, and MongoDB, it handles authentication, product management, order processing, role-based authorization, and Stripe payment integration.
- Runtime Environment: Node.js
- Framework: Express.js
- Database: MongoDB (via Native Driver / Mongoose)
- Authentication: Firebase Admin SDK / JWT
- Payment Gateway: Stripe API
- CORS & Middleware: CORS, Dotenv, Express JSON
- 🔐 Role-Based Authorization: Custom middlewares to secure routes for Buyers, Sellers, and Admins.
- 📦 Product Management: Complete CRUD endpoints for product listings.
- 💳 Stripe Payment Gateway: Secure payment intent generation and payment status updates.
- 🛍️ Order Tracking: Endpoints to manage order states (
Processing,Shipped,Delivered). - 📊 Analytics Data: Aggregated sales and revenue data endpoints for seller and admin dashboards.
Ensure you have Node.js and MongoDB installed or have access to a MongoDB Atlas cluster.
- Node.js
v18.0.0or higher
- Clone the repository:
git clone https://github.com/your-username/preowned-server.git cd preowned-server Install dependencies: npm install
2.Environment Setup (.env):
PORT=5000
MONGODB_URI=your_mongodb_connection_string
STRIPE_SECRET_KEY=your_stripe_secret_key
ACCESS_TOKEN_SECRET=your_jwt_secret
-
Run the server:
-
Development Mode (Nodemon):
npm run dev
-
Production Mode:
npm start
-
MD. Arafat Ferdous
- GitHub: Arafat Ferdous
- LinkedIn: MD.Arafat Ferdous
This project is licensed under the MIT License.