Skip to content

Latest commit

Β 

History

History
108 lines (78 loc) Β· 3.51 KB

File metadata and controls

108 lines (78 loc) Β· 3.51 KB

ProtecTalk Server

The backend service powering ProtecTalk.
Built with Java + Spring, it provides authentication, messaging, and real-time data synchronization for the client app.


πŸš€ Tech Stack

  • Language: Java
  • Framework: Spring Boot
  • Database: MongoDB
  • Authentication & Messaging: Firebase

πŸ“¦ Key Features

  • πŸ” Authentication & Authorization β†’ Firebase integration for secure user identity (email/password sign-in).
  • πŸ“² Device Token Management β†’ Store and update FCM tokens per device for reliable push delivery.
  • πŸ“‘ Push Notifications β†’ Server-side integration with Firebase Cloud Messaging (FCM) for sending alerts.
  • πŸ“Š Alert Processing β†’ Receives, validates, and persists alerts triggered by the client app.
  • πŸ—„οΈ Database Persistence β†’ MongoDB integration for users, sessions, device tokens, and alerts.
  • βš™οΈ RESTful APIs β†’ Endpoints for client communication (registration, alerts, contact requests, etc.).
  • 🧩 Modular Architecture β†’ Organized into clear packages (config, security, devices, messaging) for maintainability.
  • πŸ“ Auditing & Logging β†’ Mongo audit + structured logs for traceability of events and data changes.

🌐 Server API – Postman Collection

We provide a ready-to-use Postman Collection for interacting with the ProtecTalk Server API.

How to Use

  1. Import the collection into Postman

    • Go to File β†’ Import β†’ Link and paste the collection URL above,
      or download the JSON file and import it manually.
  2. Set environment variables (optional)

    • You can define variables like BASE_URL or TOKEN in Postman’s environment settings.
  3. Add your Bearer Token

    • Open the Authorization tab for the collection or individual request.
    • Set Type to Bearer Token.
    • Paste your token in the Token field.
  4. Run API requests

    • With the token set, you can now execute requests against the server API directly from Postman.

⚑ Tip: Use Postman’s Environments feature to store your token and base URL once, so you don’t need to edit every request manually.


πŸš€ Deployment

You can run the ProtecTalk Server using Docker Compose, which starts both the application and MongoDB.

1. Create docker-compose.yml

version: "3.8"

services:
  server:
    build: .
    container_name: protectalk-server
    ports:
      - "8080:8080"
    environment:
      - SPRING_DATA_MONGODB_URI=mongodb://mongo:27017/protectalk
      - SPRING_PROFILES_ACTIVE=prod
      - FIREBASE_CONFIG_PATH=/app/config/firebase-service-account.json
    volumes:
      - ./config/firebase-service-account.json:/app/config/firebase-service-account.json:ro
    depends_on:
      - mongo

  mongo:
    image: mongo:6.0
    container_name: protectalk-mongo
    restart: always
    ports:
      - "27017:27017"
    volumes:
      - mongo-data:/data/db

volumes:
  mongo-data:

2. Build & Run

docker compose up --build -d

3. Verify


πŸ“ Notes

  • Make sure to provide your Firebase service account JSON in ./config/firebase-service-account.json.
  • For production, update SPRING_PROFILES_ACTIVE and configure secrets in a safe way.