ā Frontend Service - API Testing Dashboard
A modern, responsive frontend application built with TypeScript and Express.js for testing backend API endpoints. This service provides an intuitive web interface to interact with backend services and monitor their health status.
ā š Features
Modern UI Design : Clean, responsive interface with professional blue color scheme
API Testing Dashboard : Test multiple backend endpoints with dedicated buttons
Real-time Health Monitoring : Monitor backend service health and status
Comprehensive Debug Logging : Detailed console logging for troubleshooting
TypeScript : Type-safe development with modern JavaScript features
Docker Optimized : Multi-stage build for minimal container size
ā šÆ What This Service Does
This frontend service serves as a centralized API testing dashboard that allows you to:
Test Backend APIs : Interact with backend services through a web interface
Monitor Service Health : Check health and status of backend services
Debug API Calls : View detailed request/response information in console logs
Visual Feedback : Get immediate visual feedback on API call success/failure
ā Available API Tests:
š” Backend API Endpoint : Tests the main backend service (/)
š„ Backend Health Check : Monitors backend health status (/api/healthcheck)
š Backend Status Check : Checks backend running status (/api/status)
ā š ļø Technology Stack
Runtime : Node.js 18
Framework : Express.js
Language : TypeScript
Styling : CSS3 with modern gradients and animations
Package Manager : npm
Containerization : Docker
ā š Quick Start
ā Using Docker (Recommended)
Build the image:
docker build -t frontend-service .
Copy
Run the container:
docker run -p 80:80 -e BACKEND_URL=http://backend-service:8080 frontend-service
Copy
Access the application:
ā Development Mode
Install dependencies:
Start development server:
Build for production:
npm run build
npm start
Copy
ā š Project Structure
frontend/
āāā src/
ā āāā app.ts # Main TypeScript application
āāā dist/ # Compiled JavaScript (generated)
āāā package.json # Dependencies and scripts
āāā tsconfig.json # TypeScript configuration
āāā Dockerfile # Container definition
āāā README.md # This file
Copy
ā š§ Configuration
ā Environment Variables
BACKEND_URL: Backend service URL (default: http://localhost:8080)
NODE_ENV: Node.js environment (default: production)
PORT: Server port (default: 80)
ā Available Scripts
npm run dev: Start development server with hot reload
npm run build: Compile TypeScript to JavaScript
npm start: Start production server
npm run watch: Watch mode for TypeScript compilation
ā šØ UI Features
Responsive Design : Works on desktop and mobile devices
Loading States : Visual feedback during API calls with disabled buttons
Error Handling : Clear error messages and status indicators
Modern Styling : Professional blue color scheme with gradients
Compact Layout : Optimized for efficient space usage
Status Indicators : Visual dots showing service status
ā š API Endpoints
ā Frontend Endpoints
GET / - Main dashboard interface
GET /call-backend - Proxy to backend API
GET /call-backend-healthcheck - Proxy to backend health check
GET /call-backend-status - Proxy to backend status check
GET /healthcheck - Frontend health check
ā š³ Docker Details
ā Image Specifications
Base Image : Node.js 18 Alpine (lightweight)
Port : 80 (configurable)
Size : Optimized with multi-stage build
Dependencies : Production-only packages
ā Build Process
Build Stage : Install all dependencies and compile TypeScript
Production Stage : Copy only compiled code and production dependencies
Result : Minimal production image with only necessary files
ā š Debugging
The application provides comprehensive logging:
Request Logging : All incoming requests with timestamps
API Call Details : Detailed backend API call information
Error Tracking : Complete error information for troubleshooting
Response Monitoring : Full response data and status codes
ā Console Logs Include:
Request timestamps and headers
Backend URL configuration
Response status and data
Detailed error information
Network connectivity issues
ā š Deployment
ā Production Deployment
Build the Docker image
Configure environment variables
Deploy using container orchestration
Set up reverse proxy if needed
ā Scaling
Can be scaled horizontally
Stateless design allows multiple instances
Load balancer can distribute traffic
ā š Performance
Fast Startup : Optimized Docker image for quick container startup
Low Memory : Minimal memory footprint
Efficient Builds : Multi-stage Docker build reduces image size
TypeScript : Compile-time error checking for reliability
ā š¤ Contributing
Fork the repository
Create a feature branch
Make your changes
Test thoroughly
Submit a pull request
ā š License
This project is open source and available under the MIT Licenseā .
ā š Support
For issues and questions:
Check the console logs for detailed error information
Verify the backend service is running and accessible
Check environment variable configuration
Review network connectivity between services
Built with ā¤ļø using TypeScript, Express.js, and Docker