Skip to content

ursapictura/ThriveWell-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ThriveWell

Technologies Getting Started API Endpoints

ThriveWell API provides the tools needed to track daily changes in chronic health conditions and to establish patterns for those symptoms. Doctors and patients can use the daily journal and symptom logs to track symptoms and their severity every day as well as the potential environmental and physiological triggers for those symptoms.

Overtime, patients and care providers can see which triggers and most likely linked to symptom flair ups and tailor health management plans around those triggers.

This documentation provides detailed information on all API endpoints and request / response formats. To make things easier, examples of request and response has been provided.

View Postman Documentation

💻 Technologies

  • C#
  • EF Core
  • .NET
  • pgAdmin
  • Visual Studio
  • Swagger
  • Postman

🚀 Getting started

To get started with the Cocktail Club API, follow these steps: Set Up Postman:

  1. Download and install Postman Import the ThriveWell Postman collection into Postman by using the Import button and selecting the provided JSON file

  2. Next, fork this repository and clone it to your local machine. Note: This repository uses EF Core and PgAdmin. After that, you'll need to run the following commands inside you project terminal in Visual studio:

dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL --version 6.0
dotnet add package Microsoft.EntityFrameworkCore.Design --version 6.0
dotnet user-secrets init
dotnet user-secrets set "ThriveWellDbConnectionString" "Host=localhost;Port=5432;Username=postgres;Password=<your_postgresql_password>;Database=ThriveWell"
dotnet ef database update
  1. Run the solution in Visual Studio to launch Swagger and copy your localhost URI to use in Postman.

  2. Configure Environment Variables: Set the url variable to the base URL of your API. This is typically http://localhost:7069 for local development. Set the uid variable to the user ID you will be using for testing.

  3. Explore the Endpoints: The collection includes pre-configured requests for various API operations. You can use these requests to interact with the API and see how it works.

Authentication

The primary database entities for this API are user-specific. A UID is required for CRUD capabilties. This can be accomplished one of two ways: Creating a unique UID for each user, comprised of letters and numbers. This is only recommended for API testing purposes. Creating a client-side application which user's Google Authentication. Google will give each user's a unique UID which can then be passed to the API for use as the database UID. This is highly recommended for security and privacy when using in a published application.

Prerequisites

Here you list all prerequisites necessary for running your project. For example:

  • Postman
  • .NET 8
  • pgAdmin
  • Visual Studio

Cloning

How to clone your project

git clone your-project-url-in-github

📍 API Endpoints

The following endpoints are available in the ThriveWell API. ​

Daily Journal

route description
GET /journals/user/{uid} retrieves all of a user's journal entries
GET /journals/user/{uid}/{year}/{month} retrieves all of a user's journal entries from a specific month and year
GET /journals/{id} retrieves a user's specific journal entry
POST /journals creates a new journal entry for a user
PUT /journals/{id} edits a user's journal entry
DELETE /journals/{id} deletes a specific journal entry

Symptom

route description
GET /symptoms/user/{uid} retrieves all of a user's symptom
GET /symptoms/{id} retrieves a user's specific symptom
POST /symptoms creates a new symptom for a user
PUT /symptoms/{id} edits a specific symptom
DELETE /symptoms/{id} deletes a specific symptom

Trigger

route description
GET /triggers/user/{uid} retrieves all of a user's trigger
GET /triggers/{id} retrieves a user's specific trigger
GET /triggers/user/{uid}/topfive retrieves a user's top five recurring triggers from the last 30 days
POST /triggers creates a new trigger for a user
PUT /triggers/{id} edits a specific trigger
DELETE /triggers/{id} deletes a specific trigger

Symptom Log

route description
GET /logs/user/{uid} retrieves all of a user's symptom logs
GET /logs/{uid}/date/{year}/{month}/{day} retrieves all of a user's symptom logs by a specific date
GET /logs/{uid}/thirydays retrieves all of a user's symptom logs from the last 30 days
GET /logs/{id} retrieves a user's specific symptom log
POST /logs creates a new symptom log for a user
PUT /logs/{id} edits a specific log
DELETE /logs/{id} deletes a specific log

SymptomTrigger

route description
POST /symptom-trigger create a new symptom trigger for a user's symptom log
DELETE /symptom-trigger/{id} deletes a specific symptom trigger from a symptom log

Documentations that might help

📝 Postman Documentation

💻 Project ERD

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages