A web application for J&J sales representatives to conduct alignment philosophy conversations with surgeons in Total Knee Arthroplasty (TKA).
- Responsive Design: Optimized for tablets and phones with rotation support
- Dual Access:
- Sales reps with SAML SSO authentication
- Unauthenticated access for surgeons
- Conversation Management: Create, load, and manage surgeon conversations
- Scoring System: Maps responses to 4 knee alignment philosophies
- Rich Text Notes: Sales reps can create formatted notes
- PDF Export: Download conversation results
- Searchable Glossary: Medical terms accessible throughout the app
- J&J Branding: Custom Chakra UI theme with J&J color palette
- React 18 with Vite for fast development
- Chakra UI for component library and theming
- React Router for navigation
- Axios for API communication
- React Quill for rich text editing
- jsPDF for PDF generation
- Node.js LTS with Express
- SQL Server database
- Passport.js with SAML strategy for SSO
- Express Session for session management
- Helmet for security headers
- Rate limiting and input validation
- Node.js LTS (18.x or higher)
- SQL Server (2019 or higher)
- Git
-
Clone the repository
git clone <repository-url> cd pathfinder-conversation-guide
-
Install dependencies
Frontend:
cd frontend npm install
Backend:
cd ../backend npm install
-
Database Setup
- Create a SQL Server database named
JNJ-PATHFINDER-CONVERSATION
- Run the schema script:
sqlcmd -S localhost -d JNJ-PATHFINDER-CONVERSATION -i database/schema.sql
- Create a SQL Server database named
-
Environment Configuration
Copy and configure environment variables:
cp .env.example .env
Update the
.env
file with your specific configuration:# Database Configuration DB_SERVER=your-sql-server DB_USER=your-username DB_PASSWORD=your-password DB_NAME=JNJ-PATHFINDER-CONVERSATION # SAML SSO Configuration SAML_ENTRY_POINT=https://your-idp.com/sso/saml SAML_CERT=your-idp-certificate # Session Secret SESSION_SECRET=your-secure-session-secret
-
Start the Application
Development mode (run both simultaneously):
Backend:
cd backend npm run dev
Frontend (in a new terminal):
cd frontend npm run dev
The application will be available at:
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
pathfinder-conversation-guide/
├── frontend/ # React frontend application
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Page components
│ │ ├── contexts/ # React contexts
│ │ ├── services/ # API services
│ │ ├── theme/ # Chakra UI theme
│ │ ├── data/ # Static data (questions.json)
│ │ └── utils/ # Utility functions
│ ├── public/ # Static assets
│ └── package.json
├── backend/ # Node.js/Express backend
│ ├── routes/ # API route handlers
│ ├── config/ # Configuration files
│ ├── middleware/ # Custom middleware
│ ├── models/ # Database models
│ └── server.js # Server entry point
├── database/ # Database scripts
│ └── schema.sql # Database schema
└── README.md
POST /api/auth/saml
- Initiate SAML loginPOST /api/auth/saml/callback
- SAML callbackGET /api/auth/status
- Check authentication statusPOST /api/auth/logout
- Logout userPOST /api/auth/surgeon
- Surgeon access (no auth required)
GET /api/conversations
- List conversations (sales rep only)POST /api/conversations
- Create new conversation (sales rep only)GET /api/conversations/:id
- Get conversation detailsPUT /api/conversations/:id
- Update conversationDELETE /api/conversations/:id
- Delete conversation (sales rep only)POST /api/conversations/:id/responses
- Save question responsesGET /api/conversations/:id/pdf
- Generate PDF export
GET /api/conversations/:id/notes
- Get conversation notesPOST /api/conversations/:id/notes
- Create/update notes (sales rep only)
GET /api/glossary
- Get all glossary termsGET /api/glossary/search?term=:term
- Search glossary terms
The application uses a custom Chakra UI theme configured with J&J's brand colors:
- Primary Red: #eb1700
- Secondary Colors: Blues, greens, oranges from the J&J palette
- Gray Scale: 8 shades from light to dark
- Responsive Breakpoints: Optimized for mobile and tablet
Key tables:
users
- Sales representative informationconversations
- Conversation recordsconversation_responses
- Individual question responsesconversation_notes
- Rich text noteshospitals
- Hospital reference dataglossary_terms
- Medical terminology
Configure your identity provider with:
- ACS URL:
http://localhost:5000/api/auth/saml/callback
- Entity ID:
pathfinder-app
- NameID Format: Email address
- Required Attributes: email, displayName, firstName, lastName
- Update
src/data/questions.json
with new question objects - Each question must include scoring for all 4 alignment types
- Question types supported:
binary
,single_choice
,multiple_choice
The application uses several custom components:
ConversationModal
- Create/load conversationsQuestionCard
- Individual question displayScoreDisplay
- Alignment scoring visualizationGlossaryModal
- Searchable medical glossaryNotesEditor
- Rich text note editing
- Use Chakra UI components and theme colors
- Follow responsive design patterns
- Maintain accessibility standards
- Use J&J brand colors consistently
Frontend:
cd frontend
npm run build
Backend:
cd backend
npm start
Ensure all production environment variables are set:
- Database connection strings
- SAML configuration
- Session secrets
- SSL certificates (if applicable)
Run the schema script on your production database:
-- Run database/schema.sql on production SQL Server
- SAML SSO for sales representative authentication
- Session management with secure cookies
- Rate limiting on API endpoints
- Input validation and sanitization
- SQL injection prevention with parameterized queries
- XSS prevention with content security policy
For technical support or questions about implementation, please contact the development team.
This application is proprietary software developed for Johnson & Johnson.