Skip to content

fisheeesh/emc-web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

413 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Emotion Check-in System

Preview

πŸ“‹ Table of Contents


πŸ‘‹ Introduction

The Emotion Check-in System is a comprehensive, fully Dockerized platform that helps organizations support employee well-being while tracking attendance. Employees use a mobile app to check in daily and share how they feel through simple emoji choices and optional notes. HR and Super Admins can then use a powerful web dashboard to view overall trends in employee emotions and attendance, displayed in easy-to-understand charts and AI-powered insights.

By combining daily attendance with emotional insights, the system enables organizations to notice patterns, provide timely support when negative moods persist, and create a healthier, more productive work environment.

The system includes:

  • React + Vite frontend for intuitive dashboards, analytics, and management
  • TypeScript/Express backend with Prisma, Redis, and BullMQ for emotion processing, AI analysis, and background jobs
  • AI-powered insights using Groq API for sentiment analysis and recommendations
  • Rich communication with MDX Editor for announcements and action plans
  • 🐳 Docker & Docker Compose for consistent development and deployment environments

For detailed documentation, see:


✨ Features

πŸ‘‰ Daily Emotion Check-ins: Intuitive emoji-based interface for employees to log their emotional state and attendance.

πŸ‘‰ AI-Powered Analysis: Automated sentiment scoring, critical mood trend detection, and intelligent recommendations.

πŸ‘‰ Real-Time Analytics Dashboard: Interactive charts showing mood trends, attendance patterns, and department comparisons.

πŸ‘‰ Critical Employee Monitoring: Automatic watchlist and email alerts for employees showing concerning emotional patterns.

πŸ‘‰ Action Plan Management: Create, track, and manage intervention plans with rich text editor and file attachments.

πŸ‘‰ Advanced Search & Filtering: Powerful search across check-ins, employees, and action plans with infinite scrolling.

πŸ‘‰ Rich Communication Tools: Announcements with MDX Editor support for formatted content and attachments.

πŸ‘‰ Role-Based Access Control: Secure authentication with Employee, Admin, and Super Admin roles.

πŸ‘‰ Background Workers: BullMQ + Redis for fast email delivery, cache management, and async processing.

πŸ‘‰ System Management: Configure emotion categories, define scoring metrics, and manage organizational settings.

πŸ‘‰ Bulk Operations: CSV import for mass employee registration and efficient onboarding.

πŸ‘‰ Responsive Design: Seamless experience across desktop, tablet, and mobile devices with dark mode support.

πŸ‘‰ 🐳 Docker Ready: Fully containerized with Docker Compose for instant setup across any environment.


🎯 Live Demo

Experience the Emotion Check-in System in action:

Demo Credentials:

  • Super Admin: super-admin@ata.it.th / Super1234$
  • Admin: admin@ata.it.th/ Admin1234$

πŸš€ Get Started

Prerequisites

  • Node.js (v18 or higher) or Docker & Docker Compose
  • PostgreSQL database
  • Redis instance
  • Cloudinary account (for file uploads)
  • Resend account (for emails)
  • Groq API key (for AI features)

Quick Start (Without Docker)

  1. Clone the repository
   git clone https://github.com/fisheeesh/emotion-checkin-system.git
   cd emotion-checkin-system
  1. Set up Frontend
   cd frontend
   npm install
   npm run dev

Frontend will be available at http://localhost:5173

  1. Set up Backend
   cd backend
   npm install
   
   # Initialize database
   npx prisma generate
   npx prisma migrate dev --name init
   
   # Start API and workers
   npm run dev

Backend API will be available at http://localhost:8080


🐳 Running with Docker

The easiest way to get started! Docker eliminates "it works on my machine" problems and ensures consistent environments across all developers.

Prerequisites

  • Docker Desktop (includes Docker Compose)
  • .env file configured in the backend folder

Quick Start with Docker

  1. Clone the repository
   git clone https://github.com/fisheeesh/emotion-checkin-system.git
   cd emotion-checkin-system
  1. Configure environment variables
   # Copy the example env file and fill in your credentials
   cp .env.example backend/.env

