smartflix's People
smartflix's Issues
Render shows to the homepage
You have just set up a Rails application with a test-driven dummy view!
In this challenge, you will update the application so the root route renders the shows from the provided CSV file.
Here's how it should look by the end of this ticket:
To complete this ticket, you will have to:
- Write a new acceptance test that asserts: when the user visits the homepage, the page content should include each show title in the provided CSV file.
- Configure your Rails app to use Haml for the views.
- Create a new controller to show all shows. Make sure you're following the Rails naming conventions!
- Create a new route so that users visiting the root of your application are directed to the index action of your new controller. Make sure you're following the Rails routing conventions!
- Pass the acceptance test by displaying all shows from the provided CSV file file.
Tips
- There are a lot of shows in the provided CSV file! You may need to limit the number you render to the view.
Import the movies CSV into the database
You've built a Bootstrap-styled homepage displaying all the movies in the provided CSV file.
In this ticket, you'll import that data into your application by storing it in a Postgres database.
To complete this ticket, you must:
- Install Postgres.
- Connect your Rails application to your Postgres database.
- Create the database using the Rails CLI.
- Generate an appropriately-named Rails model (and associated migration) using the Rails Command Line with the following properties:
show_type
, as astring
that is nevernull
.title
, as astring
that is nevernull
.director
, as astring
.cast
, as atext
.country
, as astring
.date_added
, as adate
.release_year
, as aninteger
that is nevernull
.rating
, as astring
.duration
, as astring
.listed_in
, as atext
.description
, as atext
.
Feel free to rename the properties to follow conventions.
- Migrate the database to update it with the new structure.
- Create a new Rake task for importing the CSV. Consider that you'll be importing a lot of data!
- Run the Rake task to import the CSV data into your database. Check that it worked using the Rails Console.
- Rewrite your controller and view to use the database-backed models, instead of reading from the CSV.
Tips
- When generating a model, you should always check (and amend) the generated migration file before running it.
- Rails applications default to using a lightweight in-memory database called
sqlite
. You won't need this any more, so you can remove references tosqlite
from your application (for example, in theGemfile
). - Since shows can only be one of two types ('Movie' or 'TV Show'), consider using a Rails enum for the show type. You may need to generate a Rails migration to do this!
Dockerise the app
In the previous ticket, deployed your app to Heroku using Git.
In this ticket, you will deploy your app to Heroku using Docker.
To complete this ticket, you must:
- Install Docker.
- Define
.dockerignore
. - Create a dedicated Docker image for your application.
- Don't forget about JS dependencies.
- Create
docker-compose.yml
file and configure multiple containers, such as the application, database and so on. - Update
database.yml
file. - Configure environment variables accordingly.
Tips
- The process of readying your app for deployment with Docker is called containerisation (
๐ฝ๏ธ ). - Here (
๐ ) is why Docker is a good idea. - A guide by Semaphore on how to dockerise a Rails app.
Style the homepage
In the previous ticket, you created an unstyled homepage that loads and displays data from the provided CSV file.
In this ticket, you will style that homepage using CSS, Sass, and Bootstrap. Here's what it will look like:
To complete this challenge, you will have to:
- Configure your Rails app to use Sass as a pre-processor.
- Reset any automatic browser styles with a CSS reset.
- Add the Bootstrap CSS framework to your application.
- Style the homepage so it matches the screenshot above. Aim for perfection!
- When you submit a Pull Request for this ticket, include a screenshot of your app's homepage.
Tips
- Consider using Placeholder.com for placeholder images.
- You can have your browser auto-refresh on style changes if you use the Webpacker Dev Server.
- Make sure you use Bootstrap components for most of the heavy lifting.
Setup a new Rails application
Welcome to the Smartflix Basics project!
In this ticket, you will build a basic, dummy, unstyled version of the Smartflix homepage. Here's how it will look:
To complete this ticket, you will need to:
- Set up a new Ruby on Rails app called
smartflix
. - Write an acceptance test using Capybara that asserts: when the user visits the index route (
/
), the page content includesSmartflix
. - Create a new route, controller, and view to pass the acceptance test. Make sure you're following the Rails conventions!
Deploy the app to Heroku using Git
In the previous ticket, you styled the homepage that lists all the movies in the provided CSV.
In this ticket, you will deploy your app to Heroku using Git.
To complete this ticket, you must:
- Create an account on Heroku.
- Deploy the application to Heroku using Git.
- Visit your working, production application!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.