A modern healthcare onboarding web application built with React, TypeScript, and Flexpa integration.
- Multi-step onboarding process
- Personal information collection
- Health questionnaire
- Secure health records access via Flexpa
- Modern, responsive UI with Tailwind CSS
- Type-safe forms with Zod validation
- Type-safe routing with TanStack Router
- Node.js 18+ (required for native fetch API)
- npm or yarn
- Flexpa API credentials
project-root/
├── client/ # Frontend React application
├── server/ # Backend Express server
└── README.md
-
Clone the repository:
git clone <repository-url> cd <repository-name>
-
Set up environment variables:
# Server environment variables cd server cp .env.example .env # Edit .env and add your FLEXPA_SECRET_KEY # Client environment variables cd ../client cp .env.example .env # Edit .env and add your FLEXPA_PUBLIC_KEY
-
Install dependencies:
# Install server dependencies cd server npm install # Install client dependencies cd ../client npm install
-
Start the development servers:
In one terminal (for the backend):
cd server npm run dev # Server will run on http://localhost:3000
In another terminal (for the frontend):
cd client npm run dev # Client will run on http://localhost:5173
To build for production:
-
Build the client:
cd client npm run build # Output will be in dist/ directory
-
Build the server:
cd server npm run build # Output will be in dist/ directory
-
Run in production:
cd server npm start
GET /health- Health check endpointPOST /api/flexpa/exchange- Exchange Flexpa public tokenGET /api/flexpa/records- Fetch patient recordsPOST /api/onboarding/personal-info- Submit personal informationPOST /api/onboarding/health-info- Submit health questionnaire
- Frontend development server includes hot reloading
- Backend server auto-restarts on file changes
- TypeScript compilation is handled automatically
- Tailwind CSS processes styles in real-time
Common issues:
-
Port conflicts: If ports 3000 or 5173 are in use, you can modify them:
- Server: Change PORT in .env file
- Client: Modify vite.config.ts
-
TypeScript errors: Run type checking:
# In client directory npm run typecheck # In server directory npm run build
-
Environment variables: Ensure all required variables are set in both .env files
- All API endpoints should be properly secured in production
- Health data should be encrypted at rest
- Use secure session management
- Implement proper authentication
- Follow HIPAA compliance guidelines
MIT