Skip to content

Backend to website dedicated to helping Turing School of Software and Design students connect with alumni for mentorship and guidance.

Notifications You must be signed in to change notification settings

stoic-plus/turing-mentors-be

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Turing Mentors (API)

About

Turing School of Software and Design is a 7 month intensive experience that prepares people for a career in software development.

The Turing Mission

Turing's mission is to unlock human potential by training a diverse and inclusive student body to succeed in high-fulfillment technical careers. We are a community committed to challenging ourselves and each other to build the knowledge, skills, and understanding needed for long-term success.

Turing mentors

This is the backend to an application that is designed to ease the process of current students finding alumni or other developers to mentor them. Collaboration and community are such a big part of the software development industry - this app seeks to help facilitate that.

Deployed Front End application

Front End Repository

Table of Contents

Overview

Provides three endpoints for user functionality of the app

  • user creation (mentor and mentee)
  • retrieving users (mentors)

Getting Started

Prerequisites

You'll need the following:

Software

Installing

Run the following:

$ git clone https://github.com/stoic-plus/turing-mentors-be.git
$ bundle install

Running Test Suite

(After cloning down repo)

cd turing-mentors-be
rspec

Endpoints

All responses are serialized using fast_json_api gem

Base Url

https://turing-mentors-be.herokuapp.com

GET mentors

GET /api/v1/mentors

Takes two parameters location and tech_skills

location must be specified, tech_skills is optional

location

Three options: all, remote, denver (remote is not denver)

tech_skills

String of comma separated values - all lowercase

Example Request:
GET /api/v1/mentors?location=all&tech_skills=ruby,python
Example Response:
"data": [
  {
            "id": "5",
            "type": "mentor",
            "attributes": {
                "first_name": "Grace",
                "last_name": "Hopper",
                "cohort": 8210,
                "program": "BE",
                "current_job": "computer scientist",
                "background": "One of the first programmers of the Harvard Mark I computer, she was a pioneer of computer programming who invented one of the first linkers",
                "mentor": true,
                "location": "New York, NY",
                "tech_skills": [
                    "ruby",
                    "javascript",
                    "python",
                    "java",
                    "elixir",
                    "c",
                    "php",
                    "swift",
                    "sql"
                ],
                "non_tech_skills": [
                    "stress management",
                    "public speaking",
                    "resumes",
                    "technical interviews",
                    "parenting",
                    "wellness"
                ],
                "availability": {
                    "0": [
                        false,
                        true,
                        false
                    ],
                    "1": [
                        false,
                        false,
                        false
                    ],
                    "2": [
                        false,
                        false,
                        false
                    ],
                    "3": [
                        false,
                        true,
                        false
                    ],
                    "4": [
                        false,
                        false,
                        false
                    ],
                    "5": [
                        false,
                        false,
                        false
                    ],
                    "6": [
                        false,
                        false,
                        false
                    ]
                },
                "identities": [
                    "scientist"
                ],
                "contact_details": {
                  "slack": "@hopper",
                  "email": "[email protected]",
                  "phone": "555-555-5555"
                }
            }
    }
]

Get Mentor and Mentee

GET /api/v1/mentors/:id GET /api/v1/mentees/:id

All parameters are required:

Example Request for /mentors/:id :
GET /api/v1/mentors/5
Content-Type: application/json
Accept: application/json
Example Response:
"data": {
            "id": "5",
            "type": "mentor",
            "attributes": {
                "first_name": "Grace",
                "last_name": "Hoper",
                "cohort": 8210,
                "program": "BE",
                "current_job": "computer scientist",
                "background": "One of the first programmers of the Harvard Mark I computer, she was a pioneer of computer programming who invented one of the first linkers",
                "mentor": true,
                "location": "New York, NY",
                "tech_skills": [
                    "ruby",
                    "javascript",
                    "python",
                    "java",
                    "elixir",
                    "c",
                    "php",
                    "swift",
                    "sql"
                ],
                "non_tech_skills": [
                    "stress management",
                    "public speaking",
                    "resumes",
                    "technical interviews",
                    "parenting",
                    "wellness"
                ],
                "availability": {
                    "0": [
                        false,
                        true,
                        false
                    ],
                    "1": [
                        false,
                        false,
                        false
                    ],
                    "2": [
                        false,
                        false,
                        false
                    ],
                    "3": [
                        false,
                        true,
                        false
                    ],
                    "4": [
                        false,
                        false,
                        false
                    ],
                    "5": [
                        false,
                        false,
                        false
                    ],
                    "6": [
                        false,
                        false,
                        false
                    ]
                },
                "identities": [
                    "scientist"
                ],
                "contact_details": {
                  "slack": "@hopper",
                  "email": "[email protected]",
                  "phone": "555-555-5555"
                }
            }
        }

