This repo is my graduation project for the "Ruby on Rails Bootcamp" program launched in collaboration with iWallet & Patika.dev
Albumist is a simple "User Album Tracker" application. Initially, user, album and album details data are fetched from https://jsonplaceholder.typicode.com via http requests from the routes /users, /albums and /photos with the help of a rake task and saved in the database. Albumist basically has 2 pages. (Homepage and Profile) Homepage lists all users. Profile includes detailed information of the users.
- Then, these data can be updated or new ones created.
- With search input supported by Stimulus and Turbo, recorded users can be searched by
usernameand results can be dynamically listed on theHomepage. - This application styled with Scss has a responsive layout.
- Flash messages that can be closed 3 seconds after being shown (or immediately if you prefer).
- Album details are displayed with a pop-up.
https://github.com/sametpolat7/albumist.gitClone the repo to your local. Make your database settings.
config/database.yml
username: <%= ENV["DATABASE_USERNAME"] %>
password: <%= ENV["DATABASE_PASSWORD"] %>
cd albumist
rails db:create
rails db:migrate
rails s
When you start the server, you should see "User not found." on the Homepage.
Now let's pull the data from the jsonplaceholder API and record it in the database. You need to start the rake task.
rake jsonplaceholder_api:fetch_data
Data fetching will start.
Data fetch and update task completed successfully.
If you see an SSL error like this:
Failed to fetch data from https://jsonplaceholder.typicode.com/users: SSL_connect returned=1 errno=0 peeraddr=104.21.59.19:443 state=error: certificate verify failed
(unable to get local issuer certificate)
This error occurs because the SSL certificate used by the server (jsonplaceholder.typicode.com) could not be verified. This can happen if the certificate chain cannot be traced back to a trusted root certificate authority (CA) on your system.
- Go to https://curl.se/ca/cacert.pem.
- Download the
cacert.pemfile and save it to a known location on your system, for example,C:\Certificates\cacert.pem.
- Open the command prompt.
- Set the
SSL_CERT_FILEenvironment variable to point to the location where you savedcacert.pem:
set SSL_CERT_FILE=C:\Certificates\cacert.pem
And now you can run the rake task again.