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

Shopify Backend Engineer Technical Challenge: Encyclopedia #298

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ruby-version
@@ -1 +1 @@
3.2.3
3.3.0
9 changes: 7 additions & 2 deletions Gemfile
@@ -1,12 +1,17 @@
source "https://rubygems.org"

ruby "3.2.3"
ruby "3.3.0"

# Adding Bootstrap for styling
gem 'bootstrap', '5.1'

gem 'jquery-rails'

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 7.1.2"

# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
gem "sprockets-rails"
gem "sprockets-rails", ">= 2.3.2"

# Use sqlite3 as the database for Active Record
gem "sqlite3", "~> 1.4"
Expand Down
32 changes: 28 additions & 4 deletions Gemfile.lock
Expand Up @@ -77,17 +77,23 @@ GEM
tzinfo (~> 2.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
autoprefixer-rails (10.4.16.0)
execjs (~> 2)
base64 (0.2.0)
bigdecimal (3.1.6)
bindex (0.8.1)
bootsnap (1.17.1)
msgpack (~> 1.2)
bootstrap (5.1.0)
autoprefixer-rails (>= 9.1.0)
popper_js (>= 2.9.3, < 3)
sassc-rails (>= 2.0.0)
builder (3.2.4)
capybara (3.39.2)
capybara (3.40.0)
addressable
matrix
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
nokogiri (~> 1.11)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
Expand All @@ -102,6 +108,8 @@ GEM
drb (2.2.0)
ruby2_keywords
erubi (1.12.0)
execjs (2.9.1)
ffi (1.16.3)
globalid (1.2.1)
activesupport (>= 6.1)
i18n (1.14.1)
Expand All @@ -117,6 +125,10 @@ GEM
jbuilder (2.11.5)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
jquery-rails (4.6.0)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand Down Expand Up @@ -153,6 +165,7 @@ GEM
racc (~> 1.4)
nokogiri (1.16.0-x86_64-linux)
racc (~> 1.4)
popper_js (2.11.8)
psych (5.1.2)
stringio
public_suffix (5.0.4)
Expand Down Expand Up @@ -205,6 +218,14 @@ GEM
rexml (3.2.6)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
sassc (2.4.0)
ffi (~> 1.9)
sassc-rails (2.1.2)
railties (>= 4.0.0)
sassc (>= 2.0)
sprockets (> 3.0)
sprockets-rails
tilt
selenium-webdriver (4.10.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
Expand All @@ -226,6 +247,7 @@ GEM
railties (>= 6.0.0)
stringio (3.1.0)
thor (1.3.0)
tilt (2.3.0)
timeout (0.4.1)
turbo-rails (1.5.0)
actionpack (>= 6.0.0)
Expand Down Expand Up @@ -260,14 +282,16 @@ PLATFORMS

DEPENDENCIES
bootsnap
bootstrap (= 5.1)
capybara
debug
importmap-rails
jbuilder
jquery-rails
puma (>= 5.0)
rails (~> 7.1.2)
selenium-webdriver
sprockets-rails
sprockets-rails (>= 2.3.2)
sqlite3 (~> 1.4)
stimulus-rails
turbo-rails
Expand All @@ -276,7 +300,7 @@ DEPENDENCIES
webdrivers

RUBY VERSION
ruby 3.2.3p157
ruby 3.3.0p0

BUNDLED WITH
2.5.5
78 changes: 23 additions & 55 deletions README.md
@@ -1,55 +1,23 @@
# Technical Instructions
1. Fork this repo to your local Github account.
2. Create a new branch to complete all your work in.
3. Test your work using the provided tests
4. Create a Pull Request against the Shopify Main branch when you're done and all tests are passing

# Project Overview
The Rails application you will be working on is an Encyclopedia, which allows users to create, view, edit, and delete articles. The application also provides search functionality to help users find relevant articles. Be sure to implement basic CRUD actions on articles. Your task is to implement these features as well as write the code that makes the tests pass.

# Project Goals
The main goal of this internship project is to implement the functionality required to make the existing tests pass. The provided tests cover various aspects of the application, including creating and viewing articles, editing and updating articles, deleting articles, and searching for articles. Along with completing the tests, be sure to implement all basic CRUD actions on your articles on a controller and create views to see your work in the app.

## Your specific goals for this project are as follows:

1. Review Existing Tests: Start by reviewing the existing tests provided in the article_test.rb file located in the test/models directory. Understand the requirements and expectations of each test.

2. Implement Functionality: Write the code necessary to make the existing tests pass. This involves implementing the required actions and logic in the models, controllers, and views to fulfill the specified requirements. Also be sure to implement basic CRUD actions and demonstrate proper MVC principals.

3. Ensure Code Quality: Write clean, well-structured, and maintainable code. Follow best practices and adhere to the Ruby on Rails conventions. Pay attention to code readability, modularity, and performance.

4. Test Your Code: After implementing the functionality, run the tests to ensure that they pass successfully. Fix any failures or errors that occur and retest until all tests pass.

5. Code Documentation: Document your code by adding comments and explanatory notes where necessary. This will help other developers understand your implementation and make future maintenance easier.

6. Version Control: Use Git for version control. Commit your changes regularly and push them to a branch in your forked repository.

7. Create a Pull Request: Once you have completed the project goals, create a pull request to merge your changes into the main repository. Provide a clear description of the changes made and any relevant information for the code review.

## Getting Started
To get started with this project, follow these steps:

1. Clone the repository to your local development environment.

2. Install the necessary dependencies by running bundle install in the project directory.

3. Familiarize yourself with the existing codebase, including the models, controllers, and views.

4. Review the existing tests in the article_test.rb file and understand their purpose and functionality.

5. Run the tests locally to ensure they are passing.

6. Start working on the goals outlined above, making improvements to the existing tests and adding new tests as needed.

7. Commit your changes regularly and push them to a branch in your forked repository.

8. Once you have completed the project goals, create a pull request to merge your changes into the main repository.

## Resources
Here are some resources that may be helpful during your internship project:

- [Ruby on Rails Guides](https://guides.rubyonrails.org/) - Comprehensive guides on Ruby on Rails, covering various aspects of web application development.

- [Ruby Style Guide](https://rubystyle.guide/) - A community-driven Ruby coding style guide to ensure consistent and readable code.

- [Git Documentation](https://git-scm.com/doc) - Official documentation for Git, the version control system used in this project.
# About
- This is the technical challenge portion for the backend developer internship position at Shopify.
- This project is an Encyclopedia where users can perform the basic CRUD functionalities on the site.

# Changes made
- In order to complete the project the following changes were made:
- Model for the Article was added
- Index, show, edit, and update views were added
- Article controller was added
- Styling was added to different components
- Ruby version was changed to 3.3.0

# Result
- This implementation passes all the tests that were integrated

# Improvements
- Due to my workload from work and school, I was not able to spend much time on this project. However, if I had time I would make the following changes to the project:
- Integrate Bootstrap for styling: Even though I tried to get it working, it did not work properly
- Improve UI: As of now, the page is very plain and not user friendly therefore improving the UI will improve the user experience
- Search result display: I would use a list to display the matching article right below the search bar and allow the user to click on it

# Notes
- Thank you so much for your time and consideration, this project was a good learning project for me to get familiar with Ruby on Rails.