This is a Ruby on Rails Project designed to inventory my yoyo collection for public display and organization.
After following a few basic tutorials, I wanted to solidify my fresh knowledge with an actual project.
My goal was to design, scope, build and deploy a full project on my own.
The basic requirements were met, all work done by myself.
Yoyos are the main unit of content in this app, which have a title, make + model, image, and a bool for accepting offers.
Modeling the data and their relationships was good practice. For example, a yoyo can have many comments, but only one model, which belongs to one maker (check out app/models for more details).
Populating the model dropdown with the maker subsections took some tinkering (Once logged in, add a yoyo to see).
Sorcery is used for authentication. Right now, there are three states:
- When no users exist, you are logged out and you can create the initial user
- When logged in you can add, edit, destroy yoyos and edit, destroy users
- When Logged out but users exist, you can only log in
Action Storage uploads the images, locally in dev and to an Amazon S3 bucket on production.
PostgreSQL stores the data, and lives in Heroku for production.
Deploying to Heroku required me to migrate from mySQL (works from files) to PostgreSQL (which requires a running service).
- Add the rest of my yoyos to the collection
- Add pagination to keep page loads reasonable, once the yoyo collection grows
form_for
andform_tag
have been soft deprecated, should be updated toform_with
- Comments shouldn't ask for email/name for logged in users
- Log the user in on creation
- Make and model creation could be in the same form as yoyo creation, so you don't have to load pages to add new models/makers
- A contact form to send me offers (and email service to deliver them to me)
- Galleries could be nice
- A lot more data could be gathered, like creation dates, status (sold, gave away, broken), tags, which would warrant some filtering for the homepage
- Styles could be polished further, for example: responsive thumbnail scaling, better readability on some screens, and forms that match the rest of the site
- Could be made to handle multiple collections, either for other users or types of collections just for me
- Streamline the local installation with a sample database and a setup script to import/build the environment in fewer steps
- Rbenv (with Ruby version 2.7.2 or later) manages the environment, ensuring the Ruby version matches the gemfile of the project. Don't forget to
rbenv init -
andrbenv install 2.7.2
- Node.js (Ruby on Rails dependency)
- Yarn (Ruby on Rails dependency)
- Ruby on Rails (version 5.2.3 is required)
- PostgreSQL is the database, on Mac I use the native app
- Clone the project from Github
git clone https://github.com/spencerberry/yoyo_drawer
which downloads the entire app to your local machine cd yoyo_drawer
and then runbundle install
to install all of the required gems (gems are libraries for ruby)- Initialize and start a fresh PostgreSQL database, which needs to be running for the app to fetch and store data
- From the database, add a user for the app to use
CREATE USER yoyos WITH PASSWORD 'plzwork' CREATEDB CREATEROLE LOGIN SUPERUSER;
(this user matches the configuration inyoyo_drawer/config/database.yml
) - Now you can run
rails db:create
to create the database andrails db:migrate
to populate the models - Finally, you can call
rails server
to serve the app and visit the local route to see the app locally, in the development environment: http://127.0.0.1:3000
Feedback encouraged!