Home

Awesome

ChronLife

Ruby on Rails CI

This repository contains my full-stack side project, which is a social platform for people with chronic diseases.

Technologies used in this project:

<p> <img src="https://img.shields.io/badge/ruby-%23CC342D.svg?style=for-the-badge&logo=ruby&logoColor=white" alt="Ruby"> <img src="https://img.shields.io/badge/rails_7-%23CC0000.svg?style=for-the-badge&logo=ruby-on-rails&logoColor=white" alt="Rails"> <img src="https://img.shields.io/badge/hotwire-%234c4c4c.svg?style=for-the-badge&logo=hotwire&logoColor=white" alt="Hotwire"> <img src="https://img.shields.io/badge/postgresql_15-%23316192.svg?style=for-the-badge&logo=postgresql&logoColor=white" alt="Postgres"> <img src="https://img.shields.io/badge/redis-%23DD0031.svg?style=for-the-badge&logo=redis&logoColor=white" alt="Redis"> <img src="https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white" alt="Docker"> </p>

homepage showing hero section of the platform

What is this project about?

The idea of this project, is to provide very simple and user friendly platform, where users can manage their chronic diseases, share their experiences with other people, find new friends and support each other.

Checkout the screenshots from the application with detailed explanations below for more details.

Getting started

  1. Install the following dependencies:
  1. Create .env file in the root directory and fill it with the necessary data. You can use .env.example as a template. To setup ActiveRecord encryption, you can use the following command:
bin/rails db:encryption:init
  1. Setup docker containers for local development:
docker-compose up -d
  1. Finally, execute the following commands:
# Install dependencies
bundle install

# Setup the Rails application:
./bin/setup

# Run the application:
./bin/dev
  1. Sign in to the app:

Depending on the locale, the seed data will be different. For each locale (:en is default one), there is a predefined user with the following credentials (the Atopic Dematitis disease in the panel has some predefined data):

:en locale:

:pl locale:

Design

I've came up with the design of this application by myself. I am not using any tools like Figma to create UI. I'm just creating the design on the fly. While working by myself, I really like this approach.

95% of SCSS code is also written by myself. I am not using any predefined templates, themes, blocks, utilities or component libraries, besides a few Stimulus Components or Quill Editor.

Maybe I'm weird, but I enjoy getting my hands dirty with CSS.

Hotwire (Turbo + Stimulus)

This application is my first take on Turbo (I've used Stimulus before, so it's not that big deal).

I haven't used the Turbo features in the whole project, but only in a few places, where the application required eager-loaded frames or some interactivity, like the comments section and reactions for disease statuses, friend requests, some of the forms and flash messages.

RSpec & Rubocop

Right now, there are only model specs (406 examples, 0 failures), but I'm planning to add system specs in the future.

If the GitHub CI passes, it means that there all specs are passing and there are no Rubocop offenses in the codebase.

Note: The test database requires seeding. Also, if you are switching between locales, you need to seed the test database again:

RAILS_ENV=test bin/rails db:reset

I18n

This application is I18n-ready, offering full translation support for both Polish and English languages.

If you want to change the locale of the application, you can do it by changing the I18n.locale value in the config/initializers/locale.rb file.

# config/initializers/locale.rb

I18n.default_locale = :en

Remember to reset and seed the database again after changing the locale, if you want to see the data in the new language.

Application overview

Below is a list of features that I've already implemented or I'm planning to implement in the future.

Auth

sign up screen sign in screen reset password two factor authentication screen two factor authentication screen

Dashboard

dash_home

Diseases

diseases add_disease

Disease Panel

disease edit_disease

Disease Statuses

disease_statuses edit_disease_status

Disease Statuses - Comments and Likes

disease_status

Disease Symptoms

disease_symptoms disease_symptom new_disease_symptom

Disease Risk Factors

disease_risk_factors disease_risk_factor

Disease Treatments

treatments treatment edit_treatment

Disease Photos

disease_photos disease_photo

Groups

groups

Group Posts

group_posts

Group Disease Statuses

group_disease_statuses

Group Disease Symptoms

group_disease_symptoms

Group Disease Risk Factors

group_risk_factors

Group Disease Treatments

group_treatments

Group Disease Photos

group_disease_photos

Measurements

measurements measurements_calendar measurements_charts measurements_by_day measurement measurement_raports

Notes

notes note new_note

Account

account

All users

accounts

Friends

friend_requests

Specialists

specialists specialist_profile specialists_requests

Articles

articles new_article article

Settings

settings settings_privacy settings_backup_codes

ERD Diagram

Below is the current ERD diagram of the application.

settings

TODO

Important

Less important, but also important

Final thoughts

Working on large side projects is incredibly time-consuming, and I didn't anticipate it to be to this extent. I'm pleased that I managed to complete the basic version of the project, as seen in the screenshots, in nearly 1.5 months. It's physically impossible to write such a substantial amount of code within a limited timeframe on my own.

One of the most time consuming parts of this project was the design and writing CSS. My goal was to create a simple and user friendly design from scratch without using any predefined templates, themes, blocks, utilities or component libraries.

Even though there are still a lot of things to do, I'm proud of what I've accomplished so far. I've learned a lot of new things, and I'm sure that I will learn even more while working on this project in the future.