Giter Site home page Giter Site logo

manzi-cedrick / health-friendly-pro-tracker Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 227 KB

License: MIT License

Dockerfile 3.27% TypeScript 81.00% Python 5.66% C++ 10.07%
node-ts nodejs rest-api sequalize sqlite supertest typescript swagger-ui arduino pyserial

health-friendly-pro-tracker's Introduction

Health-tracker-pro-backend

This is a codebase for Node.js health tracking project built on Express. It has Docker support as well as Jest, ESLint, and a local development server. Everything is in Typescript.

This was initially built for a Google Cloud Run project, but it could be used anywhere.

Prerequisite

  • Node 18

Getting started

  • Clone the repository
git clone --depth=1 https://github.com/Manzi-Cedrick/health-friendly-typescript.git
  • Install dependencies
cd <project_name>
npm install
  • Run local development server
npm run dev
  • Using postman, curl, or your browser
GET http://localhost:8080
GET http://localhost:8080/patients
GET http://localhost:8080/records
  • To use ESLint
npm run lint
  • To run tests
npm run test

ENV variables

The project uses dotenv to parse environment variables. To add environment variables to your project, simply, create a .env file in the root folder of the project. You can then reference it using process.env.VAR_NAME. For example, to change Node.js mode, simply add NODE_ENV=production or NODE_ENV=development to your .env file to change Node.js mode to production or development accordingly.

Remeber: it's not a good idea to push .env files to your repo!

Logging

This project uses Winston and Morgan for logging. Winston is exported as a logger and can be used to log custom messages on demand. Also, it can be extended to push logs to files, external database, or any logging service.

Morgan is used as an http logger middleware for Express and the logs are routed through Winston, so everything is nicely bundled in one log stream.

All of these logs are written to console during development. Feel free to add production-specific loggers as and when needed.

General notes

  • This is meant to be a health tracking project.Feel free to contribute and add more successive features
  • ESLint is run as part of the build command
  • This project could be deployed to Google Cloud using gcloud CLI without any modifications
gcloud run deploy

health-friendly-pro-tracker's People

Contributors

manzi-cedrick 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.