Skip to content

PassGo is a Passport Application Submission and Validation System for Sri Lankan Citizens

Notifications You must be signed in to change notification settings

RusithTharindu/passgo-fe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

121 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‚ PassGo - Passport Application Management System

PassGo is a modern web application built with Next.js 14, TypeScript, and Tailwind CSS that streamlines the passport application and management process. ✈️

✨ Features

πŸ‘€ For Applicants

πŸ“‹ Passport Application

  • πŸ“ New Application Submission
    • 🧭 Step-by-step form wizard interface
    • ⚑ Service type selection (Normal/One Day)
    • πŸ“„ Travel document type selection
    • πŸ‘€ Personal information collection
    • πŸŽ‚ Birth information and documentation
    • πŸ“ž Contact details
    • 🌍 Dual citizenship handling
    • πŸ‘Ά Child passport application support
    • πŸ“Έ Photo upload with guidelines
    • πŸ“Ž Document uploads (NIC, Birth Certificate)
    • πŸ“ Collection location selection
    • βœ… Declaration and terms acceptance

πŸ“Š Application Management

  • πŸ” Application Tracking
    • ⏱️ Real-time status updates
    • πŸ“ˆ Visual timeline of application progress
    • πŸ“§ Email notifications for status changes
    • πŸ‘οΈ View application details and history
    • ⬇️ Download submitted documents

πŸ“… Appointment System

  • πŸ—“οΈ Appointment Booking
    • πŸ“… Schedule appointments for document verification
    • ⏰ Select preferred date and time
    • πŸ“ Choose convenient location
    • πŸ“§ Receive email confirmations
    • πŸ”„ Reschedule or cancel appointments
    • πŸ‘€ View upcoming appointments

πŸ‘¨β€πŸ’Ό For Administrators

πŸ“‹ Application Management

  • βš™οΈ Application Processing
    • πŸ‘€ View all applications
    • πŸ” Filter and search applications
    • πŸ”„ Update application status
    • πŸ“ Add admin notes
    • ❌ Process rejections with reasons
    • πŸ“Š Track application progress
    • πŸ“§ Send email notifications to applicants

πŸ“… Appointment Management

  • πŸ› οΈ Appointment Handling
    • πŸ‘οΈ View all scheduled appointments
    • βœ…βŒ Approve/reject appointment requests
    • ⏰ Manage time slots availability
    • πŸ“§ Send confirmation emails
    • πŸ“Š Track appointment attendance

πŸ“„ Document Verification

  • πŸ” Document Processing
    • βœ… Verify uploaded documents
    • πŸ“Ž Request additional documents
    • βœ”οΈ Mark documents as verified
    • πŸ“Š Track document verification status

πŸš€ System Features

πŸ” Authentication & Security

  • πŸ›‘οΈ Secure user authentication
  • πŸ‘₯ Role-based access control
  • πŸ”’ Protected API routes
  • 🎫 Session management
  • πŸ”‘ Password reset functionality

🎨 User Interface

  • πŸ“± Responsive design
  • πŸŒ™β˜€οΈ Dark/Light mode support
  • ⏳ Loading states and animations
  • ⚠️ Error handling and validation
  • πŸ”” Toast notifications
  • πŸ’¬ Modal confirmations

πŸ“§ Email Notifications

  • βœ… Application submission confirmation
  • πŸ”„ Status update notifications
  • πŸ“… Appointment confirmations
  • πŸ“„ Document verification reminders
  • πŸŽ‰ Collection readiness alerts

πŸ› οΈ Technical Stack

  • πŸš€ Frontend Framework: Next.js 14 (App Router)
  • πŸ“ Language: TypeScript
  • 🎨 Styling: Tailwind CSS
  • 🧩 UI Components: Shadcn UI
  • πŸ—ƒοΈ State Management: React Query, Zustand
  • πŸ“‹ Form Handling: React Hook Form, Zod
  • πŸ” Authentication: JWT
  • πŸ“§ Email Service: Nodemailer
  • πŸ“Ž File Upload: Multi-part form data

πŸš€ Getting Started

  1. πŸ“‹ Prerequisites

    Node.js 18+
    pnpm
  2. ⬇️ Installation

    git clone <repository-url>
    cd passgo-fe
    pnpm install
  3. βš™οΈ Environment Setup Create a .env.local file:

    NEXT_PUBLIC_API_URL=http://localhost:5000/api
    GMAIL_USER=[email protected]
    GMAIL_APP_PASSWORD=your-app-specific-password
    
    CLOUD_VISION_API=
    GOOGLE_CLOUD_PROJECT_ID=
    GOOGLE_CLOUD_LOCATION=
    GOOGLE_CLOUD_PROCESSOR_ID=
    GOOGLE_CLOUD_API_KEY=
  4. πŸ”§ Development

    pnpm run dev
  5. πŸ—οΈ Build

    pnpm run build
    pnpm start

πŸ”„ CI/CD Pipeline

PassGo includes a comprehensive CI/CD pipeline using GitHub Actions for automated testing and quality assurance.

πŸš€ GitHub Actions Workflow

The pipeline automatically runs on:

  • πŸ“€ Push to main or development branches
  • πŸ”€ Pull requests to main or development branches

Pipeline Steps:

  1. πŸ” Lint & Test
    • βœ… ESLint code quality checks
    • πŸ”§ TypeScript compilation validation
    • πŸ’… Prettier formatting verification
    • πŸ› οΈ Next.js build verification

Required GitHub Secrets:

  • NEXT_PUBLIC_API_URL - Your backend API endpoint

πŸ§ͺ Local Testing Scripts

Quick Pipeline Test:

