Skip to content

Mood-Boost/mood_boost_be

Repository files navigation

MOOD BOOST (Back End)

Preview

Front End Image

Mood Boost offers simple breathing exercises, inspiring quotes, and a touch of humor to brighten your day and put a smile on your face.

This is the backend portion of the application that contains the database for user accounts and activity tracking/usage inside the front end application. The Mood Boost Front End can be found here.

Deployed Site

Mood Boost

Purpose

The Mood Boost App is designed to enhance users' emotional well-being through engaging and interactive features and was built using a Service-Oriented Architecture (SOA) with a Rails API backend and React frontend.

Goals

  • Deliver a Functional Solution: Address a real-world problem with practical and user-friendly features.
  • Emphasize Team Collaboration: Foster teamwork, project management, and decision-making skills in a multi-app system.
  • Enhance Professional Readiness: Provide hands-on experience with SOA, external APIs, and deployment, preparing developers for industry challenges.
  • Prioritize User Empathy: Create an inclusive, user-centered design by developing detailed user stories and conducting equity analyses.

Getting Started

Clone down the resposity to your location machine, cd into the direcotry and run:

  • bundle install
  • rails db:{drop,create,migrate,seed} or rails db:reset

At this point you can run the backend and run the test suite or test backend functionality by launching the server from the command line:

  • rails s or rails server

To see the app fully functioning you will also need to clone down the front end and run that as well.

Technology Used

  • Ruby v3.2
  • Rails v7.1
  • PostgreSQL
  • JSONAPI-Serializer*
  • rack-cors*

*These are included as gems and installed when bundle install is run from the command prompt.

Database Creation/Initialization

Database Schema

From the command prompt run:

  • rails db:{drop,create,migrate,seed} or rails db:reset

Sample Requests/Responses

GET /api/v1/users

{
  "data": [
    {
      "id": "19",
      "type": "user",
      "attributes": {
        "username": "default",
        "first_name": "Default",
        "email": "[email protected]"
      }
    },
    {
      "id": "20",
      "type": "user",
      "attributes": {
        "username": "apu_nahasapeemapetilon",
        "first_name": "Apu",
        "email": "[email protected]"
      }
    }
  ]
}

GET api/v1/users/20/activities?summary=true

{
    "activity_summary": {
        "View a Quote": 11,
        "View Breathing Guide": 2,
        "View a Joke": 1
    }
}

POST api/v1/users/19/activities

{
    "user_activity": {
        "id": 159,
        "user_id": 19,
        "activity_id": 4,
        "created_at": "2025-01-18T00:05:36.364Z",
        "updated_at": "2025-01-18T00:05:36.364Z"
    }
}

POST /api/v1/users

{
    "data": {
        "id": "31",
        "type": "user",
        "attributes": {
            "username": "stormblessed",
            "first_name": null,
            "email": "[email protected]"
        }
    }
}

Test Suite

  • RSpec
  • Factory Bot
  • Faker
  • Shoulda-Matchers
  • SimpleCov

To run the RSpec tests from the command prompt run:

  • bundle exec rspec spec

Contributors

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages