Buy Nest is a feature-rich e-commerce platform designed for seamless shopping experiences. This repository contains the backend services that power the platform, enabling robust functionality for Admins, Vendors, and Customers.
- Full control over the platform.
- Manage users: suspend or delete accounts.
- Blacklist vendors and manage product categories.
- Monitor transactions and platform activities.
- Create and manage shops with personalized branding.
- Add, edit, and delete products.
- View and respond to customer reviews.
- Manage inventory and view shop-specific order history.
- Browse products from various vendors.
- Use advanced filters and search functionalities.
- Add products to the cart, purchase items, and apply coupons.
- Compare products and leave reviews.
- View order history and follow favorite vendors.
- Node.js: JavaScript runtime for building scalable server-side applications.
- TypeScript: For type-safe development.
- Prisma: ORM for database management.
- PostgreSQL: Relational database for structured data.
- JWT (JSON Web Token): For secure authentication and authorization.
- Stripe/PayPal: Seamless and secure payment gateways.
Follow the steps below to set up the backend locally.
- Node.js (v16.x or later)
- PostgreSQL (installed locally or accessible via a cloud provider)
- Prisma CLI
-
Clone the repository:
git clone https://github.com/Kamrulthedev/Buy-Nest-Backend.git
-
Navigate to the project directory:
cd Buy-Nest-Backend
-
Install dependencies:
npm install
-
Set up environment variables: Create a
.env
file in the root directory with the following variables:PORT=5000 DATABASE_URL=your_postgresql_connection_string JWT_SECRET=your_secret_key STRIPE_SECRET_KEY=your_stripe_secret_key PAYPAL_CLIENT_ID=your_paypal_client_id
-
Initialize the database:
npx prisma migrate dev
-
Start the development server:
npm run dev
-
Access the API: The server will start on
http://localhost:5000
by default.
POST /api/auth/register
: Register a new user.POST /api/auth/login
: Login and receive a token.
GET /api/admin/users
: View all users.DELETE /api/admin/user/:id
: Delete a user account.POST /api/admin/blacklist
: Blacklist a vendor.
POST /api/vendor/products
: Add a new product.GET /api/vendor/orders
: View shop-specific order history.
GET /api/products
: Browse products.POST /api/orders
: Place an order.POST /api/reviews
: Leave a review.
For more detailed documentation, refer to the API Docs.
Run the test suite using:
npm test
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new feature branch:
git checkout -b feature/your-feature-name
- Commit your changes:
git commit -m "Add your message here"
- Push to the branch:
git push origin feature/your-feature-name
- Submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
Happy Coding! 🚀