Example Request for /mentees/:id :
GET /api/v1/mentees/5
Content-Type: application/json
Accept: application/json
Example Response:
"data": {
            "id": "5",
            "type": "mentee",
            "attributes": {
                "first_name": "jordan",
                "last_name": "leranger",
                "cohort": 8210,
                "program": "BE",
                "current_job": "student",
                "background": "A person",
                "mentor": false,
                "location": "Denver, CO",
                "availability": {
                    "0": [
                        false,
                        true,
                        false
                    ],
                    "1": [
                        false,
                        false,
                        false
                    ],
                    "2": [
                        false,
                        false,
                        false
                    ],
                    "3": [
                        false,
                        true,
                        false
                    ],
                    "4": [
                        false,
                        false,
                        false
                    ],
                    "5": [
                        false,
                        false,
                        false
                    ],
                    "6": [
                        false,
                        false,
                        false
                    ]
                },
                "identities": [
                    "ski bum"
                ],
                "contact_details": {
                  "slack": "@slack",
                  "email": "[email protected]",
                  "phone": "555-555-5555"
                }
            }
        }

Background on Endpoints

identities, tech_skills, non_tech_skills

  • all take an array of ids that correspond to rows in those tables
    • To create a mentor that is fluent in Ruby and Python - you would provide: tech_skills: [1, 3] in the body
    • To update a mentee by adding identities - you would provide: identities: [4, 5] in the body

tech_skills, non_tech_skills, location, current_job

  • Are not specified for the /mentee route (for both POST and PUT)

Availability

Is a hash with:

  • Day of week keys (an integer from 0-6)
  • Array, of booleans, value (Boolean for Morning, Afternoon, Evening)
    • "0": [false, false, true] would indicate evening availability on Monday

Mentor and Mentee Creation

POST /api/v1/mentors POST /api/v1/mentees

All parameters are required:

Example Request for /mentors:
POST /api/v1/mentors
Content-Type: application/json
Accept: application/json

{
    "first_name": "Grace",
    "last_name": "Hoper",
    "identities": [0],
    "cohort": 8210,
    "program": "BE",
    "current_job": "computer scientist",
    "location": "New York, NY",
    "slack": "@hopper",
    "email": "[email protected]",
    "phone": "555-555-5555",
    "background": "Grace Brewster Murray Hopper was an American computer scientist and United States Navy rear admiral. One of the first programmers of the Harvard Mark I computer, she was a pioneer of computer programming who invented one of the first linkers",
    "availability": {
        "0": [
            false,
            true,
            false
        ],
        "1": [
            false,
            false,
            false
        ],
        "2": [
            false,
            true,
            false
        ],
        "3": [
            false,
            false,
            false
        ],
        "4": [
            false,
            false,
            false
        ],
        "5": [
            false,
            false,
            false
        ],
        "6": [
            false,
            false,
            false
        ]
    },
    "tech_skills": [
        "4", "1", "3"
    ],
    "non_tech_skills": [
        "6", "5", "4"
    ]
}
Example Response:
{
            "id": "5",
            "type": "mentor",
            "attributes": {
                "first_name": "Grace",
                "last_name": "Hoper",
                "cohort": 8210,
                "program": "BE",
                "current_job": "computer scientist",
                "background": "One of the first programmers of the Harvard Mark I computer, she was a pioneer of computer programming who invented one of the first linkers",
                "mentor": true,
                "location": "New York, NY",
                "tech_skills": [
                    "ruby",
                    "javascript",
                    "python",
                    "java",
                    "elixir",
                    "c",
                    "php",
                    "swift",
                    "sql"
                ],
                "non_tech_skills": [
                    "stress management",
                    "public speaking",
                    "resumes",
                    "technical interviews",
                    "parenting",
                    "wellness"
                ],
                "availability": {
                    "0": [
                        false,
                        true,
                        false
                    ],
                    "1": [
                        false,
                        false,
                        false
                    ],
                    "2": [
                        false,
                        false,
                        false
                    ],
                    "3": [
                        false,
                        true,
                        false
                    ],
                    "4": [
                        false,
                        false,
                        false
                    ],
                    "5": [
                        false,
                        false,
                        false
                    ],
                    "6": [
                        false,
                        false,
                        false
                    ]
                },
                "identities": [
                    "scientist"
                ],
                "contact_details": {
                  "slack": "@hopper",
                  "email": "[email protected]",
                  "phone": "555-555-5555"
                }
            }
        }

