A full-stack web application for storing health information,
including sourcing information from the openFDA for drugs.
- Add health attributes, such as heart rate, to the user profile.
- Add medications to the user profile and search for information such as usage and side effects.
- Cache drug metadata in a PostgreSQL database to reduce redundant API calls
- Javascript (React, Vite)
- Java 21
- Spring Boot
- Spring Data JPA / Hibernate
- openFDA REST API
- PostgreSQL
- Three tables: users, drugs (metadata cache), and analyses (generated for users)
- JDK 17 or 21
- Node.js (LTS)
- Maven
From the project root:
./mvnw spring-boot:run
the backend will start on http://localhost:8080
From the client directory:
npm install
npm run dev
The frontend will start on http://localhost:5173
- Register a new account with a name, gender, and age.
- Enter medication names to add them to user medication list.
- Search for medication usage, precautions, and purpose from openFDA API.
The backend exposes the following endpoints:
GET /api/drug/{drugName} — fetch drug metadata (checks cache first)
DELETE /api/drug/{drugName} — deletes the drug metadata from the database
GET /api/users — list all users
POST /api/users — add a user
DELETE /api/users — delete a user
GET /api/users/{userId} — find a specific user
GET /api/users/{userId}/drugs — fetch all drugs associated with this user.
GET /api/users/{userId}/analyses — fetch all analyses associated with this user.
POST /api/users/{userId}/analyses — creates an analysis for this user.
POST /api/users/{userId}/drugs/{drugID} — adds a drug to this user.