Flatiron Tuition Centre

Simran Manandhar
3 min readDec 13, 2020

Here comes more complexity of my journey to become a Software Engineer. After completing the phase 1 CLI project, we got hit by next section i.e, phase 2 with a Sinatra project. For this project we had to develop a webpage with some requirements stated.

I thought of a project called students report card where teachers as well as students would have a platform to login. Teachers would have all the access until they own it(creating users and their information), could add courses and students and grade them. And students could login to view their grade. But the time was limited for me as I was completing the modules before starting the project. This project I thought of, was huge. So, I had to cut off a lot of controllers and models.

Then, came up with a project named, Flatiron Tuition Centre. I created user_controller for the users to signup and login and teacher_controller where we can create teachers, the course that they will teach and a student to teach to. I used all the seven routes for the the application. These routes works for rendering the data in order to view, edit, post and delete.

Basically what my routes do are:

get ‘/teachers’ will get all the teachers(display all the teachers we have so far in the database).

get ‘/teachers/new’ will get(display) a form to create a new teacher.

get ‘/teachers/:id’ will display a specific teacher we want to look for with the help if the id that is associated with the teacher.

post ‘/teachers’ creates a new teacher that we entered in the form.

get ‘/teachers/:id/edit’ gives us the webpage to edit a specific teacher.

patch ‘/teachers/:id’ is for updating a particular teacher.

delete ‘/teachers/:id’ deletes a teacher of our choice.

For the view page, I had the following files.

These are the files where our html goes in. Whatever we write in this file, are displayed in the webpage.

For user login and signup, I made user_controller and added the routes. In order to make my web application secure, I have used a gem called bcrypt(). It helps in hardening our application against a lot of attacks. Then, a public method has_secure_password was added in the User class as it will give us the setting method and an authenticating method against a BCryprt password. Due to this, we have to add an attribute for a password as xxx_digest. xxx is any name we want to have for the password variable.

I will come up with more dynamic project in the near future. If you are interested in my project demo, here is the video:

--

--