Skip to content

mwanta/vitalHacksProject

Repository files navigation

Health Data Tracker

Summary

A full-stack web application for storing health information,
including sourcing information from the openFDA for drugs.

Features

  • 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

Tech Stack

Frontend

  • Javascript (React, Vite)

Backend

  • Java 21
  • Spring Boot
  • Spring Data JPA / Hibernate
  • openFDA REST API

Database

  • PostgreSQL
  • Three tables: users, drugs (metadata cache), and analyses (generated for users)

Requirements

  • JDK 17 or 21
  • Node.js (LTS)
  • Maven

To Run Locally

Backend

From the project root:

./mvnw spring-boot:run

the backend will start on http://localhost:8080

Frontend

From the client directory:

npm install
npm run dev

The frontend will start on http://localhost:5173

Usage

  1. Register a new account with a name, gender, and age.
  2. Enter medication names to add them to user medication list.
  3. Search for medication usage, precautions, and purpose from openFDA API.

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors