Skip to content

matechai/mat-chai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

42 Project Matcha

Spring Boot Angular Java TypeScript

Neo4j MongoDB Docker Nginx hits


Matcha is a social matchmaking application developed as part of the 42 curriculum. The platform provides advanced user interactions, real-time chat, notifications, and matchmaking features using a modern tech stack.




โœจ Features

๐Ÿ” Authentication & Security

  • JWT-based authentication
  • Secure session management
  • Email verification system
  • Password strength validation

๐Ÿ‘ค User Profiles

  • Upload 1โ€“5 profile pictures
  • Interactive location picker with map
  • Real-time age calculation
  • Bio and interests management

๐Ÿ’ซ Smart Interactions

  • Like/Pass system with instant feedback
  • Intelligent matchmaking algorithm
  • Browse history tracking
  • Block & report functionality

๐Ÿ” Advanced Search

  • Filter by age, location, interests
  • Sort by distance or compatibility
  • Real-time search results
  • Pagination support

๐Ÿ”” Real-time Notifications

  • Match notifications
  • Profile view alerts
  • Like/Unlike updates
  • Message notifications
  • WebSocket-based instant delivery

๐Ÿ’ฌ Live Chat

  • Real-time messaging
  • Chat only with matched users
  • Message history
  • Online/Offline status
  • Typing indicators

๐Ÿ‘ฎ Admin Panel

  • User report management
  • Ban/Unban functionality
  • View reported users with reasons

๐Ÿ›  Tech Stack

Backend

Framework    : Spring Boot 3.5.4
Language     : Java 17
Security     : Spring Security + JWT
Real-time    : WebSocket (STOMP)
API          : GraphQL + REST
Build        : Gradle

Key Dependencies:

  • spring-boot-starter-graphql - GraphQL API
  • spring-boot-starter-websocket - Real-time communication
  • spring-boot-starter-security - Authentication & Authorization
  • jjwt - JWT token management
  • spring-boot-starter-mail - Email notifications

Frontend

Framework    : Angular 20.2
Language     : TypeScript 5.0
UI Library   : Standalone Components
State        : Signals API
Routing      : Angular Router
Forms        : Reactive Forms

Key Features:

  • zxcvbn - Password strength validation
  • leaflet - Interactive maps
  • WebSocket client for real-time updates
  • GraphQL client integration

Databases

Graph DB     : Neo4j 5.0
  โ”œโ”€ User profiles & relationships
  โ”œโ”€ Matchmaking graph algorithms
  โ””โ”€ Like/Block/Match connections

Document DB  : MongoDB
  โ”œโ”€ Chat messages
  โ”œโ”€ Notifications
  โ””โ”€ User activity logs

Infrastructure

Reverse Proxy : Nginx
Containerization : Docker & Docker Compose
Orchestration : Docker Compose with health checks

๐Ÿ“ Project Structure

matcha/
โ”œโ”€โ”€ backend/        # Spring Boot backend with GraphQL API
โ”œโ”€โ”€ angular/        # Angular frontend
โ”œโ”€โ”€ nginx/          # Nginx configuration
โ”œโ”€โ”€ neo4j/          # Neo4j initialization scripts and dummy user generator
โ”œโ”€โ”€ docker-compose.yml
โ”œโ”€โ”€ .env            # Local environment variables (not in repo)
โ””โ”€โ”€ README.md

๐Ÿ— Architecture

graph TB
    subgraph "Client Layer"
        A[Angular Frontend<br/>Port 4200]
    end
    
    subgraph "Gateway Layer"
        B[Nginx<br/>Port 80]
    end
    
    subgraph "Application Layer"
        C[Spring Boot API<br/>Port 8080]
        D[GraphQL Endpoint]
        E[REST API]
        F[WebSocket Server]
    end
    
    subgraph "Data Layer"
        G[(Neo4j<br/>Port 7687)]
        H[(MongoDB<br/>Port 27017)]
    end
    
    A -->|HTTP/WS| B
    B -->|Proxy| C
    C --> D
    C --> E
    C --> F
    D -->|Users & Relationships| G
    E -->|Users & Relationships| G
    F -->|Chat & Notifications| H
    
    style A fill:#DD0031,color:#fff
    style B fill:#009639,color:#fff
    style C fill:#6DB33F,color:#fff
    style G fill:#008CC1,color:#fff
    style H fill:#47A248,color:#fff