πŸ’‘ Tip: The .env.example file in the root directory contains all required variables for both frontend and backend. Use it as a reference when setting up your backend/.env file.

⚠️ Database Notice: This Docker setup does not include a database service. The current configuration uses a cloud-hosted PostgreSQL database (Neon). If you want to run the database locally, you'll need to:

  • Add a PostgreSQL service to docker-compose.yml
  • Update the DATABASE_URL in your .env file to point to the containerized database
  • Example: DATABASE_URL="postgresql://user:password@postgres:5432/your_db"
  1. Start all services
   docker compose up --build

That's it! πŸŽ‰

Development with Hot Reload

For active development with automatic file watching:

docker compose watch

This will:

  • βœ… Automatically rebuild when package files change
  • βœ… Sync code changes instantly without rebuilds
  • βœ… Restart services when needed

Useful Docker Commands

# Start in background (detached mode)
docker compose up -d

# View logs
docker compose logs -f

# View logs for specific service
docker compose logs -f api

# Stop all services
docker compose down

# Stop and remove volumes (fresh start)
docker compose down -v

# Restart a service
docker compose restart api

# Execute commands in container
docker compose exec api npx prisma migrate dev
docker compose exec api npm install <package-name>

Docker Architecture

The system runs three containerized services:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Frontend (React + Vite)                β”‚
β”‚  Port: 5173                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Backend (Express + Prisma)             β”‚
β”‚  Port: 8080                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Redis (Cache + Queue)                  β”‚
β”‚  Port: 6379                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚
                  β”‚ (External Connection)
                  β–Ό
         ☁️ PostgreSQL (Neon)

Optional: Adding Local Database

If you want to run PostgreSQL locally instead of using a cloud database, add this to your docker-compose.yml:

services:
  # ... existing services ...

  postgres:
    image: postgres:16-alpine
    ports:
      - 5432:5432
    environment:
      POSTGRES_USER: your_user
      POSTGRES_PASSWORD: your_password
      POSTGRES_DB: your_db
    volumes:
      - postgres_data:/var/lib/postgresql/data

volumes:
  redis_data:
  postgres_data:  # Add this

Then update your backend/.env:

DATABASE_URL="postgresql://your_user:your_password@postgres:5432/your_db"

Why Docker?

  • βœ… No installation headaches - No need to install Node.js, Redis, or worry about versions
  • βœ… Consistent environments - Same setup for all developers and production
  • βœ… Instant onboarding - New team members run one command to get started
  • βœ… Isolated dependencies - No conflicts with other projects on your machine
  • βœ… Easy cleanup - Remove everything with docker compose down -v

πŸ“š Documentation

Note: The Postman collection includes 2 types of URLs in variables:


πŸŽ“ Project Background

This application was developed as a senior project at Mae Fah Luang University by the Software Engineering department, originally inspired by and in collaboration with ATA IT (Thailand).

Academic Context

  • Institution: Mae Fah Luang University
  • Department: Software Engineering
  • Project Type: Senior Project
  • Year: 2024-2025

Important Notes

⚠️ Data Privacy & Responsibility
All privacy inquiries and data subject requests should be directed to 6531503187@lamduan.mfu.ac.th.
ATA IT is not responsible for the operation, data handling, or privacy practices of this application.

πŸ“§ Contact Information
For questions, support, or feedback about this project:

Acknowledgments

We would like to thank:

  • ATA IT (Thailand) for the initial project inspiration and collaboration opportunity
  • Mae Fah Luang University for academic guidance and support
  • All my team members who helped shape this system to completion:
    • Swan Yi Phyo (Full-Stack Developer/Mobile Developer) - 6531503187
    • Kaung Htut Hlaing (Project Manager/Backend Developer) - 6531503145
    • Khun Shine Si Thu (UI/UX Designer) - 6531503149
    • Myat Thu Kyaw (Front-end Developer) - 6531503159

βš–οΈ License

This project is licensed under the MIT License.


Built with ❀️ by Software Engineering students at Mae Fah Luang University

Creating healthier, more empathetic workplaces where every voice matters and every emotion counts.