Skip to content

A GraphQL on Rails API for Eras, an application that allows you to visualize your life holistically in order to live more intentionally.

Notifications You must be signed in to change notification settings

Turing-Eras/api

Repository files navigation


rails-badge ruby-badge build-badge closed-pr-badge

This GraphQL on Rails API serves queries and mutations to Eras, an application that allows you to holistically visualize your life in order to live more intentionally.

After providing info on personal events, you will be shown a visual calendar of your life. By viewing the seemingly fleeting weeks that add up to years and decades, you are able to appreciate the little moments, cherish the time you have with loved ones, and live with more intention.

With Eras, you'll see your life in a whole new way.

Click here to see a short presentation of our approach to the app's MVP.

Readme Content

User Interface

Local Setup

  • Versions
    • Rails 6.1.0
    • Ruby 2.5.3
  • Fork and clone the repository
  • cd in your local repo version and run the following commands
    • To install gems:
      • bundle (if this fails, try to bundle update and then retry)
    • To setup database:
      • rails db:create
      • rails db:migrate
      • rails db:seed
  • Run your own development server:

Test Suite

  • Run with bundle exec rspec
  • All tests should be passing
  • 100.0% test coverage

GraphQL Schema

  • Queries available:
    • Get Single Era:
      {
        getEra(id: #{id}) {
          id
          userId
          name
          startDate
          endDate
          color
          createdAt
          updatedAt
        }
      }
      
    • Get Single Event:
      {
        getEvent(id: "#{event_id}") {
          name
          date
          color
        }
      
    • Get Single User:
      {
        getUser(id: #{id}) {
          id
          name
          email
          birthdate
          eras {
            id
            userId
            name
            startDate
            endDate
            color
            createdAt
            updatedAt
          }
          events {
            id
            userId
            name
            date
            color
            createdAt
            updatedAt
          }
        }
      }
      
    • Get All Users:
      {
        getUsers {
          id
          name
          email
          birthdate
          eras {
            id
          }
        }
      }
      
  • Mutations available:
    • Create User:
      mutation {
        createUser(input:{
            name: "#{name}"
            email: "#{email}"
            birthdate: "#{birthdate}"
            }){
              id
              name
              email
              birthdate
              events {
                id
              }
              eras {
                id
              }
            }
          }
      
    • Update User:
      mutation {
        updateUser(input:{
            id: #{user_id}
            name: "NEW NAME"
            email: "NEW EMAIL"
            birthdate: "NEW BIRTHDATE"
            }) {
              id
              name
              email
              birthdate
              eras {
                id
              }
            }
          }
      
    • Create Era:
      mutation {
            createEra(input:{
                userId: #{id}
                name: "NAME"
                startDate: "START DATE"
                endDate: "START DATE"
                color: "COLOR CODE"
                }) {
                  id
                  userId
                  name
                  startDate
                  endDate
                  color
                }
              }
      
    • Update Era:
      mutation {
            updateEra(input:{
                id: #{era_id}
                name: "NEW NAME"
                startDate: "NEW START DATE"
                endDate: "NEW END DATE"
                color: "NEW COLOR CODE"
                }) {
                  id
                  userId
                  name
                  startDate
                  endDate
                  color
                }
              }
      
    • Delete Era:
      mutation {
        deleteEra(input:{
            id: #{era_id}
            }){
              id
            }
          }
      
    • Create Event:
      mutation {
        createEvent(input:{
            userId: "#{userId}"
            name: "#{name}"
            date: "#{date}"
            color: "#{color}"
            }) {
              id
              userId
              name
              date
              weekNumber
              color
            }
          }
      
    • Update Event:
      mutation {
        updateEvent(input:{
            id: #{event_id}
            name: "NEW NAME"
            date: "NEW DATE"
            color: "NEW COLOR"
            }) {
              id
              name
              date
              color
            }
          }
      
    • Delete Event:
      mutation {
        deleteEvent(input:{
            id: #{event_id}
            }){
              id
            }
          }
      

Database Schema

  • our schema
  • Description of tables:
    • Users: all user accounts (at this point, user must sign up in order to generate a calendar)
    • Eras: a life event that occurs between a period of dates
    • Event: a life event that occurs on one date
    • Questions: list of questions that user can answer to generate events and eras
      • Questions will be a part of onboarding on default if onboarding equals true

Project Board

  • GitHub project
  • Next steps / epics for development:
    • User authentication
    • Extended onboarding
    • Ability to share calendar
    • Media attachments (videos, photos)
    • Visual representation of questions answered vs. questions left

Authors

About

A GraphQL on Rails API for Eras, an application that allows you to visualize your life holistically in order to live more intentionally.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages