A React-based frontend application for service registration in the Health Monitor system. This frontend is served by the custom backend server and provides a user-friendly interface for registering new health check services.
This frontend application handles the service registration flow when users want to add new health check endpoints to monitor. It receives state information from the Forge app, validates user input, and submits registration data to the backend server.
- Clean, responsive design following Atlassian design principles
- Form validation with real-time feedback
- Loading states and error handling
- Mobile-friendly interface
- Service Registration: Add new health check endpoints
- Input Validation: URL format and required field validation
- State Management: Secure handling of Forge app state
- Error Handling: User-friendly error messages
- Modular Components: Reusable React components
- TypeScript: Full type safety and better development experience
- Utility Functions: Validation and state parsing utilities
- Constants: Centralized styling and configuration
- Node.js 22+
- npm or yarn package manager
-
Install Dependencies
npm install
-
Build for Production
npm run build
-
Build Output
The build process creates static files in the
build-static/directory:build-static/ ├── assets/ │ ├── index-[hash].js │ └── index-[hash].css └── index.html
For development with hot reload:
npm run devsrc/
├── components/ # React components
│ ├── StateInfo.tsx # Display registration details
│ ├── RegistrationForm.tsx # Main registration form
│ ├── Message.tsx # Error/success messages
│ ├── ErrorState.tsx # Error state component
│ └── index.ts # Component exports
├── utils/ # Utility functions
│ ├── validation.ts # Form validation logic
│ ├── state.ts # URL state parsing
│ └── index.ts # Utility exports
├── types.ts # TypeScript type definitions
├── constants.ts # Styling and configuration
├── App.tsx # Main application component
└── index.tsx # Application entry point
-
User Flow:
- User clicks "Add Service" in Forge app
- Forge app redirects to backend with encrypted state
- Frontend parses state and displays registration form
- User enters health check URL and submits
- Backend processes registration and redirects back to Forge
-
State Management:
- Receives encrypted state via URL parameters
- Decodes and validates state information
- Displays registration details to user
- Submits form data to backend API
The frontend communicates with the backend through:
- GET /register: Serves the registration page
- POST /addedMonitorService: Submits registration data
VITE_BACKEND_URL: Backend server URL (optional, can be set at build time)
The application uses Vite for building and bundling. Configuration can be found in vite.config.ts.
- Colors: Atlassian color palette
- Typography: System fonts with proper hierarchy
- Spacing: Consistent spacing scale
- Components: Reusable styled components
- Mobile-first approach
- Flexible grid layouts
- Touch-friendly interface elements
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLint
- TypeScript for type safety
- ESLint for code quality
- Prettier for code formatting
- Component-based architecture
The built files in build-static/ are served by the Express backend server:
app.use(express.static(CONFIG.publicDir));- TypeScript compilation
- Asset bundling and optimization
- Static file generation
- Output to
build-static/directory
- Validates incoming state data
- Sanitizes user input
- Prevents XSS attacks through proper escaping
- Base64 encoding/decoding for state data
- Input validation for all form fields
- Secure handling of sensitive information
-
Build Fails
- Check Node.js version (requires 22+)
- Clear node_modules and reinstall
- Check TypeScript errors
-
State Parsing Errors
- Verify state parameter format
- Check base64 encoding
- Validate state object structure
-
Styling Issues
- Check CSS build output
- Verify asset paths
- Clear browser cache
MIT License - see LICENSE file for details.