GithubHelp home page GithubHelp logo

tracking-app-backend's Introduction

Tracking App Api built with Ruby on Rails

About the Project

This REST API was built with Ruby on Rails, and Postgres for the databases as the final project at Microverse. With this API, records (measurements) and items (things to measure) can be added, edited, and removed manually interacting with the database in the front-end application.

Please check how this API work in the Tracking App with React which is the front-end application built with React, corresponds to this API.

  • The database has 3 tables and models for User, Item, and Record
    • Users table has username, password, and admin(boolean) columns
    • Items table has title, unit, icon, and target columns
    • Records table has date, result, item_id, and user_id
  • To authorize users, this app uses JWT and Rack-cors

A list of commonly used resources that I find helpful is listed in the acknowledgments.

Built With

Live Demo

Live Demo Link

Getting Started

To get a local copy up and running follow these simple example steps.

  1. On the project GitHub page, navigate to the main page of the repository.
  2. Under the repository name, locate and click on a green button named Code.
  3. Copy the project URL as displayed.
  4. If you're running the Windows Operating System, open your command prompt. On Linux, Open your terminal.
  5. Change the current working directory to the location where you want the cloned directory to be made. Leave as it is if the current location is where you want the project to be.
  6. Type git clone, and then paste the URL you copied in Step 3.
    e.g. $ git clone https://github.com/yourUsername/yourProjectName
  7. Press Enter. Your local copy will be created.
  8. To install all dependencies and necessary gems and node packages
    • bundler install
    • yarn install
  9. Run rails db:setup
  10. Run rails server to run rails application in your local server
  11. Run rspec to run rspec tests

Interact with this API

  1. Go to puma.rb in config/initializers, and rewrite the port from 3000 to 3001 like below: e.g. port ENV.fetch("PORT") { 3001 }

  2. Go to cors.rb in config/initializers, and rewrite the origins path for your frontend path in both local and production

Authentication

  • To manage records and items, it needs to log in with a username and a password. Then, you need to include a token, which is issued and passed by logged in, in the header when interacting with this API like below: headers: { 'Content-Type': 'application/json', Authorization: Bearer ${token}, },
  • Plus, to manage items, it needs to log in with the user account with the admin: true

Author

๐Ÿ‘ค Pacifique Linjanja

Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Show your support

Give a โญ๏ธ if you like this project!

License

"Bodytrack.it " design idea by Gregoire Vella is licensed under Creative Commons license of the design.

Acknowledgements

tracking-app-backend's People

Contributors

pacyl2k19 avatar

Stargazers

 avatar Chiantine P. Manigos 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.