Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Rampop01/HR-Platform/llms.txt
Use this file to discover all available pages before exploring further.
Installation Guide
This comprehensive guide covers everything you need to install, configure, and deploy HCMatrix in both development and production environments.System Requirements
Software Prerequisites
Node.js
Version 18.x or higher required
Package Manager
npm 9.x+ or yarn 1.22+
Git
For version control (optional but recommended)
Code Editor
VS Code, WebStorm, or similar
Hardware Requirements
- RAM: Minimum 4GB (8GB recommended for development)
- Storage: At least 500MB free space
- CPU: Modern multi-core processor
Installation Steps
Install dependencies
The project uses modern React and Next.js packages. From This installs all required dependencies:Core Framework:
package.json:11:next@16.1.6- Next.js frameworkreact@19.2.4- React libraryreact-dom@19.2.4- React DOM renderer
@radix-ui/*- Accessible component primitiveslucide-react@0.564.0- Icon librarytailwind-merge@3.3.1- Tailwind utility mergerclass-variance-authority@0.7.1- Component variant styling
react-hook-form@7.54.1- Form state management@hookform/resolvers@3.9.1- Form validation resolverszod@3.24.1- Schema validation
recharts@2.15.0- Chart library
date-fns@4.1.0- Date manipulationclsx@2.1.1- Conditional classnamessonner@1.7.1- Toast notifications
typescript@5.7.3- TypeScript compilertailwindcss@4.2.0- Utility-first CSS framework@types/node,@types/react,@types/react-dom- Type definitions
Understanding the Configuration
Package Scripts
Frompackage.json:5, the following scripts are available:
npm run dev- Start development server with hot reload onhttp://localhost:3000npm run build- Create optimized production build in.next/directorynpm start- Start production server (requires runningnpm run buildfirst)npm run lint- Run ESLint to check code quality
Application Metadata
Fromapp/layout.tsx:9, the application is configured with:
public/logo.png to customize the branding.
API Proxy Configuration
HCMatrix uses Next.js API routes to proxy backend requests and avoid CORS issues. Fromlib/api.ts:2:
Setting Up the Backend Proxy
You’ll need to create a proxy route in your Next.js application: Createapp/api/proxy/[...path]/route.ts:
The proxy automatically forwards authentication headers and request bodies to your backend API.
Authentication Setup
HCMatrix uses localStorage-based session management. Fromlib/auth.ts:1:
Session Structure
Authentication Methods
Theauth utility provides the following methods from lib/auth.ts:12:
Route Protection
Fromapp/page.tsx:7, the home page automatically redirects based on authentication status:
Building for Production
Create production build
- Compiles TypeScript to JavaScript
- Optimizes React components
- Generates static pages where possible
- Minifies CSS and JavaScript
- Creates optimized image assets
.next/ directory.Test production build locally
http://localhost:3000. Test thoroughly before deploying.Environment Variables Reference
| Variable | Required | Description | Example |
|---|---|---|---|
NEXT_PUBLIC_API_URL | Yes | Backend API base URL | https://api.yourcompany.com |
NEXT_PUBLIC_VERCEL_ANALYTICS_ID | No | Vercel Analytics tracking ID | abc123xyz |
Customization
Branding
- Logo: Replace
/public/logo.pngwith your company logo - Login Background: Replace
/public/loginbg.jpgwith your background image - Favicon: Update the
iconandappleproperties inapp/layout.tsx:12 - Title: Modify the
titleinapp/layout.tsx:10
Styling
The application uses Tailwind CSS. Customize the design system by creatingtailwind.config.ts:
Troubleshooting
Build fails with TypeScript errors
Build fails with TypeScript errors
- Ensure TypeScript version is 5.7.3:
npm list typescript - Delete
node_modulesand reinstall:rm -rf node_modules && npm install - Check for type errors:
npx tsc --noEmit - Clear Next.js cache:
rm -rf .next
API requests fail with CORS errors
API requests fail with CORS errors
- Verify the proxy route is correctly set up at
/api/proxy/[...path]/route.ts - Check that
NEXT_PUBLIC_API_URLis correctly configured - Ensure the backend API allows requests from your frontend domain
- Check browser console for detailed CORS error messages
Authentication doesn't persist after refresh
Authentication doesn't persist after refresh
- Check browser localStorage is enabled and not blocked
- Verify the session key
hcmatrix_sessionexists in localStorage - Ensure the auth token hasn’t expired
- Check for JavaScript errors in the browser console
Styles not loading correctly
Styles not loading correctly
- Verify Tailwind CSS is properly configured
- Check that
globals.cssis imported inapp/layout.tsx - Clear browser cache and hard reload
- Rebuild the application:
npm run build
Development server is slow
Development server is slow
- Ensure Node.js version is up to date
- Increase Node.js memory:
NODE_OPTIONS=--max-old-space-size=4096 npm run dev - Disable unnecessary browser extensions
- Check for heavy background processes
Performance Optimization
Production Checklist
- Enable compression on your hosting platform
- Configure CDN for static assets
- Enable HTTP/2 or HTTP/3
- Set appropriate cache headers
- Optimize images using Next.js Image component
- Enable analytics to monitor performance
- Set up error tracking (Sentry, LogRocket, etc.)
- Configure database connection pooling
- Enable gzip/brotli compression
Monitoring
Fromapp/layout.tsx:3, Vercel Analytics is already integrated:
Security Best Practices
Environment Variables
Never commit
.env files. Use .env.example as a template.Authentication Tokens
Tokens are stored in localStorage. Consider implementing token refresh for long-lived sessions.
API Requests
All API calls include Bearer token authentication from
lib/api.ts:76HTTPS Only
Always use HTTPS in production for encrypted communication.
Next Steps
API Reference
Explore all available API endpoints and TypeScript interfaces
Feature Guides
Learn about all the features and UI components
Configuration
Environment setup and deployment instructions
User Guides
Step-by-step guides for common workflows
