Skip to content

Node.js/Express backend for SymptomPulse. Manages symptom/medication data, integrates Open FDA API, and handles JWT authentication. Built with TypeScript, MySQL, and Prisma ORM for robust data modeling.

License

Notifications You must be signed in to change notification settings

gayanukabulegoda/SymptomPulse-BACKEND

Repository files navigation


SymptomPulse Logo

SymptomPulse BACKEND

Welcome to the SymptomPulse backend repository! This Node.js/Express API (powered by TypeScript, Prisma, and MySQL) is the backbone of the SymptomPulse mobile application, which empowers users to check symptoms, receive potential condition insights via the OpenFDA API, manage medications with reminders, and securely track their health history.
Explore the project »

· Report Bug · Request Feature


Table of Contents
  1. About The Project
  2. Getting Started
  3. API Documentation
  4. Frontend Repository
  5. License

About The Project

SymptomPulse is a mobile application designed to assist users in monitoring their health by checking symptoms and managing medications effectively. With an intuitive interface and robust backend support, users can easily:

  • Select Symptoms: Choose from a comprehensive list (e.g., "headache," "fever") to check for potential medical conditions.
  • Receive Condition Insights: Leverage the OpenFDA API to get possible medical condition suggestions based on the symptoms selected.
  • Manage Medications: Add and schedule medications with reminders including dosage and timing.
  • Track History: Securely view and analyze their symptom and medication history.

The backend handles all data processing, API integrations, and user authentication, ensuring a secure and reliable experience.

Core Features

  1. Symptom Selection & Analysis
    Users can select symptoms from a predefined list and get possible medical conditions based on data from the OpenFDA API.

  2. Medication Management
    Add medications with detailed reminders (time, dosage) to ensure users never miss a dose.

  3. Secure History Tracking
    All user data is stored securely, allowing users to view their symptom and medication history at any time.

  4. Robust Authentication
    JSON Web Tokens (JWT) and Bcrypt are utilized to ensure secure user authentication and authorization.

  5. Efficient Data Handling
    Built with MySQL and Prisma ORM, the backend provides robust data modeling and management capabilities.

(back to top)


Built With

This backend is powered by a modern, scalable stack ensuring robust performance and maintainability:

Node.js Express.js TypeScript Prisma MySQL JWT Bcrypt Postman

(back to top)


Getting Started

Follow these instructions to set up the SymptomPulse BACKEND on your local machine.

Prerequisites

  1. Node.js (v22+ recommended)
    Download & Install Node.js
  2. MySQL
    Download & Install MySQL
  3. npm or yarn (npm comes bundled with Node.js)
    Install Yarn
  4. Postman (optional, for API testing)
    Download Postman

Installation and Setup

  1. Clone the repository

    git clone https://github.com/gayanukabulegoda/SymptomPulse-BACKEND.git

    Navigate into the project directory:

    cd SymptomPulse-BACKEND
  2. Install dependencies

    npm install

    or

    yarn install
  3. Configure Environment Variables
    Create a .env file in the root directory and add the following configuration:

    DATABASE_URL="mysql://<username>:<password>@localhost:3306/symptompulse_db"
    JWT_SECRET="your_jwt_secret_key"
    JWT_EXPIRES_IN="7d"  # adjust as necessary
    PORT=5000
    NODE_ENV=development
    CURRENT_API_VERSION = "v1"
    CLIENT_URL = "http://localhost:8081"
    OPENFDA_API_URL="https://api.fda.gov/drug/event.json"

    Adjust the values based on your local or production environment.

  4. Database Setup with Prisma
    Run the Prisma migrations to set up your database schema:

    npx prisma migrate dev

    This will synchronize your MySQL database with the schema defined in prisma/schema.prisma.

Usage

  1. Start the Development Server

    npm run dev

    or

    yarn dev

    The server should now be running at http://localhost:5000.

  2. Build & Run for Production

    npm run build
    npm start

    or

    yarn build
    yarn start

    This compiles the TypeScript code to JavaScript and starts the production server.

  3. Testing (if applicable)
    To run tests:

    npm run test

    or

    yarn test

(back to top)


API Documentation

Detailed API documentation—including endpoints, request/response formats, and sample payloads—is available via our Postman Collection.

  • Ensure the server is running before making requests.
  • The Postman documentation provides all necessary information to integrate and test the API effectively.

(back to top)


Frontend Repository

The frontend for SymptomPulse is built with modern web technologies. For more information, please visit the SymptomPulse FRONTEND repository:


License

Distributed under the MIT License. See LICENSE for more details.

(back to top)



About

Node.js/Express backend for SymptomPulse. Manages symptom/medication data, integrates Open FDA API, and handles JWT authentication. Built with TypeScript, MySQL, and Prisma ORM for robust data modeling.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published