Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chitter-challenge - Tara #1215

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ ruby '2.5.0'

gem 'rake'
gem 'rubocop', '0.56.0'
gem 'sinatra'
gem 'capybara'
gem 'data_mapper'
gem 'pg'

group :test do
gem 'rspec'
gem 'simplecov', require: false
gem 'simplecov-console', require: false
end

gem "rack", "~> 2.0"
79 changes: 78 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,18 +1,80 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0)
ansi (1.5.0)
ast (2.4.0)
capybara (3.18.0)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (~> 1.2)
xpath (~> 3.2)
data_mapper (1.0.2)
dm-aggregates (= 1.0.2)
dm-constraints (= 1.0.2)
dm-core (= 1.0.2)
dm-migrations (= 1.0.2)
dm-serializer (= 1.0.2)
dm-timestamps (= 1.0.2)
dm-transactions (= 1.0.2)
dm-types (= 1.0.2)
dm-validations (= 1.0.2)
diff-lcs (1.3)
dm-aggregates (1.0.2)
dm-core (~> 1.0.2)
dm-constraints (1.0.2)
dm-core (~> 1.0.2)
dm-migrations (~> 1.0.2)
dm-core (1.0.2)
addressable (~> 2.2)
extlib (~> 0.9.15)
dm-migrations (1.0.2)
dm-core (~> 1.0.2)
dm-serializer (1.0.2)
dm-core (~> 1.0.2)
fastercsv (~> 1.5.3)
json_pure (~> 1.4)
dm-timestamps (1.0.2)
dm-core (~> 1.0.2)
dm-transactions (1.0.2)
dm-core (~> 1.0.2)
dm-types (1.0.2)
dm-core (~> 1.0.2)
fastercsv (~> 1.5.3)
json_pure (~> 1.4)
stringex (~> 1.1.0)
uuidtools (~> 2.1.1)
dm-validations (1.0.2)
dm-core (~> 1.0.2)
docile (1.1.5)
extlib (0.9.16)
fastercsv (1.5.5)
hirb (0.7.3)
json (2.1.0)
json_pure (1.8.6)
mini_mime (1.0.1)
mini_portile2 (2.4.0)
mustermann (1.0.3)
nokogiri (1.10.3)
mini_portile2 (~> 2.4.0)
parallel (1.12.1)
parser (2.5.1.0)
ast (~> 2.4.0)
pg (1.1.4)
powerpack (0.1.1)
public_suffix (3.0.3)
rack (2.0.7)
rack-protection (2.0.5)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rainbow (3.0.0)
rake (12.3.0)
regexp_parser (1.4.0)
rspec (3.7.0)
rspec-core (~> 3.7.0)
rspec-expectations (~> 3.7.0)
Expand Down Expand Up @@ -43,20 +105,35 @@ GEM
hirb
simplecov
simplecov-html (0.10.2)
sinatra (2.0.5)
mustermann (~> 1.0)
rack (~> 2.0)
rack-protection (= 2.0.5)
tilt (~> 2.0)
stringex (1.1.0)
tilt (2.0.9)
unicode-display_width (1.3.2)
uuidtools (2.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)

PLATFORMS
ruby

DEPENDENCIES
capybara
data_mapper
pg
rack (~> 2.0)
rake
rspec
rubocop (= 0.56.0)
simplecov
simplecov-console
sinatra

RUBY VERSION
ruby 2.5.0p0

BUNDLED WITH
1.16.1
1.17.3
133 changes: 133 additions & 0 deletions Makers_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
Chitter Challenge
=================

* Challenge time: rest of the day and weekend, until Monday 9am
* Feel free to use Google, your notes, books, etc. but work on your own
* If you refer to the solution of another coach or student, please put a link to that in your README
* If you have a partial solution, **still check in a partial solution**
* You must submit a pull request to this repo with your code by 9am Monday morning

Challenge:
-------

As usual please start by forking this repo.

We are going to write a small Twitter clone that will allow the users to post messages to a public stream.

Features:
-------

```
STRAIGHT UP

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

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

HARDER

As a Maker
So that only 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

ADVANCED

As a Maker
So that I can stay constantly tapped in to the shouty box of Chitter
I want to receive an email if I am tagged in a Peep
```

Technical Approach:
-----

This week you integrated a database into Bookmark Manager using the `PG` gem and `SQL` queries. You can continue to use this approach when building Chitter Challenge.

If you'd like more technical challenge this weekend, try using an [Object Relational Mapper](https://en.wikipedia.org/wiki/Object-relational_mapping) as the database interface.

Some useful resources:
**DataMapper**
- [DataMapper ORM](https://datamapper.org/)
- [Sinatra, PostgreSQL & DataMapper recipe](http://recipes.sinatrarb.com/p/databases/postgresql-datamapper)

**ActiveRecord**
- [ActiveRecord ORM](https://guides.rubyonrails.org/active_record_basics.html)
- [Sinatra, PostgreSQL & ActiveRecord recipe](http://recipes.sinatrarb.com/p/databases/postgresql-activerecord?#article)

Notes on functionality:
------

* You don't have to be logged in to see the peeps.
* Makers sign up to chitter with their email, password, name and a username (e.g. [email protected], password123, Sam Morgan, sjmog).
* The username and email are unique.
* Peeps (posts to chitter) have the name of the maker and their user handle.
* Your README should indicate the technologies used, and give instructions on how to install and run the tests.

Bonus:
-----

If you have time you can implement the following:

* In order to start a conversation as a maker I want to reply to a peep from another maker.

And/Or:

* Work on the CSS to make it look good.

Good luck and let the chitter begin!

Code Review
-----------

In code review we'll be hoping to see:

* All tests passing
* High [Test coverage](https://github.com/makersacademy/course/blob/master/pills/test_coverage.md) (>95% is good)
* The code is elegant: every class has a clear responsibility, methods are short etc.

Reviewers will potentially be using this [code review rubric](docs/review.md). Referring to this rubric in advance may make the challenge somewhat easier. You should be the judge of how much challenge you want this weekend.

Automated Tests:
-----

Opening a pull request against this repository will will trigger Travis CI to perform a build of your application and run your full suite of RSpec tests. If any of your tests rely on a connection with your database - and they should - this is likely to cause a problem. The build of your application created by has no connection to the local database you will have created on your machine, so when your tests try to interact with it they'll be unable to do so and will fail.

If you want a green tick against your pull request you'll need to configure Travis' build process by adding the necessary steps for creating your database to the `.travis.yml` file.

- [Travis Basics](https://docs.travis-ci.com/user/tutorial/)
- [Travis - Setting up Databases](https://docs.travis-ci.com/user/database-setup/)

Notes on test coverage
----------------------

Please ensure you have the following **AT THE TOP** of your spec_helper.rb in order to have test coverage stats generated
on your pull request:

```ruby
require 'simplecov'
require 'simplecov-console'

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
SimpleCov::Formatter::Console,
# Want a nice code coverage website? Uncomment this next line!
# SimpleCov::Formatter::HTMLFormatter
])
SimpleCov.start
```

You can see your test coverage when you run your tests. If you want this in a graphical form, uncomment the `HTMLFormatter` line and see what happens!
Loading