Skip to content

Prodexa is a unified platform connecting professionals through community engagement, real-time collaboration, and a dynamic freelance marketplace. It combines robust project management tools with gamified competitions to help users build skills, network, and grow their careers in one seamless ecosystem.

License

Notifications You must be signed in to change notification settings

seif-a096/Prodexa_Backend

 
 

Repository files navigation

Prodexa Mascot

Prodexa Backend

License: MIT Node.js NestJS

Introduction

"Prodexa is a versatile, productivity-oriented social platform designed for organizations, educational institutions, and communities. It drives engagement and collaboration through real-time messaging, instant notifications, and interactive, gamified competitions. Users can apply for full-time or freelance jobs, manage personal todos, assign tasks, and manipulate community roles."

This repository serves as the robust core for this platform, powered by NestJS. It orchestrates real-time interactions, secure authentication, and complex community management logic to ensure a seamless experience for all users.

Platform Ecosystem

The following diagram illustrates the high-level flow of the Prodexa platform.

graph TD
    User((User))
    Auth[Authentication]
    Dash[User Dashboard]

    User -->|Login/Register| Auth
    Auth --> Dash

    subgraph Global Features
        Dash --> DM["Direct Messages <br/>(Chat Gateway)"]
        Dash --> Jobs["Jobs & Freelance <br/>(Apply/Post)"]
        Dash --> Notif["Notifications"]
        Dash --> Profile["Profile & Badges"]
        Dash --> Todos["Todos & Tasks"]
    end

    subgraph "Community Experience"
        Dash -.->|Optional: Join| Comm["Community Home"]
        Comm --> Channels["Channels <br/>(Real-time Chat)"]
        Comm --> Feed["Posts Feed"]
        Comm --> Comp["Competitions <br/>(Gamified)"]
        Comm --> Roles["Role Management <br/>(Assign/Edit)"]
    end

    Notif -.->|Real-time| User

    style User fill:#f9f,stroke:#333
    style Global Features fill:#ff9,stroke:#333
    style Comm fill:#bbf,stroke:#333
Loading

Key Modules

The application is modularized to support scalability and maintainability:

  • Auth: robust authentication and authorization strategies (AuthController).
  • Users: Comprehensive user profile management, avatar handling, and settings (UsersController).
  • Community: The module for creating and managing communities, roles, and memberships (CommunityController).
  • Competition: Manages gamified competitions, quizzes, and live scoring via WebSockets (CompetitionController, CompetitionGateway).
  • Channels: Real-time chat channels within communities (ChannelsController).
  • Messages: Handling private direct messages and channel messages via (MessageController, ChatGateway).
  • Posts: News feed system for communities (PostsController).
  • Notifications: Real-time system alerts and user notifications (NotificationsController).
  • Jobs: Job posting and application tracking system (JobController). Access is governed by email verification and account type.
  • Deadline: Manages time-sensitive tasks or event deadlines (DeadlineController).
  • Verification-Requests: Handling user identity verification workflows. (VerificationRequestsController)
  • Badges: Gamification system awarding badges for achievements (BadgesController).
  • Mail: Email notification services. (MailService)
  • Cloudinary: Integration for efficient media upload and management. (CloudinaryService)
  • Site Logs: Helper module for admin users to view system activities (SiteLogsController).

Response Standardization

Prodexa Backend enforces consistent API responses and documentation:

  • Global Response Interceptor: A custom TransformationInterceptor wraps all successful responses in a standardized format.

Standard Response Example:

{
  "message": "Operation successful",
  "status_code": 200,
  "status": "Success",
  "data": { ... },
  "count": 1,
  "meta": {
    "page": 1,
    "limit": 10,
    "count": 5,
    "total": 50
  },
  "timestamps": "2024-12-19T10:00:00.000Z",
  "path": "/api/resource",
  "method": "GET"
}

Database Schema

You can view the complete Entity-Relationship (ER) Diagram for the database schema here: View Database Schema (PDF)

Tech Stack

  • Framework: NestJS (Node.js)
  • Language: TypeScript
  • Database: PostgreSQL (via TypeORM)
  • Caching & Queues: Redis
  • Event Bus: NATS
  • Real-time: Socket.io
  • Media Storage: Cloudinary
  • Email: Nodemailer

Getting Started

Prerequisites

  • Node.js (v16 or higher)
  • npm or yarn
  • PostgreSQL (Local or Cloud-hosted e.g., Neon, Railway)
  • Redis (Local or Cloud-hosted e.g., Upstash, Redis Cloud)
  • NATS (Local or Cloud-hosted e.g., Synadia)

Installation

  1. Clone the repository

    git clone https://github.com/Ali-Said1/Prodexa_Backend.git
    cd Prodexa_Backend
  2. Install Dependencies

    npm install
  3. Environment Configuration Create a .env file in the root directory. ensure you provide valid credentials.

    # Application
    # ENV=PROD
    ENV=DEV
    PORT=3000
    
    # JWT #
    JWT_ACCESS_SECRET=your_access_secret
    JWT_REFRESH_SECRET=your_refresh_secret
    JWT_TOKEN_EXPIRATION_TIME=15m
    JWT_REFRESH_EXPIRATION_TIME=7d
    
    # COOKIE SECRET #
    COOKIE_SECRET=your_cookie_secret
    
    # SERVER HOSTS
    
    FRONTEND_URL=
    BACKEND_URL=
    
    # POSTGRES Development DATABASE #
    POSTGRES_HOST_DEV=
    DB_URL_DEV=
    
    # POSTGRES Production DATABASE #
    POSTGRES_HOST_PROD=
    DB_URL_PROD=
    
    # COMMON POSTGRES CONFIGURATION #
    POSTGRES_PORT=
    POSTGRES_USERNAME=
    POSTGRES_PASSWORD=
    PGSSLMODE=
    PGCHANNELBINDING=
    
    # CLOUDINARY CONFIGURATION #
    CLOUDINARY_NAME=
    CLOUDINARY_API_KEY=
    CLOUDINARY_API_SECRET=
    
    # Redis
    REDIS_HOST=
    REDIS_PORT=
    REDIS_PASSWORD=
    
    # NATS
    NATS_SERVERS=
    NATS_CREDS_CHAT=
    NATS_CREDS_NOTIFICATION
    
    # Mail
    GMAIL_EMAIL_FROM_NAME=
    GMAIL_EMAIL_FROM_ADDRESS=
    GMAIL_SMTP_HOST=
    GMAIL_SMTP_PORT=
    GMAIL_SMTP_LOGIN=
    GMAIL_SMTP_PASSWORD=
    GMAIL_SMTP_SECURE=
    
    # Brevo
    BREVO_API_KEY=
  4. Database Migration Once the database is running (and .env is configured), run the migrations to seed the schema:

npm run migration:run

Running the Application

# development
npm run start

# watch mode (recommended for dev)
npm run start:dev

# production mode
npm run start:prod

API Documentation

Swagger API documentation is available locally when running the application:

Frontend Repository

You can find the frontend application code here: Prodexa

License

This project is licensed under the MIT License.

About

Prodexa is a unified platform connecting professionals through community engagement, real-time collaboration, and a dynamic freelance marketplace. It combines robust project management tools with gamified competitions to help users build skills, network, and grow their careers in one seamless ecosystem.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • TypeScript 99.9%
  • Other 0.1%