GitXplorerGitXplorer
S

go-calorie-tracker

public
2 stars
0 forks
0 issues

Commits

List of commits on branch main.
Unverified
85d99611b0168981e1bb556909a6472da0abe8b9

Remove vendor dir

SSadeedpv committed a year ago
Verified
a5dd2fd06e55bf3e0423c0c0187abcc05fa1073b

Merge pull request #8 from Sadeedpv/docker

SSadeedpv committed a year ago
Unverified
cf8eaf16a318c8d3b54e18413bed192f1dee7993

Remove vendor folder

SSadeedpv committed a year ago
Unverified
a3392b171bb22ab6ba43d296d0433d7b38787ef0

Update go mod

SSadeedpv committed a year ago
Verified
56180b450193f5f3c73f1465a999333eac5ffb32

Merge pull request #7 from Sadeedpv/docker

SSadeedpv committed a year ago
Unverified
a45e8497556ab86bb12b0d4b1f99dea8846469d7

Added Dockerfile

SSadeedpv committed a year ago

README

The README file for this repository.

Go Calorie Tracker

This is a simple Go application that allows users to track their daily calorie intake. The application uses a PostgreSQL database to store the data. The application is built using the Gin framework.

Prerequisites

  • PostgreSQL database
  • Go 1.21 or later
  • Docker

Installation

  1. Clone the repository
git clone https://github.com/Sadeedpv/go-calorie-tracker.git
  1. Install dependencies
go mod download
  1. Create a .env file and add your database credentials
DB_URL=postgres://user:password@localhost:5432/calorie_tracker
  1. Run the application
go run main.go

Usage

The application exposes the following endpoints:

  • /v1/calories: Get all calories
  • /v1/calories: Add a calorie
  • /v1/calories: Delete all calories
  • /v1/calories/:id: Get a calorie by ID
  • /v1/calories/:id: Update a calorie by ID
  • /v1/totalcalories: Get the total number of calories

Docker

You can also run the application using Docker.

  1. Build the image
docker build -t go-calorie-tracker .
  1. Run the container
docker run -p 8000:8000 go-calorie-tracker

Contributing

Contributions are welcome! Please open a pull request if you have any suggestions or improvements.