A comprehensive medical prescription management system built with React frontend and Spring Boot backend. This system allows healthcare professionals to search for medicines, create prescriptions, and generate shareable prescription receipts with unique hash-based links.
- Medicine Search: Advanced search functionality to find medicines by name, category, or active ingredients
- Prescription Management: Create and manage medical prescriptions with multiple medicines
- Receipt Generation: Generate unique prescription receipts with shareable hash-based links
- User Authentication: Secure JWT-based authentication system with refresh token support
- Professional Interface: Clean, modern UI designed for healthcare professionals
- Prescription Notes: Add specific usage instructions for each medicine
- React 18+ - Modern JavaScript framework
- Redux Toolkit - State management
- React Router - Navigation and routing
- Axios - HTTP client for API calls
- CSS3 - Custom styling
- Spring Boot 3.x - Java framework
- Spring Security - Authentication and authorization
- JWT (JSON Web Tokens) - Secure authentication
- JPA/Hibernate - Database ORM
- MySQL/PostgreSQL - Database (configurable)
- Maven - Dependency management
medical-prescription-system/
βββ frontend/ # React application
β βββ src/
β β βββ components/ # React components
β β βββ Redux/ # Redux store and slices
β β βββ Service/ # API service layer
β β βββ css/ # Stylesheets
βββ backend/ # Spring Boot application
β βββ src/main/java/com/reciept/backend/
β β βββ controller/ # REST controllers
β β βββ service/ # Business logic layer
β β βββ entity/ # JPA entities
β β βββ repository/ # Data access layer
β β βββ dto/ # Data transfer objects
β β βββ security/ # Security configuration
β βββ pom.xml # Maven dependencies
βββ README.md
- Node.js (v16 or higher)
- npm or yarn
- Java 17 or higher
- Maven 3.6+
- MySQL or PostgreSQL database
-
Clone the repository
git clone <repository-url> cd medical-prescription-system/backend
-
Configure Database
Update
application.propertiesorapplication.yml:spring.datasource.url=jdbc:mysql://localhost:3306/prescription_db spring.datasource.username=your_username spring.datasource.password=your_password spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true # JWT Configuration jwt.secret=your-secret-key jwt.expiration=86400000
-
Install Dependencies & Run
mvn clean install mvn spring-boot:run
The backend server will start on
http://localhost:8080 -
Database Schema
The application will automatically create the following tables:
users- User authentication datamedicines- Medicine catalogprescriptions- Prescription recordsprescription_medicines- Many-to-many relationshiprefresh_tokens- JWT refresh tokens
-
Navigate to frontend directory
cd ../frontend -
Install Dependencies
npm install # or yarn install -
Configure API Base URL
Update the API base URL in
src/Service/api.js:const API_BASE_URL = 'http://localhost:8080';
-
Start Development Server
npm start # or yarn startThe frontend will start on
http://localhost:3000
POST /register- User registrationPOST /authenticate- User loginPOST /refresh-access- Refresh access token
GET /medicine?keyword={search_term}- Search medicines
POST /save/medicine- Create new prescriptionGET /get-prescription?hashId={hash}- Get prescription by hash ID
- Users register/login using email and password
- JWT tokens are issued for secure API access
- Refresh tokens ensure seamless user experience
- Healthcare professionals search for medicines using keywords
- Real-time search with debounced API calls
- Results show medicine name, category, and dosage form
- Select multiple medicines from search results
- Add specific usage instructions for each medicine
- Create prescription with unique hash ID
- Each prescription gets a unique 8-character hash ID
- Shareable links:
/receipt/{hashId} - Professional receipt format with all prescription details
User Search β Medicine Selection β Add Notes β Create Prescription β Generate Receipt β Share Link
- JWT Authentication: Secure token-based authentication
- Password Encryption: BCrypt password hashing
- Refresh Tokens: Automatic token renewal
- CORS Configuration: Cross-origin request handling
- Input Validation: Server-side request validation
- Responsive Design: Works on desktop and mobile devices
- Professional Interface: Clean, medical-focused design
- Real-time Search: Instant medicine search results
- Loading States: User-friendly loading indicators
- Error Handling: Graceful error messages
- Intuitive Navigation: Easy-to-use interface for healthcare professionals
- User: Healthcare professional accounts
- Medicine: Medicine catalog with categories and dosage forms
- Prescription: Prescription records with hash IDs
- RefreshToken: JWT refresh token management
- User β Prescriptions (One-to-Many)
- Prescription β Medicines (Many-to-Many)
- User β RefreshTokens (One-to-Many)
- Build the application:
mvn clean package - Deploy the JAR file to your server
- Configure production database settings
- Set up reverse proxy (Nginx) if needed
- Build for production:
npm run build - Deploy the
buildfolder to web server - Configure API endpoints for production
- Set up HTTPS for security
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE.md file for details.
For support and questions:
- Create an issue in the repository
- Contact the development team
- Check the documentation
Note: This system is designed for educational and demonstration purposes. For production use in medical environments, ensure compliance with healthcare regulations like HIPAA, GDPR, and local medical data protection laws.