Fullstack 2024

DenTalk

Dentist platform integrating four core modules: forum, job search, marketplace, and courses, with multi-role system and payment gateway integration

DenTalk

Project Overview

DenTalk is a comprehensive platform designed specifically for dentists and related fields. This is a complex, feature-rich large-scale project that integrates four core functionalities: forum, job search, marketplace, and courses, creating a complete dentistry ecosystem.

Project Type: Fullstack Development

Development Time: 2024

Main Technologies: Laravel, Astro, ECPay Gateway

Core Features: Forum, Job Search, Marketplace, Courses

Platform Features

DenTalk's greatest strength lies in its complex multi-role architecture. Unlike traditional systems where administrators upload data to be displayed on the frontend, DenTalk operates as a platform where different user roles can post and interact.

This makes the API architecture extremely complex, requiring consideration of:

  • Different user perspectives - Dentists, clinics, instructors, students, and more
  • Different use cases - Browsing, posting, managing, purchasing, and more
  • Permissions and data visibility - Data access controlled by user roles

💬 Forum Feature

Authorized users can post articles on the platform to discuss dentistry-related topics. The system provides flexible identity display settings, allowing users to use custom nicknames or post anonymously, protecting privacy while enabling open discussion.

The forum includes complete social features such as likes, comments, and sharing. Articles are categorized by discussion topics, making it easy for users to find relevant discussions and participate in interactions.

Forum Feature

Discussion Forum Interface

🛒 Marketplace Feature

Users with selling privileges can create their own stores, similar to seller accounts on e-commerce platforms. The system provides complete store management features, including setting shipping information, listing products, and configuring payment and logistics.

The marketplace supports multi-specification products, allowing buyers to select different specification combinations. Complete shopping cart and checkout process, integrated with ECPay payment and logistics, providing a secure and convenient transaction experience.

Marketplace Feature

Product Display Page

Store Management

Seller Backend Management

Product Specifications

Multi-specification Selection

Shopping Cart

Shopping Cart System

💼 Job Search Feature

Hospitals and clinics can post job openings, while dentists, dental professionals, and interns can post resumes. The platform provides a two-way matching mechanism, helping employers find suitable talent and job seekers find ideal positions.

List pages feature detailed filtering functionality, allowing searches by location, salary, job category, ratings, and more.

Most notably, the platform includes a custom schedule feature tailored to the dental industry. Dental clinic positions typically include morning, afternoon, and evening shifts. The system provides a calendar-based schedule setting, allowing dentists to clearly see available working hours, significantly improving matching efficiency.

Job Search Feature

Create Job Opening

Job Filtering

Filtering Functionality

Schedule Calendar

Custom Schedule

Talent Search

Resume List

Resume Details

Resume Details

Job Details

Job Details

Schedule System

Schedule System

📚 Course Feature

Instructor accounts can list courses on the platform. Each course can have multiple session cycles, and each session can contain multiple course settings, providing flexible course arrangements.

The system provides QR Code scanning for attendance, allowing instructors to quickly complete student check-ins.

More advanced is the complete examination system. Instructors can publish exams after each course session, with support for multiple choice, multiple selection, true/false, and essay questions, allowing instructors to create appropriate assessments to evaluate student learning outcomes.

Course Feature

Course Management System

Exam System

Online Examination Feature

Project Results

4 Core

Functional Modules

Multi-role

Complex Permission System

Complete

Payment Integration

Customized

Industry-specific Features

Multi-Identity System Implementation

The User table is one of the most frequently queried resources in the system. To reduce query overhead and JSON data consumption, we store multiple identity information in a single column using a Bitmask approach.

Bitmask Implementation

Below is the EnumIdentity implementation, which defines 12 different identity types using bitwise operations (1 << n), including dentists, clinics, hospitals, instructors, and students. Each identity corresponds to an independent bit position and can be combined using bitwise OR operations.

<?php

namespace App\Enum;

use Illuminate\Support\Collection;

enum EnumIdentity: int
{
    case NULL = 0;
    case DENTIST = 1 << 0;              // Dentist
    case DENTAL_ASSISTANT = 1 << 1;     // Dental Assistant
    case DENTAL_HYGIENIST = 1 << 2;     // Dental Hygienist
    case DENTAL_TECHNICIAN = 1 << 3;    // Dental Technician
    case INTERN = 1 << 4;                // Intern
    case STUDENT = 1 << 5;               // Student
    case CLINIC = 1 << 6;                // Clinic
    case HOSPITAL = 1 << 7;              // Hospital
    case VENDOR = 1 << 8;                // Vendor
    case INSTRUCTOR = 1 << 9;            // Instructor
    case ASSOCIATION = 1 << 10;          // Association
    case SOCIETY = 1 << 11;              // Society

    public function getLabel(): string { /* ... */ }
    public function getGroup(): string { /* ... */ }

    // Permission check methods
    public function isJobProvider(): bool { /* Hospital, Clinic */ }
    public function isJobSeeker(): bool { /* Dentist, Assistant, etc */ }
    public function isCourseProvider(): bool { /* Instructor */ }
    public function canSell(): bool { /* Sales permission */ }

    // Bitmask bidirectional conversion
    public static function fromBitmask(int $bitmask): Collection
    {
        // Convert integer to identity collection
        return collect(self::cases())
            ->filter(fn ($case) => ($bitmask & $case->value) !== 0);
    }

    public static function toBitmask(array|Collection $identities): int
    {
        // Convert identity collection to integer
        return collect($identities)
            ->map(fn ($identity) => $identity->value)
            ->reduce(fn ($carry, $val) => $carry | $val, 0);
    }
}

Technical Advantages

  • Database Performance - Single column storage reduces JOIN queries and improves query speed
  • Flexible Combination - Users can have multiple identities simultaneously (e.g., Dentist + Instructor)
  • Permission Management - Quick permission checks via methods like isJobProvider(), canSell()
  • Identity Grouping - getGroup() method categorizes related identities (e.g., Dental-related Personnel)

Chat System Architecture

Considering the high cost of Pusher.js, this project adopts Laravel Reverb, the officially recommended self-hosted WebSocket server, significantly reducing operational costs.

Architecture Overview

  • Frontend ↔ Reverb - Frontend establishes persistent WebSocket connection with Reverb Server
  • Laravel → Reverb - Laravel backend broadcasts messages to Reverb via Broadcasting
  • Reverb → Frontend - Reverb Server forwards messages in real-time to all subscribed frontend users

Technical Advantages

  • Cost Control - Self-hosted server eliminates third-party WebSocket service fees
  • Official Support - Native Laravel integration with simple and intuitive API
  • Scalability - Flexible server specification adjustment for controlling connection capacity
  • Real-time Communication - WebSocket connection provides low-latency bidirectional communication
Chat System Architecture

Laravel Reverb Architecture

Order State Management

The marketplace feature involves complex order state transitions, from placement to payment, shipping, and completion. Each stage has strict state constraints. To avoid code cluttered with numerous if/else conditional statements, this project adopts the State Machine design pattern.

State Machine Advantages

  • Clear State Definition - Explicitly defines all possible order states (Pending Payment, Paid, Shipping, Completed, Cancelled, etc.)
  • Strict Transition Rules - Restricts state transitions to follow predefined rules, preventing illegal states
  • Easy Maintenance - Avoids complex nested conditionals, making it safer to add states or modify workflows
  • Code Readability - Centralized state transition logic makes it easier to understand the overall business process

Through the State Machine pattern, even complex order workflows remain clean and maintainable.