DEV Community

ggebre
ggebre

Posted on

Sinatra Portfolio Project

As a student at Flatiron bootcamp's software engineering program, students are required to produce five standalone portfolio projects. After I research on project ideas that I can work on, I decided on developing a Sinatra based web application to manage patient and staff information at a hospital. In the web application, a patient and staff can sign up, log in, and schedule appointments with a practitioner. In addition, the staff can register a new patient to the hospitals database and retrieve patients data for scheduling appointments. On the other hand, the practitioner can enter diagnosis and prescription data for a given patient. The patient can also write, edit or delete comments for a practitioner after the patient visited the given practitioner.

Before I started coding the project, I draw a schematics of the different interfaces that the final product must have. In addition, I wrote details of the interactions between the interfaces on the schematics. I then created the file structure for the web app. I used the MVC architecture in organizing these files as shown below.
Alt Text

Controllers

When I created six controllers to implement CRUD routes. The application controller defines the configurations for the app. Two helper methods were defined in the application_controller to authorize users access relevant data to the particular user.
Alt Text
The second controller manages the routes for creation of appointments by either the staff or patient. The comments_controller provides the routes to manage comment that a patient can create, edit or delete. The patient and staffs controllers are created to control the routes for the interaction of a patient and staff. The last controller defines routes for sign up and log in of users.

Models

For the project, I created six models. The models are user, staff, patient, prescription, comment and appointments. Migrations were done for each of these models.

Alt Text

Views

As the last component of the MVC architecture, views create the forms and content that users of the web application interact with. In this project, I created five sets of views to render appointments, comments, patients, staffs, and users related content and forms.
Alt Text

How does the app work?

A patient gets registered by a staff in the hospital before they can sign up to the patient portal. Once the patients information is registered to the hospital's database, they can sign up to the patient portal. Based on the patient's full name and date of birth, the patient gets authorized to create a user account. Once the user account is created, the patient can schedule appointment with a practitioner from the list provided. In addition, the patient is able to view the list of old and upcoming appointments. Once they are seen by the practitioner, the patient can write comment about the practitioner.

Alt Text

As to the staff, the staff can create user accounts which give them access to a search field to find the patient to schedule appointments for. They can also update the patients data.

Alt Text

The practitioner has access to the interface where they can search for a patient using the patients name and enter data about diagnosis and prescriptions to a patient at the end of the visit. The practitioner is also able to view the comments posted.

Top comments (0)