https://github.com/mjkj09/rentevent
RentEvent โ A MERN-based platform for discovering and listing event venues.
https://github.com/mjkj09/rentevent
expressjs mern-stack mongodb nodejs reactjs responsive-design venues webapp
Last synced: 3 months ago
JSON representation
RentEvent โ A MERN-based platform for discovering and listing event venues.
- Host: GitHub
- URL: https://github.com/mjkj09/rentevent
- Owner: mjkj09
- License: mit
- Created: 2025-03-06T00:31:25.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-06T00:39:24.000Z (over 1 year ago)
- Last Synced: 2025-03-06T01:30:56.774Z (over 1 year ago)
- Topics: expressjs, mern-stack, mongodb, nodejs, reactjs, responsive-design, venues, webapp
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## ๐ Project Description
RentEvent is a comprehensive web platform that connects venue owners with event organizers. The system provides an intuitive interface for browsing, booking, and managing event venues across various categories.
### Key Features:
- ๐ข **For Venue Owners**: Create and manage rental listings, handle customer inquiries
- ๐ **For Event Organizers**: Search venues, filter by category/location/price, save favourites
- โค๏ธ **Favourites System**: Add venues to favourites for later
- โญ **Review System**: Rate and review venues after events
- ๐ **Secure Authentication**: JWT with refresh tokens, role-based access control (owner/renter)
- ๐ง **Email Notifications**: Automated emails via SendInBlue (Brevo) for booking requests
## ๐๏ธ System Architecture
```
โโโโโโโโโโโโโโโโโโโ
โ Web Browser โ
โโโโโโโโโโฌโโโโโโโโโ
โ
โโโโโโโโโโโโโผโโโโโโโโโโโโ
โ FRONTEND (React) โ
โ - Port: 5173 โ
โ - Vite Dev Server โ
โ - Material-UI โ
โโโโโโโโโโโโโฌโโโโโโโโโโโโ
โ HTTP/REST
โโโโโโโโโโโโโผโโโโโโโโโโโโ
โ BACKEND (Express) โ
โ - Port: 5000 โ
โ - JWT Auth โ
โ - RESTful API โ
โโโโโโโฌโโโโโโโโโโฌโโโโโโโโ
โ โ
โโโโโโโโโโโผโโโโ โโโโโผโโโโโโโโโโโ
โ MongoDB โ โ RabbitMQ โ
โ Port: 27017 โ โ Port: 5672 โ
โ โ โ UI: 15672 โ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ
โโโโโโโโโผโโโโโโโโโ
โ Email Service โ
โ (Brevo) โ
โโโโโโโโโโโโโโโโโโ
```
## ๐ ๏ธ Technologies Used
### Frontend
- **React 19.0.0** - Modern UI library for building user interfaces
- *Justification*: Latest version with improved performance, component-based architecture, excellent ecosystem
- **Material-UI (MUI) 7.0.2** - React component library
- *Justification*: Consistent design system, built-in responsiveness, accessibility features
- **React Router DOM 7.4.1** - Client-side routing
- *Justification*: Industry standard for React SPAs, supports nested routes and data loading
- **Axios 1.9.0** - HTTP client
- *Justification*: Request/response interceptors for token handling, automatic JSON transformation
- **Vite 6.2.0** - Build tool and dev server
- *Justification*: Lightning-fast HMR, optimized production builds, better DX than webpack
- **Emotion** - CSS-in-JS styling (used by MUI)
- *Justification*: Dynamic styling, better performance than runtime CSS
- **Zxcvbn 4.4.2** - Password strength estimator
- *Justification*: Provides realistic password strength feedback to users
### Backend
- **Node.js + Express 4.21.2** - Server framework
- *Justification*: JavaScript across the stack, mature ecosystem, excellent performance
- **MongoDB + Mongoose 8.12.1** - NoSQL database and ODM
- *Justification*: Flexible schema for diverse venue types, excellent Node.js integration
- **JWT (jsonwebtoken 9.0.2)** - Authentication
- *Justification*: Stateless authentication, supports refresh token pattern
- **Bcrypt 6.0.0** - Password hashing
- *Justification*: Industry standard for password security, resistance to timing attacks
- **Multer 2.0.1** - File upload handling
- *Justification*: Streamlined multipart/form-data handling, memory and disk storage options
- **Joi 17.13.3** - Data validation
- *Justification*: Schema-based validation, clear error messages, extensive validation rules
- **RabbitMQ (amqplib 0.10.8)** - Message queue
- *Justification*: Async processing for emails, improved system resilience
- **SendInBlue SDK 8.5.0** - Email service
- *Justification*: Reliable email delivery, transactional email support, good free tier
- **Swagger (swagger-jsdoc 6.2.8 + swagger-ui-express 5.0.1)** - API documentation
- *Justification*: Interactive API documentation, helps with frontend-backend coordination
### DevOps & Development Tools
- **Docker** - Containerization (Dockerfiles present)
- *Justification*: Consistent development environments, easy deployment
- **Nodemon 3.1.9** - Development server
- *Justification*: Auto-restart on file changes, improves developer productivity
- **ESLint 9.21.0** - Code linting
- *Justification*: Maintains code quality, catches potential bugs early
- **CORS 2.8.5** - Cross-origin resource sharing
- *Justification*: Enables frontend-backend communication across different ports
- **Cookie-parser 1.4.7** - Cookie handling
- *Justification*: Secure httpOnly cookie management for refresh tokens
## ๐ฆ System Requirements
- Docker & Docker Compose (recommended)
- OR manually install:
- Node.js >= 18.0.0
- npm >= 9.0.0
- MongoDB >= 6.0
- RabbitMQ >= 3.13.7
## ๐ Installation Instructions
### 1. Clone Repository
```bash
git clone https://github.com/mjkj09/RentEvent.git
cd RentEvent
```
### 2. Environment Configuration
#### Create root `.env` file (in project root directory)
```env
# Brevo (SendInBlue) Configuration
BREVO_API_KEY=your_brevo_api_key_here
BREVO_SENDER_EMAIL=noreply@yourdomain.com
```
#### Create server `.env` file (in `server/` directory)
```env
# Required Environment Variables
JWT_SECRET=your_super_secret_jwt_key_here_min_32_characters
JWT_REFRESH_SECRET=your_super_secret_refresh_key_here_min_32_characters
NODE_ENV=development
# Brevo (SendInBlue) - same as root .env
BREVO_API_KEY=your_brevo_api_key_here
BREVO_SENDER_EMAIL=noreply@yourdomain.com
# Optional (defaults will be used if not specified)
PORT=5000
MONGODB_URI=mongodb://mongo:27017/rentevent
RABBITMQ_URL=amqp://guest:guest@rabbitmq:5672
CLIENT_URL=http://localhost:5173
```
### 3. Run with Docker Compose
```bash
# Build and start all services in detached mode
docker compose up --build -d
# View logs
docker compose logs -f
# Stop all services
docker compose down
# Stop and remove all data (volumes)
docker compose down -v
```
### 4. Access the Application
After running Docker Compose, the following services will be available:
- **Frontend**: http://localhost:5173
- **Backend API**: http://localhost:5000
- **API Documentation (Swagger)**: http://localhost:5000/api/v1/docs/
- **RabbitMQ Management UI**: http://localhost:15672
- Default credentials: `guest` / `guest`
- **MongoDB**: mongodb://localhost:27017
### 5. Alternative: Manual Setup (without Docker)
If you prefer to run services manually:
#### Backend Setup
```bash
cd server
npm install
# Make sure MongoDB and RabbitMQ are running locally
# Start the backend
npm run dev
```
#### Frontend Setup
```bash
cd client
npm install
# Start the frontend
npm run dev
```
## ๐งช Testing
### Initial Setup
The application starts with an empty database. Users need to register new accounts to begin using the platform.
### Registration Process
1. Navigate to http://localhost:5173
2. Click on "Get Started"
3. Switch to "Sign Up" mode
4. Create an account as either:
- **Event Organizer (Renter)**: Browse and book venues
- **Venue Owner**: List and manage venues (requires company setup)
### API Testing
Use the Swagger documentation at `http://localhost:5000/api/v1/docs/` to test API endpoints directly.
## ๐ Project Structure
```
rentevent/
โโโ .env # Root environment variables (Brevo config)
โโโ docker-compose.yml # Docker orchestration file
โโโ README.md # This file
โ
โโโ client/ # React Frontend
โ โโโ public/ # Static assets
โ โโโ src/
โ โ โโโ api/ # API configuration and endpoints
โ โ โโโ components/ # Reusable React components
โ โ โโโ constants/ # Application constants
โ โ โโโ contexts/ # React Context providers
โ โ โโโ hooks/ # Custom React hooks
โ โ โโโ services/ # Business logic services
โ โ โโโ theme/ # Material-UI theme configuration
โ โ โโโ utils/ # Helper functions
โ โ โโโ views/ # Page components
โ โ โโโ App.jsx # Main application component
โ โ โโโ index.css # Global styles
โ โ โโโ main.jsx # Application entry point
โ โโโ Dockerfile # Frontend container config
โ โโโ index.html # HTML template
โ โโโ package.json # Frontend dependencies
โ
โโโ server/ # Node.js Backend
โโโ config/ # Configuration files
โโโ controllers/ # Request handlers
โโโ docs/ # API documentation
โโโ middleware/ # Express middleware
โโโ models/ # Mongoose schemas
โโโ public/ # Public assets
โโโ repositories/ # Data access layer
โโโ routes/ # API route definitions
โโโ services/ # Business logic
โ โโโ auth.service.js
โ โโโ company.service.js
โ โโโ email.service.js
โ โโโ queue.service.js
โ โโโ request.service.js
โ โโโ review.service.js
โ โโโ user.service.js
โ โโโ venue.service.js
โโโ utils/ # Utility functions
โ โโโ AppError.js # Custom error class
โโโ .env # Backend environment variables
โโโ Dockerfile # Backend container config
โโโ index.js # Server entry point
โโโ package.json # Backend dependencies
```
## ๐ Security Features
- Password hashing with bcrypt (12 salt rounds)
- JWT tokens with short expiration (15 minutes) + refresh tokens (30 days)
- Input validation using Joi schemas
- CSRF protection via httpOnly cookies
- CORS configured for trusted origins only
- File upload restrictions (type and size validation)
- Request sanitization to prevent XSS attacks
- Role-based access control (RBAC)
- Secure password requirements enforced with zxcvbn
## ๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
## ๐ฅ Author
- Mikoลaj Munik - *CS Student at Cracow University of Technology* - [GitHub](https://github.com/mjkj09)