Loading

๐Ÿš€ Quick Start

Prerequisites

One-Command Setup

git clone <repository-url>
cd matcha
cp .env.example .env  # Edit with your credentials
docker-compose up --build

๐ŸŽ‰ That's it! Access the app at http://localhost


๐Ÿ“‹ Setup

Step 1: Clone Repository

git clone <repository-url>
cd matcha

Step 2: Environment Configuration

Create .env file in the root directory:

cp .env.example .env

Edit .env with your credentials (see .env Template below)

Step 3: Start Services

docker-compose up --build

Step 4: Initialize Test Data (Optional)

# Generate 500 dummy users for testing
cd neo4j
python test.py

docker exec -it matcha-neo4j bash
cypher-shell -u {neo4j_username} -p {neo4j_password} -f /docker-entrypoint-initdb.d/init_profiles.cypher

๐ŸŒ Services & Endpoints

Service URL Description
๐ŸŽจ Frontend http://localhost Angular application
๐Ÿ”Œ Backend API http://localhost:8080/api Spring Boot REST API
๐Ÿ“Š GraphQL http://localhost:8080/api/graphql GraphQL playground
๐Ÿ”ต Neo4j Browser http://localhost:7474 Graph database UI
๐ŸŸข MongoDB mongodb://localhost:27017 Document database
๐Ÿ—‚๏ธ Mongo Express http://localhost:8081 MongoDB admin UI


๐Ÿ” .env Template

Create a .env file with the following configuration:

#โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
# ๐Ÿ–ฅ๏ธ  Server Configuration
#โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
SERVER_PORT=8080
APP_URL=http://localhost
FRONTEND_URL=http://localhost

#โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
# ๐Ÿ”‘ JWT Configuration
#โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
JWT_TYPE=Bearer
JWT_SECRET=your_super_secret_jwt_key_min_256_bits_recommended
JWT_EXPIRATIONMS_ACCESSTOKEN=3600000      # 1 hour
JWT_EXPIRATIONMS_REFRESHTOKEN=86400000    # 24 hours

#โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
# ๐Ÿƒ MongoDB Configuration
#โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
SPRING_DATA_MONGODB_URI=mongodb://admin:password@mongodb:27017/matcha
SPRING_DATA_MONGODB_USERNAME=admin
SPRING_DATA_MONGODB_PASSWORD=password
ME_CONFIG_MONGODB_SERVER=mongodb

#โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
# ๐Ÿ”ต Neo4j Configuration
#โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
SPRING_NEO4J_URI=bolt://neo4j:7687
SPRING_NEO4J_AUTHENTICATION_USERNAME=neo4j
SPRING_NEO4J_AUTHENTICATION_PASSWORD=your_neo4j_password

#โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
# ๐Ÿ“ง Mail Server Configuration (Gmail Example)
#โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
SMTP_MAIL_HOST=smtp.gmail.com
SPRING_MAIL_PORT=587
SPRING_MAIL_USERNAME=[email protected]
SPRING_MAIL_PASSWORD=your_app_password
SPRING_MAIL_PROTOCOL=smtp
SPRING_MAIL_PROPERTIES_MAIL_SMTP_AUTH=true
SPRING_MAIL_PROPERTIES_MAIL_SMTP_STARTTLS_ENABLE=true
SPRING_MAIL_PROPERTIES_MAIL_SMTP_STARTTLS_REQUIRED=true

#โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
# ๐Ÿ“ File Upload & GraphQL
#โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
FILE_UPLOAD_PATH=/uploads
GRAPHQL_PATH=/graphql

โš ๏ธ Security Note: Never commit .env to version control. Keep your credentials safe!



๐Ÿงช Testing with Dummy Data

Generate 500 realistic test users with the included Python script:

cd neo4j
python test.py

# Access Neo4j container
docker exec -it matcha-neo4j bash
cypher-shell -u {neo4j_username} -p {neo4j_password} -f /docker-entrypoint-initdb.d/init_profiles.cypher

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •