PassGo is a modern web application built with Next.js 14, TypeScript, and Tailwind CSS that streamlines the passport application and management process.
- π 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 Tracking
- β±οΈ Real-time status updates
- π Visual timeline of application progress
- π§ Email notifications for status changes
- ποΈ View application details and history
- β¬οΈ Download submitted documents
- ποΈ 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
- βοΈ 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 Handling
- ποΈ View all scheduled appointments
- β β Approve/reject appointment requests
- β° Manage time slots availability
- π§ Send confirmation emails
- π Track appointment attendance
- π Document Processing
- β Verify uploaded documents
- π Request additional documents
- βοΈ Mark documents as verified
- π Track document verification status
- π‘οΈ Secure user authentication
- π₯ Role-based access control
- π Protected API routes
- π« Session management
- π Password reset functionality
- π± Responsive design
- πβοΈ Dark/Light mode support
- β³ Loading states and animations
β οΈ Error handling and validation- π Toast notifications
- π¬ Modal confirmations
- β Application submission confirmation
- π Status update notifications
- π Appointment confirmations
- π Document verification reminders
- π Collection readiness alerts
- π 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
-
π Prerequisites
Node.js 18+ pnpm
-
β¬οΈ Installation
git clone <repository-url> cd passgo-fe pnpm install
-
βοΈ Environment Setup Create a
.env.localfile: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=
-
π§ Development
pnpm run dev
-
ποΈ Build
pnpm run build pnpm start
PassGo includes a comprehensive CI/CD pipeline using GitHub Actions for automated testing and quality assurance.
The pipeline automatically runs on:
- π€ Push to
mainordevelopmentbranches - π Pull requests to
mainordevelopmentbranches
Pipeline Steps:
- π 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
Quick Pipeline Test:
# Test all CI/CD steps locally (recommended before pushing)
bash scripts/test.shFull Deployment with Docker:
# Run complete pipeline + Docker deployment
bash scripts/deploy.shIndividual Commands:
# Run each step manually
pnpm lint # ESLint checks
npx tsc --noEmit # TypeScript validation
pnpm build # Build verification- π 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
For containerized deployment, see DOCKER.md for detailed instructions.
# 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- ποΈ Multi-stage optimized build
- ποΈ Alpine Linux base for minimal size
- π Health monitoring endpoint
- π§ Environment variable support
- π Production-ready configuration
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 Platform (GCP) Account
- π³ Active Billing Account
- π Google Cloud Project
-
ποΈ Create Google Cloud Project
- π Go to Google Cloud Console
- β Create a new project or select an existing one
- π³ Enable billing for the project
-
π Enable Required APIs
# Enable Document AI and Cloud Resource Manager APIs gcloud services enable documentai.googleapis.com gcloud services enable cloudresourcemanager.googleapis.com
-
π€ 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"
-
π 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
-
βοΈ 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
-
π§ Environment Configuration Create a
.env.localfile 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
- β Never commit
google-cloud-credentials.json - π Add to
.gitignore:src/config/google-cloud-credentials.json
- β Ensure service account has correct permissions
- π³ Verify billing is enabled
- π Check network connectivity
- π Validate credentials file format
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"
}- π Document AI pricing varies
- π² Check current pricing
- π Monitor usage in Google Cloud Console
- ποΈ Implement caching mechanisms
- π¦ Use batch processing for multiple documents
- β±οΈ Handle rate limits gracefully
pnpm add @google-cloud/documentai google-auth-library