Giter VIP home page Giter VIP logo

chronomeal-api's Introduction

Chronomeal API

This is the back-end API for the Chronomeal app. Chronomeal allows people with chronic pain to record their meals and pain levels, so they or their doctor can look for trends over time.

Installation

  1. git clone https://github.com/MattLong87/chronomeal-api
  2. cd chronomeal-api
  3. npm install
  4. tsc
  5. npm start (or npm run dev)

Authorization flow

  1. When user is created or logs in with username and password, token is generated and returned
  2. Future requests supply token in header: "Authorization: Bearer {token}"

Endpoints

Get all data for one user

GET /api/users/me

User Login

POST /api/login
Required body fields:

  • email (string)
  • password (string)

Create a new user

POST /api/users
Required body fields:

  • email (string)
  • password (string)
  • firstName (string)
  • lastName (string)

Add a meal to a user

POST /api/users/me/add-meal
Required body fields:

  • time (string)
  • food (string)
  • notes (string, even if empty)
  • pain (number)

Delete a meal

DELETE /api/users/me/meals
Required body fields:

  • mealId (string, the _id field in the chosen meal)

chronomeal-api's People

Contributors

mattlong87 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.