Example Request for /mentee:
POST /api/v1/mentees
Content-Type: application/json
Accept: application/json

{
  "background": "A person",
  "cohort": 1810,
  "program": "BE",
  "email": "[email protected]",
  "first_name": "jordan",
  "identities": [8],
  "last_name": "leranger",
  "phone": "555-555-5555",
  "slack": "@slack",
  "availability": {
    0 => [true, false, true],
    1 => true,
    2 => [true, false, false],
    3 => [true, false, true],
    4 => [false, false, true],
    5 => [true, false, true],
    6 => [true, false, false]
  }
}
Example Response:
"data": {
            "id": "5",
            "type": "mentee",
            "attributes": {
                "first_name": "jordan",
                "last_name": "leranger",
                "cohort": 8210,
                "program": "BE",
                "current_job": "student",
                "background": "A person",
                "mentor": false,
                "location": "Denver, CO",
                "availability": {
                    "0": [
                        false,
                        true,
                        false
                    ],
                    "1": [
                        false,
                        false,
                        false
                    ],
                    "2": [
                        false,
                        false,
                        false
                    ],
                    "3": [
                        false,
                        true,
                        false
                    ],
                    "4": [
                        false,
                        false,
                        false
                    ],
                    "5": [
                        false,
                        false,
                        false
                    ],
                    "6": [
                        false,
                        false,
                        false
                    ]
                },
                "identities": [
                    "ski bum"
                ],
                "contact_details": {
                  "slack": "@slack",
                  "email": "[email protected]",
                  "phone": "555-555-5555"
                }
            }
        }

Mentor and Mentee Update

PUT /api/v1/mentors PUT /api/v1/mentees

Not all parameters are required. Very similar to post

Currently the following attributes can only be added to on this endpoint, NOT deleted. That will be a separate endpoint for security purposes.

identities, tech_skills, non_tech_skills

  • Latter two only apply to mentors

Example Request for /mentors:
PUT /api/v1/mentors
Content-Type: application/json
Accept: application/json

{
    "first_name": "Grace",
    "last_name": "Hoper",
    "identities": [0],
    "cohort": 8210,
    "program": "BE",
    "current_job": "computer scientist",
    "location": "New York, NY",
    "slack": "@hopper",
    "email": "[email protected]",
    "phone": "555-555-5555",
    "background": "Grace Brewster Murray Hopper was an American computer scientist and United States Navy rear admiral. One of the first programmers of the Harvard Mark I computer, she was a pioneer of computer programming who invented one of the first linkers",
    "availability": {
        "0": [
            false,
            true,
            false
        ],
        "1": [
            false,
            false,
            false
        ],
        "2": [
            false,
            true,
            false
        ],
        "3": [
            false,
            false,
            false
        ],
        "4": [
            false,
            false,
            false
        ],
        "5": [
            false,
            false,
            false
        ],
        "6": [
            false,
            false,
            false
        ]
    },
    "tech_skills": [
        "4", "1", "3"
    ],
    "non_tech_skills": [
        "6", "5", "4"
    ]
}
Example Response:
{
            "id": "5",
            "type": "mentor",
            "attributes": {
                "first_name": "Grace",
                "last_name": "Hoper",
                "cohort": 8210,
                "program": "BE",
                "current_job": "computer scientist",
                "background": "One of the first programmers of the Harvard Mark I computer, she was a pioneer of computer programming who invented one of the first linkers",
                "mentor": true,
                "location": "New York, NY",
                "tech_skills": [
                    "ruby",
                    "javascript",
                    "python",
                    "java",
                    "elixir",
                    "c",
                    "php",
                    "swift",
                    "sql"
                ],
                "non_tech_skills": [
                    "stress management",
                    "public speaking",
                    "resumes",
                    "technical interviews",
                    "parenting",
                    "wellness"
                ],
                "availability": {
                    "0": [
                        false,
                        true,
                        false
                    ],
                    "1": [
                        false,
                        false,
                        false
                    ],
                    "2": [
                        false,
                        false,
                        false
                    ],
                    "3": [
                        false,
                        true,
                        false
                    ],
                    "4": [
                        false,
                        false,
                        false
                    ],
                    "5": [
                        false,
                        false,
                        false
                    ],
                    "6": [
                        false,
                        false,
                        false
                    ]
                },
                "identities": [
                    "scientist"
                ],
                "contact_details": {
                  "slack": "@hopper",
                  "email": "[email protected]",
                  "phone": "555-555-5555"
                }
            }
        }

Example Request for /mentee:
POST /api/v1/mentees
Content-Type: application/json
Accept: application/json

{
  "background": "A person",
  "cohort": 1810,
  "program": "BE",
  "email": "[email protected]",
  "first_name": "jordan",
  "identities": [8],
  "last_name": "leranger",
  "phone": "555-555-5555",
  "slack": "@slack",
  "availability": {
    0 => [true, false, true],
    1 => true,
    2 => [true, false, false],
    3 => [true, false, true],
    4 => [false, false, true],
    5 => [true, false, true],
    6 => [true, false, false]
  }
}
Example Response:
"data": {
            "id": "5",
            "type": "mentee",
            "attributes": {
                "first_name": "jordan",
                "last_name": "leranger",
                "cohort": 8210,
                "program": "BE",
                "current_job": "student",
                "background": "A person",
                "mentor": false,
                "location": "Denver, CO",
                "availability": {
                    "0": [
                        false,
                        true,
                        false
                    ],
                    "1": [
                        false,
                        false,
                        false
                    ],
                    "2": [
                        false,
                        false,
                        false
                    ],
                    "3": [
                        false,
                        true,
                        false
                    ],
                    "4": [
                        false,
                        false,
                        false
                    ],
                    "5": [
                        false,
                        false,
                        false
                    ],
                    "6": [
                        false,
                        false,
                        false
                    ]
                },
                "identities": [
                    "ski bum"
                ],
                "contact_details": {
                  "slack": "@slack",
                  "email": "[email protected]",
                  "phone": "555-555-5555"
                }
            }
        }

Mentor and Mentee Destroy

DELETE /api/v1/mentors/:id DELETE /api/v1/mentees/:id

Removing a user currently removes entries in the following tables (dependent destroy)

  • contact_details
  • availabilities
  • user_identities
  • user_tech_skills
  • user_non_tech_skills

When those entries are present - mentees have less information


Example Request for /mentors:
DELETE /api/v1/mentors/2
Content-Type: application/json
Accept: application/json

Response

  • Simply a 204 status code

Built With

  • Ruby on Rails
  • Continuous Integration with CircleCi
  • Rspec - Testing Framework
  • fast_jsonapi - JSON serializer for Ruby Objects

Developers

Contributing

We are looking to continually develop this app for Turing School of Software and Design - if you are interested in helping: make a PR to

About

Backend to website dedicated to helping Turing School of Software and Design students connect with alumni for mentorship and guidance.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published