← Back to Projects

Rahgir

Full-stack development and system architecture design

  • Next.js (App Router)
  • TypeScript
  • Prisma ORM
  • PostgreSQL
  • JWT Authentication
  • Tailwind CSS

Overview

Rahgir is a location-based recommendation system that suggests places to visit based on user mood, available time, and travel preferences. The system uses a custom scoring algorithm to rank places and provide personalized recommendations while maintaining a modular and scalable architecture.

Screenshots

Core Capabilities

  • Mood-based recommendations across multiple categories (Chill, Adventure, Fun, Romantic, Solo)
  • Distance, time, and budget-aware filtering
  • Mood-specific ratings with confidence scoring
  • Authenticated users with saved places
  • Dynamic recommendation recalculation based on user input

System Architecture

The system follows a layered architecture separating UI, API routes, business logic, and database access.

  • Next.js App Router for SSR and API route handling
  • Service layer abstraction for business logic
  • Prisma ORM for type-safe database access
  • PostgreSQL relational schema with indexed queries
  • JWT-based stateless authentication

Recommendation Engine Design

Recommendations are generated using a structured scoring pipeline that evaluates places against user preferences.

  • Initial filtering based on distance and constraints
  • Mood-based scoring strategies (Strategy pattern)
  • Confidence weighting based on rating quality
  • Multi-criteria sorting and ranking
  • Top-N recommendation output for UI rendering

Design Patterns & Architecture Decisions

The project applies common backend design patterns to maintain separation of concerns and scalability.

  • Service Layer pattern for business logic isolation
  • Strategy pattern for mood-based scoring logic
  • Repository-style abstraction via Prisma
  • Singleton pattern for database client management
  • Factory-style token generation for authentication

Scalability Considerations

  • Indexed queries for frequently accessed fields
  • Stateless JWT authentication for horizontal scaling
  • Separation of recommendation logic for future microservice extraction
  • Prepared design for caching layer integration (e.g., Redis)

Trade-offs & Decisions

  • Chose Next.js App Router for SSR and full-stack integration
  • Selected PostgreSQL for relational consistency and complex queries
  • Used Prisma for type safety and migration support over raw SQL
  • Adopted JWT over session-based auth for stateless scalability

Outcome

Rahgir demonstrates a modular, full-stack architecture with a structured recommendation pipeline and clear separation of concerns. The system is designed to be extensible, allowing new moods, scoring strategies, and scaling mechanisms to be added without restructuring the core architecture.