A full‑stack healthcare & pharmacy management platform that connects users and pharmacies in a single system. PharmaSetu enables medicine browsing, cart management, secure authentication, order placement, and pharmacy-side medicine administration.
Status: Work in progress — prototype for core user & pharmacy flows.
- Key Features
- Architecture & Tech Stack
- Project structure
- Prerequisites
- Quick Start
- Environment / Configuration
- Authentication Flow
- API Highlights
- Development & Testing
- Deployment & Future Work
- Contributing
- Author
- License
User (customer) capabilities:
- Register / login (JWT-based authentication)
- Browse pharmacies and medicines
- Add medicines to cart and checkout (mock payment)
- Place orders and view order history
- Password reset (token-based)
Pharmacy capabilities:
- Register / login
- Pharmacy dashboard for inventory management
- CRUD operations for medicines
- View and manage incoming orders
- Role-based access control (USER / PHARMACY)
Security:
- JWT authentication
- Role-based authorization
- Protected REST APIs
- Secure password handling
- Frontend: React (Vite), JavaScript (ES6+), CSS, Axios
- Backend: Spring Boot, Spring Security (JWT), Spring Data JPA
- Database: MySQL
- API: RESTful endpoints
- Recommended: Docker + Docker Compose for containerized deployment (future)
PharmaSetu/ ├── backend/ # Spring Boot application (Java) │ ├── src/main/java │ ├── src/main/resources │ │ └── application.properties │ ├── src/test/java │ └── pom.xml ├── frontend/ # React + Vite frontend │ ├── src/ │ ├── public/ │ └── package.json ├── .gitignore └── README.md
(Adjust the tree to match additional folders you may have, e.g., docs/, scripts/, docker/.)
- Java 17+ (or the Java version specified in backend pom.xml)
- Maven 3.6+
- Node.js 16+ and npm (or yarn)
- MySQL server
- (Optional) Docker & Docker Compose
Start the backend, configure DB, then run the frontend.
- Open the
backend/directory. - Configure MySQL connection in
src/main/resources/application.properties(example below). - Build and run:
cd backend
mvn clean package
mvn spring-boot:runDefault backend URL (development): http://localhost:8083
- Open the
frontend/directory. - Install dependencies and run dev server:
cd frontend
npm install
npm run devDefault frontend URL (development): http://localhost:5173
Example Spring Boot properties (backend/src/main/resources/application.properties):
spring.datasource.url=jdbc:mysql://localhost:3306/pharmasetu_db?useSSL=false&serverTimezone=UTC
spring.datasource.username=your_db_user
spring.datasource.password=your_db_password
# server port
server.port=8083
# JWT / security settings (example)
app.jwtSecret=ReplaceWithASecretKey
app.jwtExpirationMs=86400000Frontend environment (example .env or Vite config):
VITE_API_BASE_URL=http://localhost:8083/api
Important: Never commit secrets or production credentials. Use environment variables or a secrets manager.
- User logs in via
/auth/login. - Server issues JWT token on successful authentication.
- Frontend stores token in secure storage (e.g., localStorage or better: httpOnly cookie if moved to production).
- Requests to protected endpoints include
Authorization: Bearer <token>. - Logout clears the stored token.
Common endpoints (add or adjust to match your actual controllers):
- POST /auth/register-user
- POST /auth/register-pharmacy
- POST /auth/login
- POST /auth/forgot-password
- POST /auth/reset-password
- GET /pharmacy/**
- POST /medicine/**
- POST /order/**
(Refer to your backend controllers for exact routes, request/response shapes, and required payloads.)
-
Backend:
- Run unit and integration tests via Maven:
mvn test - Use an in-memory DB profile (H2) for fast tests if implemented.
- Run unit and integration tests via Maven:
-
Frontend:
- Linting, formatting, and unit tests (if present) via
npm run lint/npm test.
- Linting, formatting, and unit tests (if present) via
Consider adding CI (GitHub Actions) to run tests and linters on pull requests.
Planned improvements:
- Real payment gateway integration (Stripe / Razorpay)
- Admin dashboard & role management
- Docker + Docker Compose for reproducible deployments
- Cloud deployment (Heroku / AWS / GCP / Azure)
- Enhanced security (refresh tokens, httpOnly cookies, rate limiting)
- E2E tests and monitoring
Example Dockerization (suggested): Create Dockerfile for backend and frontend, add docker-compose.yml to orchestrate app + MySQL.
Contributions are welcome. Suggested workflow:
- Fork the repository.
- Create a descriptive branch:
feature/<short-desc>orfix/<short-desc>. - Make changes, add tests where applicable.
- Open a pull request with a clear description of changes.
Please follow standard best practices: small PRs, descriptive commits, and include screenshots/records for UI changes.
Vedant Salvi Full-Stack Developer
Repository maintained by: Staycool18
Specify a license for the project (MIT, Apache 2.0, etc.). If you don't have one yet, consider adding an LICENSE file (e.g., MIT).
If you’d like, I can:
- Create a ready-to-commit README.md update and open a PR (I can draft the file contents and a suggested commit message).
- Add a Docker Compose template for local development (backend + frontend + MySQL).
- Standardize environment files and add example
.env.example. Which of these would you like me to do next?