# Test all CI/CD steps locally (recommended before pushing)
bash scripts/test.sh

Full Deployment with Docker:

# Run complete pipeline + Docker deployment
bash scripts/deploy.sh

Individual Commands:

# Run each step manually
pnpm lint                    # ESLint checks
npx tsc --noEmit            # TypeScript validation
pnpm build                  # Build verification

πŸ“‹ Script Features

  • πŸ” Environment validation - Checks Node.js and pnpm versions
  • πŸ“¦ Dependency management - Installs with frozen lockfile
  • 🎯 Quality gates - Prevents bad code from reaching production
  • 🐳 Docker integration - Full containerized deployment
  • πŸ’“ Health checks - Validates deployment success
  • 🎨 Colored output - Clear visual feedback

🐳 Docker Deployment

For containerized deployment, see DOCKER.md for detailed instructions.

⚑ Quick Docker Start

# Using automated deployment script (recommended)
bash scripts/deploy.sh

# Using Docker Compose
docker-compose up --build

# Or using Docker directly
docker build -t passgo-fe .
docker run -p 3000:3000 \
  -e NEXT_PUBLIC_API_URL=http://localhost:8080/api \
  passgo-fe

🎯 Docker Features

  • πŸ—οΈ Multi-stage optimized build
  • πŸ”οΈ Alpine Linux base for minimal size
  • πŸ’“ Health monitoring endpoint
  • πŸ”§ Environment variable support
  • πŸš€ Production-ready configuration

πŸ“ Project Structure

src/
β”œβ”€β”€ app/                    # 🏠 Next.js app router pages
β”œβ”€β”€ components/            # 🧩 Reusable components
β”œβ”€β”€ hooks/                # 🎣 Custom React hooks
β”œβ”€β”€ api/                  # πŸ”Œ API integration
β”œβ”€β”€ types/               # πŸ“ TypeScript types/interfaces
β”œβ”€β”€ utils/               # πŸ› οΈ Utility functions
└── styles/              # 🎨 Global styles

scripts/
β”œβ”€β”€ deploy.sh              # πŸš€ Full CI/CD pipeline + Docker deployment
└── test.sh               # πŸ§ͺ CI/CD pipeline testing only

.github/
└── workflows/
    └── deploy.yml         # βš™οΈ GitHub Actions CI/CD pipeline

πŸ€– Google Cloud Document AI OCR Integration

πŸ“‹ Prerequisites

  • ☁️ Google Cloud Platform (GCP) Account
  • πŸ’³ Active Billing Account
  • πŸ“ Google Cloud Project

πŸ› οΈ Setup Steps

  1. πŸ—οΈ Create Google Cloud Project

    • 🌐 Go to Google Cloud Console
    • βž• Create a new project or select an existing one
    • πŸ’³ Enable billing for the project
  2. πŸ”Œ Enable Required APIs

    # Enable Document AI and Cloud Resource Manager APIs
    gcloud services enable documentai.googleapis.com
    gcloud services enable cloudresourcemanager.googleapis.com
  3. πŸ‘€ Create Service Account

    # Create service account
    gcloud iam service-accounts create passgo-docai-sa \
      --description="Service account for PassGo Document AI" \
      --display-name="PassGo DocAI Service Account"
    
    # Grant necessary permissions
    gcloud projects add-iam-policy-binding YOUR_PROJECT_ID \
      --member="serviceAccount:passgo-docai-sa@YOUR_PROJECT_ID.iam.gserviceaccount.com" \
      --role="roles/documentai.admin"
  4. πŸ”‘ Generate Service Account Key

    gcloud iam service-accounts keys create src/config/google-cloud-credentials.json \
      --iam-account=passgo-docai-sa@YOUR_PROJECT_ID.iam.gserviceaccount.com
  5. βš™οΈ Create Document AI Processor

    • 🌐 Go to Document AI Processors
    • βž• Create a new processor (recommended: FORM_PARSER or OCR)
    • πŸ“ Note down:
      • πŸ“ Project ID
      • πŸ“ Location
      • πŸ†” Processor ID
  6. πŸ”§ Environment Configuration Create a .env.local file with the following:

    GOOGLE_CLOUD_PROJECT_ID=your-project-id
    GOOGLE_CLOUD_LOCATION=your-processor-location
    GOOGLE_CLOUD_PROCESSOR_ID=your-processor-id
    GOOGLE_CLOUD_API_KEY=your-api-key
    

πŸ” Security Considerations

  • ❌ Never commit google-cloud-credentials.json
  • πŸ“ Add to .gitignore:
    src/config/google-cloud-credentials.json
    

πŸ”§ Troubleshooting

  • βœ… Ensure service account has correct permissions
  • πŸ’³ Verify billing is enabled
  • 🌐 Check network connectivity
  • πŸ“„ Validate credentials file format

πŸ“„ Sample Credentials Structure

Create src/config/google-cloud-credentials.json:

{
  "type": "service_account",
  "project_id": "your-project-id",
  "private_key_id": "your-private-key-id",
  "private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n",
  "client_email": "your-service-account-email",
  "client_id": "your-client-id",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/your-service-account-email"
}

πŸ’° Cost Estimation

  • πŸ“Š Document AI pricing varies
  • πŸ’² Check current pricing
  • πŸ“ˆ Monitor usage in Google Cloud Console

⚑ Performance Optimization

  • πŸ—„οΈ Implement caching mechanisms
  • πŸ“¦ Use batch processing for multiple documents
  • ⏱️ Handle rate limits gracefully

πŸ“¦ Recommended Dependencies

pnpm add @google-cloud/documentai google-auth-library

About

PassGo is a Passport Application Submission and Validation System for Sri Lankan Citizens

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages