- Description
- Technologies Used
- Learning Goals
- How To Use
- Endpoints
- Database Schema
- Challenges
- Successes
- Extensions
- Developers
- Frontend Repo
- Production
SOPHIA is a speech operated personal household interactive assistant. This app is built for two audiences: Clients and Caretakers. Clients are anyone with a disability (physical, cognitive, long-term, temporary) who needs care. Caretakers include anyone who is willing to help take care of clients. Taking care could include running errands, cleaning, yardwork, paying bills, grocery shopping, etc. SOPHIA was built to connect clients to caretakers to help meet their daily needs.
Please reference the user stories to understand the full functionality of SOPHIA.
SOPHIA is an A11Y app with a large focus on accessibility.
This is a unique opportunity that presents some valuable goals:
- Ultimately, demonstrate knowledge you’ve gained throughout Turing
- Use an agile process to turn well defined requirements into deployed and production ready software
- Gain experience dividing applications into components and domains of responsibilities to facilitate multi-developer teams.
- Service oriented architecture concepts and patterns are highly encouraged.
- Explore and implement new concepts, patterns, or libraries that have not been explicitly taught while at Turing
- Practice an advanced, professional git workflow (see whole-team expectations)
- Gain more experience using continuous integration tools to build and automate the deployment of features in various environments
- Build applications that execute in development, test, CI, and production environments
- Focus on communication between front-end and back-end teams in order to complete and deploy features that have been outlined by the project spec
- Clone this repository
cd Sophia-Rails
bundle install
rails db:create
rails db:migrate
rails db:seed
rails server
- Navigate to http://localhost:3000
- Clone this repository
- Make sure docker is running
cd Sophia-Rails
git checkout dockerize
docker-compose build
docker-compose run web rails db:{create,migrate,seed}
docker-compose up
- Navigate to http://localhost:3000
Testing Requests:
bundle exec rspec spec/requests
Testing Google Text to Speech:
Google Speech api will look for an Environment Variable called GOOGLE_APPLICATION_CREDENTIALS that points to the path of key.json assigned by google. More info can be found here in the 'Before you begin' section.
bundle exec rspec spec/services
Testing Models:
bundle exec rspec spec/models
- Single Client
- Client Lists
- Client Tasks
Send a GET request to receive all information related to a single client
if a client does not have diet_restrictions, needs, allergies, or medications, these attributes do not show. The client below has no 'allergies' associated
Content-Type: application/json
Accept: application/json
{
"id": "1",
"username": "katierulz",
"name": "Katie",
"street_address": "123 Test St",
"city": "Denver",
"state": "CO",
"zip": "12345",
"email": "[email protected]",
"phone_number": "1235551234",
"needs": ["groceries", "bills"],
"medications": ["drug_1", "drug_2"],
"diet_restrictions": ["vegetarian", "peanut-free"],
"role": "client",
"created_at": "DateTime",
"updated_at": "DateTime"
}
A valid client ID must be provided otherwise a 404 status code (page not found) will be returned.
Send a POST request to create a client
Content-Type: application/json
Accept: application/json
MUST have password AND password confirmation and they must match
{
"username": "string-required",
"name": "string-required",
"password": "password",
"password_confirmation": "password",
"street_address": "string-required",
"city": "string-required",
"state": "string-required",
"zip": "string-required",
"email": "string-required",
"phone_number": "string-required",
"needs": ["array"],
"allergies": ["array"],
"medications": ["array"],
"diet_restrictions": ["array"],
"role": "client"
}
{
"id": "1",
"username": "katierulz",
"name": "Katie",
"street_address": "123 Test St",
"city": "Denver",
"state": "CO",
"zip": "12345",
"email": "[email protected]",
"phone_number": "1235551234",
"needs": ["groceries", "bills"],
"allergies": ["pollen", "peanuts"],
"medications": ["drug_1", "drug_2"],
"diet_restrictions": ["vegetarian", "peanut-free"],
"role": "client",
"created_at": "DateTime",
"updated_at": "DateTime"
}
{
"email": ["has already been taken"]
}
{
"state": ["can't be blank"]
}
{
"password_confirmation": ["does not match password"]
}
Send a PATCH request to update a clients profile
Content-Type: application/json
Accept: application/json
{
"email": "[email protected]"
}
{
"id": "1",
"username": "katierulz",
"name": "Katie",
"street_address": "123 Test St",
"city": "Denver",
"state": "CO",
"zip": "12345",
"email": "[email protected]",
"phone_number": "1235551234",
"needs": ["groceries", "bills"],
"allergies": ["pollen", "peanuts"],
"medications": ["drug_1", "drug_2"],
"created_at": "DateTime",
"updated_at": "DateTime"
}
A valid client ID must be provided otherwise a 404 status code (page not found) will be returned.
Send a DELETE request to delete a client
will return a 204 status code with no body
A valid client ID must be provided otherwise a 404 status code (page not found) will be returned.
Send a POST request to create a client list
{
"name": "groceries"
}
{
"id": 14,
"name": "groceries",
"client_id": 3,
"created_at": "2019-09-20T23:33:15.377Z",
"updated_at": "2019-09-20T23:33:15.377Z",
"caretaker_id": null
}
[
{
"id": 4,
"name": "Groceries",
"client_id": 3,
"created_at": "2019-09-12T00:47:15.239Z",
"updated_at": "2019-09-12T00:47:15.239Z",
"caretaker_id": 4
},
{
"id": 5,
"name": "Dinner Party Errands",
"client_id": 3,
"created_at": "2019-09-12T00:47:15.250Z",
"updated_at": "2019-09-12T00:47:15.250Z",
"caretaker_id": 4
}
]
{
"name": "yard work"
}
Response:
{
"client_id": 3,
"id": 4,
"name": "yard work",
"created_at": "2019-09-12T00:47:15.239Z",
"updated_at": "2019-09-21T00:00:18.387Z",
"caretaker_id": 4
}
Will return a 204 status code with no body.
A valid client and list id must be provided otherwise a 404 status code (page not found) will be returned.
Send a POST request to create a list task
Content-Type: application/json
Accept: application/json
Due date is optional
{
"name": "task one",
"description": "description of the first task",
"due_date": "2018-12-08"
}
{
"id": 1,
"name": "task_uno",
"description": "description of the first task",
"completed": "false",
"due_date": "2018-12-08"
}
A valid client and list ID must be provided otherwise a 404 status code (page not found) will be returned.
Send a GET request to get all tasks associated with a clients list
Content-Type: application/json
Accept: application/json
[
{"id":83,
"name":"Coriander Seed",
"description":"3 gallon",
"completed":false,
"list_id":349,
"created_at":"2019-09-06T04:43:25.260Z",
"updated_at":"2019-09-06T04:43:25.260Z",
"due_date":"2019-09-17T00:00:00.000Z"},
{"id":84,
"name":"Mung Beans",
"description":"3 gallon",
"completed":false,
"list_id":349,
"created_at":"2019-09-06T04:43:25.262Z",
"updated_at":"2019-09-06T04:43:25.262Z",
"due_date":"2019-09-07T00:00:00.000Z"},
{"id":85,
"name":"Sweet Potato",
"description":"1 gallon",
"completed":false,
"list_id":349,
"created_at":"2019-09-06T04:43:25.263Z",
"updated_at":"2019-09-06T04:43:25.263Z",
"due_date":"2019-09-24T00:00:00.000Z"}
]
A valid client and list ID must be provided otherwise a 404 status code (page not found) will be returned.
Send a PATCH request to update a task
Content-Type: application/json
Accept: application/json
{
name: "updated name"
}
{
"id": 1,
"name": "updated name",
"description": "description of the first task",
"completed": "false",
"due_date": "date_time"
}
A valid client, list, and task ID must be provided otherwise a 404 status code (page not found) will be returned.
Send a DELTE request to delete a task
Will return a 204 status code with no body.
A valid client, list, and task ID must be provided otherwise a 404 status code (page not found) will be returned.
Send a GET request to receive all information related to a single caretaker
{
"id": "1",
"username": "katierulz",
"name": "Katie",
"email": "[email protected]",
"phone_number": "1235551234",
"abilities": "ability_1",
"role": "caretaker",
"created_at": "DateTime",
"updated_at": "DateTime"
}
A valid caretaker ID must be provided otherwise a 404 status code (page not found) will be returned.
Send a POST request to create a caretaker
Content-Type: application/json
Accept: application/json
MUST have password AND password confirmation and they must match
{
"username": "string-required",
"name": "string-required",
"password": "password",
"password_confirmation": "password",
"email": "string-required",
"phone_number": "string-required",
"abilities": "ability_1",
"role": "caretaker"
}
{
"id": "1",
"username": "katierulz",
"name": "Katie",
"email": "[email protected]",
"phone_number": "1235551234",
"abilities": "ability_1",
"role": "caretaker",
"created_at": "DateTime",
"updated_at": "DateTime"
}
{
"message": ["Username has been taken"]
}
{
"message": ["Email has been taken"]
}
{
"password_confirmation": ["does not match password"]
}
Send a PATCH request to update a caretaker
Content-Type: application/json
Accept: application/json
{
"username": "updated_username",
"name": "update_name",
"email": "[email protected]",
"phone_number": "updated_number",
"abilities": "updated_ability_1"
}
{
"id": "1",
"username": "updated_username",
"name": "update_name",
"email": "[email protected]",
"phone_number": "updated_number",
"abilities": "updated_ability_1",
"created_at": "DateTime",
"updated_at": "DateTime"
}
{
"message": ["Username has been taken"]
}
{
"message": ["Email has been taken"]
}
Send a DELETE request to delete a caretaker
will return a 204 status code with no body
A valid caretaker ID must be provided otherwise a 404 status code (page not found) will be returned.
Send a GET request to get a single list associated with a caretaker
{
"id": 1,
"name": "groceries",
"client_id": 2,
"caretaker_id": 4,
"created_at": "2019-09-04T22:14:25.439Z",
"updated_at": "2019-09-04T22:14:25.439Z"
}
A valid caretaker and list ID must be provided otherwise a 404 status code (page not found) will be returned.
Send a GET request to get all the lists associated with a caretaker
[
{
"id": 1,
"name": "groceries",
"client_id": 2,
"caretaker_id": 4,
"created_at": "2019-09-04T22:14:25.439Z",
"updated_at": "2019-09-04T22:14:25.439Z"
},
{
"id": 2,
"name": "bills",
"client_id": 2,
"caretaker_id": 4,
"created_at": "2019-09-04T22:14:25.439Z",
"updated_at": "2019-09-04T22:14:25.439Z"
}
]
A valid caretaker ID must be provided otherwise a 404 status code (page not found) will be returned.
Send a PATCH request to update a task
Content-Type: application/json
Accept: application/json
{
name: "updated name",
completed: "true"
}
{
"id": 1,
"name": "updated name",
"description": "description of the first task",
"completed": "true",
"due_date": "date_time"
}
A valid client, list, and task ID must be provided otherwise a 404 status code (page not found) will be returned.
Send a POST request to get user id from username and password
Content-Type: application/json
Accept: application/json
{
username: "testClient",
password: "pass"
}
returns the user object who matches given username and password
{
"id": "1",
"username": "testClient",
"name": "Katie",
"street_address": "123 Test St",
"city": "Denver",
"state": "CO",
"zip": "12345",
"email": "[email protected]",
"phone_number": "1235551234",
"needs": ["groceries", "bills"],
"medications": ["drug_1", "drug_2"],
"diet_restrictions": ["vegetarian", "peanut-free"],
"created_at": "DateTime",
"updated_at": "DateTime"
}
Returns 400 and body:
{
"message": "Invalid Username/Password"
}
Send a POST request to turn a .caf audio file into text
Google Speech api will look for an Environment Variable called GOOGLE_APPLICATION_CREDENTIALS that points to the path of key.json assigned by google. More info can be found here in the 'Before you begin' section.
Content-Type: application/octet-stream
Body Should contain an audio blob originating from a .caf file
{
"text": "groceries"
}
{
"text": "No Matching Text Found"
}
Technical Debt: This project has two types of users, a client and a caretaker. When planning our database architecture, we were more focused on implementing the client functionality first. When we moved on to implementing the caretaker functionality, we had to rearrange much of the existing routes and controllers to accommodate.
- Implementing Speech to Text
- MVP goals were reached in 2 weeks with front end team
- Implement Websockets to stream audio from front end
- Rearrange routing to allow list and task CRUD without client or caretaker association
- Refactor
protect_from_forgery
methods in controllers
👤 Noah Flint, Vince Carollo, Katie Lewis, Andreea Hanson
- Heroku: Sophia Rails Application