Skip to content

Latest commit

 

History

History
120 lines (87 loc) · 4.96 KB

README.md

File metadata and controls

120 lines (87 loc) · 4.96 KB

Healthify

Healthify is a CRUD application built using the Go language and the Gofr framework. It allows users to track their health-related data, including name, age, and daily calories intake.

Table of Contents

Technologies Used

Make sure you have the following installed before running the application:

Features

  • Create: Add new entries with user information such as name, age, and calories intake.
  • Read: Retrieve and display user data, calculate BMI, and assess calories intake.
  • Update: Modify existing entries to keep health information up-to-date.
  • Delete: Remove entries for users who no longer need to be tracked.

Diagrams

Sequence Diagram Screenshot (350) Use Case Diagram Screenshot (353)

Database Structure

The application uses a database table with the following structure:

Field Type Description
id INT Unique identifier
name VARCHAR(255) User's name
age INT User's age
calories INT Daily calories intake

Environment Variables

Database Configuration:

  • DB_HOST: localhost
  • DB_PORT: 3306
  • DB_USER: root
  • DB_PASSWORD: zopsmart123#
  • DB_NAME: health

Getting Started

  1. Clone the Repository:

    git clone https://github.com/hardik2207/healthify.git
    cd healthify
  2. Run the Application:

    go run route.go
  3. Testing with Postman: Use Postman to test the CRUD operations. Import the provided Postman collection for quick and easy testing.

Postman Collection

Run In Postman

API Endpoints

  • POST /user:

    1. Open Postman and set up a POST request to the "addCalories" endpoint.
    2. Provide the {healthify/name/age/calories} in the request body.
    3. Send the request. Screenshot (339) Screenshot (340)
  • GET /users:

    1. Set up a GET request to your "/healthify" endpoint. Screenshot (356)
  • PUT /user/{id}:

    1. Set up a GET request to your "/healthify/id" endpoint.
    2. Enter Json details new name or calories that is to be edited. Screenshot (344) Screenshot (343)
  • DELETE /user/{id}:

    1. Delete a user from the database. Screenshot (347) Screenshot (342)

Testing

The project includes a Postman collection for testing API endpoints.

  • GET Screenshot (355)
  • POST Screenshot (357)
  • PUT Screenshot (349)
  • DELETE Screenshot (358)

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests to improve the project.