Skip to content

A full-stack application for creating and managing health documents using the Lacuna Signer API made in Django and React

Notifications You must be signed in to change notification settings

LacunaSoftware/SignerPrescriptionReactDjango

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Signer Prescription React App

A full-stack application for creating and managing health documents using the Lacuna Signer API.

Project Structure

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

Frontend (React + TypeScript)

The frontend provides a comprehensive health document creation and signing experience:

Form Features:

  • 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

Backend (Django + Signer API)

The Django backend provides a robust API with full Signer integration:

API Endpoints:

  • POST /api/health-documents/ - Create new prescription document
  • GET /api/health-documents/ - Get document view/download URLs

Setup Instructions

Prerequisites

  • Node.js (v14 or higher)
  • Python (v3.8 or higher)
  • Lacuna Signer API credentials

Frontend Setup

  1. Install Node.js dependencies:
npm install
  1. Start the development server:
npm start

The React app will run on http://localhost:3000

Backend Setup

  1. Navigate to the backend directory:
cd backend
  1. Create a virtual environment:
python -m venv venv
  1. Activate the virtual environment:
# Windows
venv\Scripts\activate

# macOS/Linux
source venv/bin/activate
  1. Install Python dependencies:
pip install -r requirements.txt
  1. Run Django migrations:
python manage.py migrate
  1. Start the Django development server:
python manage.py runserver

The Django API will run on http://localhost:8000

Environment Variables

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

Technologies Used

Frontend:

  • React 18 with TypeScript
  • Axios for API communication
  • Bootstrap for styling
  • Lacuna Signer Widget for document signing

Backend:

  • Django 4.2 with Django REST Framework
  • Signer Python Client for API integration

License

This project is licensed under the MIT License.

About

A full-stack application for creating and managing health documents using the Lacuna Signer API made in Django and React

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published