Skip to content

Latest commit

 

History

250 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pulsar

Next.js React Java Spring Boot gRPC MongoDB OpenTelemetry Docker Gradle

A distributed event booking and management platform built with microservices architecture, featuring AI-powered chat assistance and observability.

Overview

Pulsar is a full-stack event booking system that combines the power of microservices with an intuitive Next.js frontend. The platform enables users to discover events, manage bookings, and interact with an AI-powered chat assistant that leverages the Model Context Protocol (MCP) for intelligent event recommendations and booking assistance.

Architecture

The system uses a microservices architecture with four backend services written in Java/Spring Boot, a Next.js frontend, and MongoDB for persistence. Services communicate via gRPC internally and expose REST endpoints for the frontend.

Frontend

  • Next.js application with React 19
  • Server-side rendering and API routes
  • AI chat integration using Gemini and Model Context Protocol

Backend Services

  • User Service - User profile management and data
  • Auth Service - Authentication and JWT token handling
  • Event Service - Event CRUD operations and search
  • Booking Service - Booking management and status tracking

Data Layer

  • MongoDB with sharding support for horizontal scaling
  • Automated initialization via migration scripts

Observability

  • OpenTelemetry instrumentation across all services
  • Grafana LGTM stack for logs, metrics, and distributed tracing

Tech Stack

Frontend

  • Framework: Next.js 15.5.4 (with Turbopack)
  • UI Library: React 19.1.0
  • Styling: TailwindCSS 4
  • State Management: TanStack React Query 5
  • Animations: Framer Motion
  • AI: Google Generative AI (Gemini)
  • Protocol: Model Context Protocol (MCP) SDK
  • Observability: OpenTelemetry Web SDK

Backend Services

  • Framework: Spring Boot 4.0.0
  • Language: Java 25
  • Communication: gRPC
  • Database: MongoDB
  • Authentication: JWT
  • Observability: OpenTelemetry Java SDK

Infrastructure

  • Containerization: Docker & Docker Compose
  • Database: MongoDB with Sharding Support
  • Monitoring: Grafana LGTM Stack (Loki, Grafana, Tempo, Mimir)
  • Telemetry: OpenTelemetry Collector

Features

  • Event discovery and browsing
  • Booking management (create, view, manage bookings)
  • User authentication and registration
  • AI chat assistant powered by Gemini with MCP integration
  • Full observability with distributed tracing and metrics
  • Responsive UI with animations
  • JWT-based authentication
  • Scalable microservices architecture with MongoDB sharding

Prerequisites

Before running the project, ensure you have the following installed:

  • Docker (v20.10 or higher)
  • Docker Compose (v2.0 or higher)
  • Node.js (v20 or higher) - for local frontend development
  • Java JDK (v25) - for local backend development
  • Gradle (v8.0 or higher) - for building backend services

Installation & Setup

1. Clone the Repository

git clone <repository-url>
cd Pulsar

2. Environment Configuration

Create a .env file in the root directory with the following variables:

# Gemini AI API Key
NEXT_PUBLIC_GEMINI_API_KEY=your_gemini_api_key_here

# MongoDB Configuration
MONGO_INITDB_ROOT_USERNAME=root
MONGO_INITDB_ROOT_PASSWORD=test123

# Grafana SMTP Configuration (Optional)
GF_SMTP_ENABLED=true
GF_SMTP_HOST=smtp.gmail.com:587
GF_SMTP_USER=your_email@gmail.com
GF_SMTP_PASSWORD=your_app_password
GF_SMTP_FROM_ADDRESS=your_email@gmail.com
GF_SMTP_FROM_NAME=Grafana Alerts

3. Build and Run with Docker Compose

docker-compose up --build

docker-compose up --build -d

Project Structure

Pulsar/
├── frontend/                 # Next.js frontend application
│   ├── src/
│   │   ├── app/             # Next.js App Router pages
│   │   ├── components/      # React components
│   │   ├── features/        # Feature-based modules
│   │   └── lib/             # Utilities and configurations
│   └── Dockerfile
│
├── services/                # Backend microservices
│   ├── auth-service/        # Authentication & authorization
│   ├── booking-service/     # Booking management
│   ├── event-service/       # Event management
│   └── user-service/        # User profile management
│
├── mongodb/                 # MongoDB configuration
│   ├── migration/           # Database initialization scripts
│   └── sharding/            # Sharding cluster setup
│
└── docker-compose.yml       # Multi-container orchestration

Monitoring & Observability

The project includes comprehensive observability:

  1. Distributed Tracing: Track requests across all microservices
  2. Centralized Logging: Aggregate logs from all services
  3. Metrics Collection: Monitor service health and performance
  4. Grafana Dashboards: Visualize all telemetry data

Access Grafana to view:

  • Service health metrics
  • Request traces
  • Error rates and latencies
  • Custom dashboards

Database Management

MongoDB Initialization

The database is automatically initialized with the script in mongodb/migration/init-db.js when the container starts.

Sharding Setup

For production deployment with sharding:

cd mongodb/sharding
./setup-cluster.sh

Refer to the individual docker-compose.yml files in pc_1, pc_2, pc_3, pc_4 directories for distributed sharding configuration.

Authentication Flow

  1. User registers/logs in through the frontend
  2. Auth service validates credentials
  3. JWT token is generated and stored client-side
  4. Token is included in subsequent requests
  5. Services validate tokens using shared secret

AI Chat Integration

The AI chat feature uses:

  • Gemini AI: For natural language understanding and generation
  • Model Context Protocol (MCP): For structured communication with backend services
  • MCP Servers: Event and Booking services expose MCP endpoints for AI queries

Screenshots

Screenshot 2026-02-10 085211 Screenshot 2026-02-10 084500 Screenshot 2026-02-10 084610 Screenshot 2026-02-10 084713 Screenshot 2026-02-10 085020

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add 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.


Made with ❤️ by Artificed

About

A cloud-native event booking platform powered by Spring Boot microservices, featuring AI-driven chat assistance, observability with OpenTelemetry, and a Next.js frontend.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages