Skip to content

A web service, written in C++, that allows you to record all your favourite food recipes, catalog your tableware, and calculate nutrition of a dish you are cooking today.

License

Notifications You must be signed in to change notification settings

lelika1/foodculator

Repository files navigation

Foodculator

CI

Foodculator is a web service, written in C++, that allows you to record all your favourite food recipes, catalog your tableware, and, most importantly, calculate nutrition of a dish you are cooking today.

Build

$ sudo apt-get install g++ make binutils cmake libssl-dev libboost-system-dev zlib1g-dev libsqlite3-dev
$ mkdir build && cd build
$ cmake .. && make -j4

Run

$ foodculator path/to/folder/static /tmp/database.db
  • /version http handler exposes the value of VERSION env variable.
  • PORT env variable is used to override the port (1234 by default).

Build with Docker

$ docker build .

Run in Docker

$ docker run -p 1234:1234 --rm -d \
   --label=com.centurylinklabs.watchtower.stop-signal=SIGKILL \
   -v /root/foodprod:/data \
   --name foodculator \
   docker.pkg.github.com/lelika1/foodculator/foodculator:latest

Implementation details

Foodculator builds with CMake. All its external dependencies are defined as git submodules for this repo.

We use:

  • yhirose/cpp-httplib - to start an HTTP server from within a C++ process.
  • dropbox/json11 - for working with JSON in C++
  • fmtlib/fmt - for better & faster string formatting.
  • google/googletest - for writing unit tests
  • libsqlite3 - it should be installed on your system such that we can statically link with it.

NOTE: It is recommended to put foodculator behind some reverse proxy like nginx that would terminate https and do authentication, if needed.


Icon is made by wanicon from www.flaticon.com

About

A web service, written in C++, that allows you to record all your favourite food recipes, catalog your tableware, and calculate nutrition of a dish you are cooking today.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages