A full-stack application for creating and managing health documents using the Lacuna Signer API.
SignerPrescriptionReact/
├── src/ # React TypeScript frontend
│ ├── components/ # React components
│ │ └── HealthDocumentForm.tsx # Main form component
│ ├── types/ # TypeScript interfaces
│ │ └── HealthDocument.ts # Type definitions
│ ├── App.tsx # Main app component with signing flow
│ └── index.tsx # React entry point
├── backend/ # Django backend
│ ├── signer_project/ # Django project settings
│ ├── health_documents/ # Django app for health documents
│ │ ├── views.py # API endpoints
│ │ ├── signer_utils.py # Signer API integration utilities
│ │ └── urls.py # URL routing
│ ├── resources/ # Template files
│ │ └── Template-Prescricao.pdf # PDF template
│ ├── manage.py # Django management script
│ └── requirements.txt # Python dependencies
├── public/ # Static files
└── package.json # Node.js dependencies
The frontend provides a comprehensive health document creation and signing experience:
- Patient Information: Patient name and details
- Medical Items: Dynamic list of medications with name, description, and dosage
- Professional Information: Doctor CRM and region
- Real-time Validation: Form validation and error handling
The Django backend provides a robust API with full Signer integration:
POST /api/health-documents/
- Create new prescription documentGET /api/health-documents/
- Get document view/download URLs
- Node.js (v14 or higher)
- Python (v3.8 or higher)
- Lacuna Signer API credentials
- Install Node.js dependencies:
npm install
- Start the development server:
npm start
The React app will run on http://localhost:3000
- Navigate to the backend directory:
cd backend
- Create a virtual environment:
python -m venv venv
- Activate the virtual environment:
# Windows
venv\Scripts\activate
# macOS/Linux
source venv/bin/activate
- Install Python dependencies:
pip install -r requirements.txt
- Run Django migrations:
python manage.py migrate
- Start the Django development server:
python manage.py runserver
The Django API will run on http://localhost:8000
Create a .env
file in the backend directory:
DEBUG=True
SIGNER_API_KEY=your-signer-api-key
SIGNER_BASE_URL=https://signer-lac.azurewebsites.net
- React 18 with TypeScript
- Axios for API communication
- Bootstrap for styling
- Lacuna Signer Widget for document signing
- Django 4.2 with Django REST Framework
- Signer Python Client for API integration
This project is licensed under the MIT License.