Skip to content

About

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

630 Commits

Folders and files

Repository files navigation

UMAttend App

A modern attendance management system built with Next.js (client) and Express.js + TypeScript (server) for University of Mindanao.

πŸ“ Description

UMAttend is a comprehensive attendance management application designed to streamline event attendance tracking for University of Mindanao.

Tech Stack

Frontend:

  • Next.js 15 with Turbopack
  • React 19
  • TypeScript
  • TailwindCSS
  • Radix UI Components

Backend:

  • Express.js
  • TypeScript
  • Prisma ORM
  • PostgreSQL
  • JWT Authentication
  • Google OAuth

πŸš€ Setup Local Environment

Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn
  • PostgreSQL database
  • Git

Installation

  1. Clone the repository

    git clone https://github.com/riomar0001/umattend-app.git
    cd umattend-app
  2. Install root dependencies

    npm install
  3. Setup Server

    cd server
    npm install
  4. Setup Client

    cd ../client
    npm install
  5. Environment Configuration

    Server Environment (server/.env):

    # Database
    DATABASE_URL="postgresql://username:password@localhost:5432/umattend"
    DIRECT_URL="postgresql://username:password@localhost:5432/umattend"
    
    # JWT
    JWT_SECRET="your-jwt-secret"
    JWT_REFRESH_SECRET="your-refresh-secret"
    
    # Google OAuth
    GOOGLE_CLIENT_ID="your-google-client-id"
    GOOGLE_CLIENT_SECRET="your-google-client-secret"
    
    # Server
    PORT=5000
    NODE_ENV="development"

    Client Environment (client/.env.local):

    NEXT_PUBLIC_API_URL="http://localhost:5000"
    NEXT_PUBLIC_GOOGLE_CLIENT_ID="your-google-client-id"
  6. Database Setup

    cd server
    npx prisma migrate dev
    npx prisma generate

πŸƒβ€β™‚οΈ How to Run the Code

Quick Start (Recommended)

Start both servers at once:

npm run dev

This will start both the frontend and backend servers concurrently with colored output.

Alternative methods:

# Using concurrently package
npm run dev:concurrent

# Windows batch file (opens separate windows)
start-dev.bat

# Unix/Linux/Mac shell script
./start-dev.sh

Development Mode (Manual)

If you prefer to run servers separately:

  1. Start the Server (Terminal 1):

    cd server
    npm run dev

    Server will run on http://localhost:5000

  2. Start the Client (Terminal 2):

    cd client
    npm run dev

    Client will run on http://localhost:3000

Production Mode

Build both projects:

npm run build

Start both servers in production:

npm run start

Manual approach:

  1. Build and Start Server:

    cd server
    npm run build
    npm run prod
  2. Build and Start Client:

    cd client
    npm run build
    npm start

Available Root Scripts

# Development
npm run dev                 # Start both servers (recommended)
npm run dev:concurrent      # Alternative using concurrently
npm run dev:client          # Start only frontend
npm run dev:server          # Start only backend

# Production
npm run build               # Build both projects
npm run start               # Start both servers in production
npm run start:concurrent    # Alternative using concurrently
npm run start:client        # Start only frontend
npm run start:server        # Start only backend

# Installation
npm run install:all         # Install all dependencies

πŸ”§ Format Checking

This project uses Husky for pre-commit hooks with lint-staged to ensure code quality.

Available Commands

Server (cd server):

npm run lint          # Check for linting errors
npm run lint:fix      # Auto-fix linting errors
npm run format        # Format code with Prettier
npm run format:check  # Check code formatting
npm run type-check    # TypeScript type checking

Client (cd client):

npm run lint          # Next.js linting
npm run lint:fix      # Auto-fix Next.js linting errors
npm run format        # Format code with Prettier
npm run format:check  # Check code formatting
npm run type-check    # TypeScript type checking

Manual Format Check

# Check all files formatting
npm run format:server && npm run format:client

# Run full validation
npm run lint:server && npm run lint:client && npm run type-check:server && npm run type-check:client

πŸ“š Resources

Documentation

Project Structure


umattend-app/
β”œβ”€β”€ client/                 # Next.js Frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app/           # App Router pages
β”‚   β”‚   β”œβ”€β”€ components/    # Reusable components
β”‚   β”‚   └── lib/          # Utilities and configs
β”‚   β”œβ”€β”€ public/           # Static assets
β”‚   └── package.json
β”œβ”€β”€ server/               # Express.js Backend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ v1/           # API v1 routes
β”‚   β”‚   β”‚   β”œβ”€β”€ controllers/
β”‚   β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”‚   β”œβ”€β”€ repositories/
β”‚   β”‚   β”‚   β”œβ”€β”€ middlewares/
β”‚   β”‚   β”‚   └── validators/
β”‚   β”‚   β”œβ”€β”€ configs/      # Configuration files
β”‚   β”‚   └── utils/        # Utility functions
β”‚   β”œβ”€β”€ prisma/           # Database schema & migrations
β”‚   └── package.json
β”œβ”€β”€ .husky/               # Git hooks
β”œβ”€β”€ CONTRIBUTING.md       # Contribution guidelines
└── package.json          # Root package.json

API Endpoints

  • Authentication: /api/v1/auth/*
  • Users: /api/v1/users/*
  • Events: /api/v1/events/*
  • Students: /api/v1/students/*

πŸš€ Deployment

This project includes automated CI/CD pipelines using GitHub Actions with Docker, Nginx, and Let's Encrypt SSL.

Quick Deployment Guide

For a complete setup guide, see QUICKSTART.md (30 minutes)

Deployment documentation:

Environments

  • Local: docker-compose.local.yml - Development with hot reload
  • Staging: Auto-deploy on push to staging branch
  • Production: Auto-deploy on push to main/master branch

Deployment Features

βœ… Automated Docker builds
βœ… Nginx reverse proxy
βœ… SSL/TLS with Let's Encrypt
βœ… Auto-renewal of SSL certificates
βœ… Database migrations
βœ… Zero-downtime deployments
βœ… Environment-specific configurations

Quick Commands

# Local development with Docker
docker compose -f docker-compose.local.yml up -d

# Deploy using helper script
./scripts/deploy.sh staging up    # Start staging
./scripts/deploy.sh staging logs  # View logs

Required GitHub Secrets

See .github/secrets.template for complete list of required secrets:

  • SSH credentials
  • Domain configuration
  • Environment variables
  • API keys

Contributing

Please read CONTRIBUTING.md for details on:

  • Branching strategy
  • Commit message format
  • Code style guidelines
  • Pre-push checklist

Development Tools

  • ESLint: Code linting and quality
  • Prettier: Code formatting
  • TypeScript: Type safety
  • Prisma Studio: Database management UI
  • Docker: Containerization and deployment
  • GitHub Actions: CI/CD automation

About

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages