Skip to content

Jules API is the server-side application of Run the Jules. It consumes the utilities microservice to provide historical usage data and calculate points for Run The Jules users. Users can sign up and compare their electricity usage with their friends or to an anonymous average in their area!

Notifications You must be signed in to change notification settings

run-the-jules/joules-api

Repository files navigation

Contributors Forks Stargazers Issues

Build Status

jules-api

About this App

Jules API is the server-side application of Run the Jules. It consumes the utilities microservice to provide historical usage data and calculate points for Run The Jules users. Users can sign up and compare their electricity usage with their friends or to an anonymous average in their area!

Background and Description

"jules-api" is the backend API only application that handles the bulk of data interface for other applications. jules-api is part of a consultancy group project Run The Jules that student chosen project to build service-oreinted architecture application that allows the user to authenticate through Google and their electricity provider to compare their energy usage with other users.

Goals accomplished

Consumed microservice API endpoints to package data for the frontend to consume
Robust unit and integration testing to ensure data quality
Navigate working together with a larger application base with many moving parts
Learned application design from the perspective of users' needs
Navigate how a small change can have huge impact in a SOA application
Setup continuous integration and deployment
Worked in short 3 or 4 day "Sprints" schedule
Worked in pairs
Deployed on Heroku, see endpoints

Versions

  • Ruby 2.5.3

  • Rails 5.2.4.3

Table of Contents
  1. About The Project
  2. Getting Started
  3. Contributing
  4. License
  5. Contact
  6. Acknowledgements

Built With

Getting Started

Installation

  1. Fork and Clone the repo
    git clone [email protected]:run-the-jules/jules-api.git
    
  2. Install gems
    bundle install
    
  3. Setup the database:
    rails db:setup
    

Endpoints

sample data

Usages

User Data

https://jules-api.herokuapp.com/api/v1/usages/{user_id}
https://jules-api.herokuapp.com/api/v1/friendships?user_id={user_id}

Utility Providers

https://jules-api.herokuapp.com/api/v1/providers

User Authentication Through Provider

https://jules-api.herokuapp.com/api/v1/new_users?email={user_email}&utility={provider_name}
user will be given an authentication url and once authenticated an referral number is provided

Referal

https://jules-api.herokuapp.com/api/v1/get_meters?referral={referral_number}
a meter activation request is sent on our end when the referral number is provided

Friendship table

Relationships

https://jules-api.herokuapp.com/api/v1/friendships/1?user_id={user_id}

Post Request

https://jules-api.herokuapp.com//api/v1/friendships Strong Params {"friendship":{"user_id":"101", "following_id":"202"}}

Database Schema

Screen Shot 2021-03-04 at 9 16 01 PM

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  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

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Frontend Project Link: https://github.com/run-the-jules/run-the-jules

Microservice Project Link: https://github.com/run-the-jules/joules-utility-microservice

Acknowledgements

About

Jules API is the server-side application of Run the Jules. It consumes the utilities microservice to provide historical usage data and calculate points for Run The Jules users. Users can sign up and compare their electricity usage with their friends or to an anonymous average in their area!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published