Frontend aplikasi Sistem Rekam Medis Digital Posyandu Lansia yang dibangun dengan Next.js 14+, React 18+, TypeScript, dan TailwindCSS.
- Features
- Tech Stack
- Prerequisites
- Getting Started
- Environment Variables
- Available Scripts
- Project Structure
- Development
- Testing
- Deployment
- Documentation
- Contributing
- π₯ User management (CRUD petugas)
- π΄ Lansia data management
- π² QR code generation and printing
- π Dashboard with statistics and charts
- π Health reports and analytics
- π± QR code scanning
- π Health examination input
- π Examination history
- π Personal dashboard
- π JWT-based authentication
- π¨ Responsive design (mobile, tablet, desktop)
- βΏ Accessibility compliant (WCAG 2.1 AA)
- π Indonesian language interface
- π Toast notifications
- β‘ Optimized performance
- π‘οΈ Security headers and best practices
- Framework: Next.js 14+ (App Router)
- UI Library: React 18+
- Language: TypeScript 5+
- Styling: TailwindCSS 4
- State Management: React Context API
- HTTP Client: Fetch API with custom wrapper
- QR Code: html5-qrcode, qrcode.react
- Charts: Recharts
- PDF Generation: jspdf, html2canvas
- Icons: Lucide React
Before you begin, ensure you have:
- Node.js 18.x or higher
- npm 9.x or higher
- Backend API running and accessible
- Git for version control
git clone <repository-url>
cd fenpm install# Copy example file
cp .env.example .env.local
# Edit .env.local with your values
# Windows: notepad .env.local
# Mac/Linux: nano .env.localUpdate NEXT_PUBLIC_API_URL with your backend URL.
npm run devOpen http://localhost:3000 in your browser.
Use the credentials from your backend setup:
- Admin: admin@example.com / password123
- Petugas: petugas@example.com / password123
| Variable | Description | Example |
|---|---|---|
NEXT_PUBLIC_API_URL |
Backend API base URL | http://localhost:5000 |
| Variable | Description | Default |
|---|---|---|
NEXT_PUBLIC_APP_NAME |
Application name | Sistem Rekam Medis Digital Posyandu Lansia |
NEXT_PUBLIC_DEBUG |
Enable debug mode | false |
See .env.example for complete list and documentation.
| Script | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm run start |
Start production server |
npm run lint |
Run ESLint |
npm run lint:fix |
Fix ESLint errors |
npm run type-check |
Run TypeScript type checking |
npm run build:production |
Full production build (type-check + lint + build) |
npm run preview |
Build and preview production locally |
npm run clean |
Clean build artifacts and cache |
fe/
βββ app/ # Next.js App Router pages
β βββ (admin)/ # Admin routes
β βββ (petugas)/ # Petugas routes
β βββ login/ # Login page
β βββ layout.tsx # Root layout
β βββ page.tsx # Home page
βββ components/ # React components
β βββ ui/ # Reusable UI components
β βββ layout/ # Layout components
β βββ features/ # Feature-specific components
β βββ providers/ # Context providers
βββ lib/ # Utilities and logic
β βββ api/ # API client and endpoints
β βββ context/ # React contexts
β βββ hooks/ # Custom hooks
β βββ utils/ # Utility functions
βββ types/ # TypeScript type definitions
βββ public/ # Static assets
βββ middleware.ts # Next.js middleware
- Follow TypeScript best practices
- Use functional components with hooks
- Implement proper error handling
- Add JSDoc comments for complex functions
- Follow the existing code structure
- Keep components small and focused
- Use TypeScript interfaces for props
- Implement proper accessibility
- Add loading and error states
- Use semantic HTML
- Use React Context for global state
- Use local state for component-specific data
- Implement custom hooks for reusable logic
- Use the centralized API client (
lib/api/client.ts) - Handle errors gracefully
- Show loading states
- Display user-friendly error messages
npm run type-checknpm run lint- Test all user flows
- Test on different screen sizes
- Test on different browsers
- Test error scenarios
- Test loading states
- Push code to GitHub
- Import project in Vercel
- Add environment variables
- Deploy
See DEPLOYMENT.md for comprehensive deployment guide including:
- Vercel deployment
- Netlify deployment
- Docker deployment
- Environment configuration
- Post-deployment checklist
Before deploying to production, complete the PRODUCTION_CHECKLIST.md.
- DEPLOYMENT.md - Deployment guide
- PRODUCTION_CHECKLIST.md - Pre-deployment checklist
- SETUP.md - Initial setup guide
- AUTHENTICATION.md - Authentication flow
- ACCESSIBILITY.md - Accessibility guidelines
- PERFORMANCE.md - Performance optimization
- lib/utils/ERROR_HANDLING.md - Error handling system
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
Follow conventional commits:
feat:New featurefix:Bug fixdocs:Documentation changesstyle:Code style changesrefactor:Code refactoringtest:Test changeschore:Build/config changes
This project is licensed under the MIT License.
- Developer: [Your Name]
- Designer: [Designer Name]
- Project Manager: [PM Name]
For issues or questions:
- Check documentation in
/docs - Review Next.js Documentation
- Contact development team
- Backend API - Express.js backend
- Documentation - Project documentation
Version: 1.0.0
Last Updated: 2024