Skip to content

hajekjiri/footr

Repository files navigation

Footr

About

Food tracker is a service that allows you to keep track of what food you eat via its GraphQL API. It's currently built for single-user use, i.e. food records and food items aren't bound to any particular user.

Footr is fully compliant with the JavaScript Standard Style.

Documentation

Documentation for Footr's GraphQL API can be found on my GitHub Pages.

Getting started

0. Requirements

You'll need a running instance of MongoDB to store the records. Make sure to save your connection string URI in the MONGODB_CONNECTION_STRING environment variable or in the .env file. The .env.example file serves as an example.

# File: .env

MONGODB_CONNECTION_STRING='mongodb://localhost:27017/myapp'

1. Setup

Clone the repository and install dependencies

git clone https://github.com/hajekjiri/footr.git
cd footr
npm install

2. Running Footr

Simply start the server with npm run start.

$ npm run start

> [email protected] start /home/jiri/projects/footr
> node app.js

Apollo Server ready at http://localhost:4000/
Connected to database

For development, you'll want to start the server with npm run server which starts it with nodemon and reloads it each time you make any changes.

$ npm run server

> [email protected] server /home/jiri/projects/footr
> nodemon app.js

[nodemon] 2.0.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node app.js`
Apollo Server ready at http://localhost:4000/
Connected to database

3. Using Footr

One of the ways you can interact with Footr is the GraphQL Playground which should be located at http://localhost:4000/graphql once you start the server.

Used external modules