Code Monkey home page Code Monkey logo

chitter-challenge's Introduction

Chitter Challenge Build Status

Task

Build a Twitter clone that will allow users to post messages to a public stream.

User Stories:

As a Maker
So that I can post messages on Chitter as me
I want to sign up for Chitter

As a Maker
So that I can post messages on Chitter as me
I want to log in to Chitter

As a Maker
So that I can avoid others posting messages on Chitter as me
I want to log out of Chitter

As a Maker
So that I can let people know what I am doing  
I want to post a message (peep) to chitter

As a maker
So that I can see what others are saying  
I want to see all peeps in reverse chronological order

As a maker
So that I can better appreciate the context of a peep
I want to see the time at which it was made

My Approach

Besides creating a Minimum Viable Product (MVP) I decided that the main goal of this project was to achieve a Separation of Concerns. This therefore meant keeping the business logic separate from the User Interface (UI). My approach was to therefore work on the logic first and then once all the logic was in place and all the tests were passing (via RSpec) I would work on the layout of the website.

In previous projects I had usually created a single controller to manage all the logic but for this one I decided to create several controllers (listed below) so that my code could be even further separated. The benefits of this are that each controller would have one single responsibility and furthermore it would be easier to make a change to any controller.

I had created the app in Ruby and also adopted the Sinatra framework since they go really well together. As for storing the users and peeps, this was achieved by using DataMapper and PostGresQL. I had also used the 'Bcrypt' gem to encrypt passwords.

One reason why I really like Sinatra is that you can benefit from using its layout template for styling the app. I therefore used a layout file to style the common features of the app and further created separate views for login, sign up and home etc. I had adopted HTML, CSS, Sass and Bootstrap to style the app. Lastly, I had used some jQuery in order to enhance the user experience.

Directory Structure

├── app/
│   ├── controllers/
│   │   ├── base_controller.rb
│   │   ├── maker_controller.rb
│   │   └── peep_controller.rb
│   │
│   ├── models/
│   │   ├── maker.rb
│   │   └── peep.rb
│   │
│   ├── public/
│   │   ├── css/
│   │   │   └── sass/
│   │   ├── fonts/
│   │   ├── images/
│   │   └── js/
│   │
│   ├── views/
│   │   ├── maker/
│   │   │   ├── home.erb
│   │   │   ├── login.erb
│   │   │   └── signup.erb
│   │   └── layout.erb
│   │
│   ├── app.rb
│   └── data_mappper_setup.rb
│
├── spec/
│   │── features/
│   ├── models/
│   ├── spec_helper.rb
│   └── web_helpers.rb
│

App Main Usage and Features

New user can sign up to Chitter:

Sign Up Page

Existing user can login to Chitter:

Login Page

User can post a peep and view all peeps:

Home Page

jQuery Features

User can view a peep close up:

View Peep Close Up

User can delete their own peep:

Delete Peep

User can choose to hide all peeps:

Hide Peeps

User can search for a peep:

Search Peeps

User can see how many characters they have left to use:

Characters Count

User can see how many peeps they have posted in total:

Total Peeps Count

Demo App

Visit the link below to see a live version of the app.

Chitter Web App

Download Instructions

Follow the below instructions on your terminal to download the app:

$ git clone https://github.com/hsheikhm/chitter-challenge.git
$ cd chitter-challenge
$ bundle
$ rackup

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.