Skip to content

steevejoseph/bazaar-backend

Repository files navigation

Bazaar Backend

This repository contains/represents the API endpoints for Bazaar, a location-based marketplace SaaS platform designed specifically for universities. The platform combines an Express.js backend API with a React frontend application (migrated from the previous bazaar-frontend repository).

Documentation Links

Overview

Bazaar enables university students to buy, sell, and trade items within their campus community. The platform uses location-based services to connect buyers and sellers in the same university area, creating a safe and localized marketplace experience.

Features

  • User authentication and authorization
  • Location-based item discovery
  • Item listing management (create, read, update, delete)
  • Search and filtering capabilities
  • University-specific marketplaces
  • Real-time item availability updates
  • User profiles and ratings
  • Secure messaging between buyers and sellers

Tech Stack

Backend

  • Node.js
  • Express.js
  • MongoDB (database)
  • JWT (authentication)
  • Passport.js (authorization)

Frontend

  • React.js
  • Redux (state management)
  • Material-UI (component library)
  • Axios (API client)
  • React Router (routing)

Prerequisites

  • Node.js (v14 or higher)
  • MongoDB
  • npm or yarn

Installation

  1. Clone the repository:
git clone https://github.com/steevejoseph/bazaar-backend.git
cd bazaar-backend
  1. Install dependencies:
npm install
  1. Create a .env file in the root directory with the following variables:
PORT=3000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
NODE_ENV=development
  1. Start the development server:
npm run dev

API Documentation

The API endpoints are organized around the following resources:

  • /api/auth - Authentication endpoints
  • /api/users - User management
  • /api/items - Item listings
  • /api/messages - User messaging
  • /api/universities - University management

For detailed API documentation, please refer to:

Development

Running Tests

npm test

Linting

npm run lint

Building for Production

npm run build

Deployment

The application can be deployed to any Node.js hosting platform. Make sure to set the appropriate environment variables for production deployment.

npm run start

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Original frontend code from bazaar-frontend
  • All contributors who have helped shape and improve this project

Contact

For any questions or concerns, please open an issue in the repository.