📷 JPEG Stash

Built an image repository for users to stash all their best JPEGs. Supports user account creation and image uploads. Supported by a test suite built with Capybara and Selenium on github actions. Live demo deployed to Heroku.

→ ⚡️ Source Code Here! ⚡️ ←

Tests Heroku

JPEG Stash is an image repository where users can stash + share all their best jpegs!
Built with Ruby on Rails. Deployed on Heroku.

Demo

→ 🚀 Live Demo Here! 🚀 ←

Features

🏠 Feed

The main page of JPEG Stash shows a feed of all the images users have uploaded, with the most recent image on top.

🖼️ Image Upload

Users can upload images to JPEG stash. The image must be a JPEG or PNG, and have a maximum size of 3MB.
Since JPEG Stash is deployed on Heroku (which has ephemeral storage), images must be stored elsewhere. I chose to integrate an Amazon S3 bucket for the image storage, and a Postgres database for everything else.

👥 User Access Management

JPEG Stash can be accessed without an account, but creating an account is quick and easy. I implemented simple authentication using bcrypt to encrypt passwords. When a user successfully logs in, a session is created. Logging out destroys this session. Images can only be editted or deleted if the logged in user is also the uploader of the image. Users can be created or deleted, and deleting a user also deletes any images they uploaded.

Further Features

Here are some possible features which could be implemented in the future.

  • ❤️ Interaction: Allow users to comment on each other’s images, or react with emojis
  • 🏷 Tagging: Allow users to add tags to their uploaded images to #categorize and #group images under similar #themes
  • 🔎 Search: Explore all the uploaded images by searching for keywords or tags
  • 👀 Authorization: Allow users to choose who can see their images. Currently, all images have a ‘public’ scope. Allow images to be ‘private’ (only visible to the uploader), ‘unlisted’ (public only to those with a link), or ‘custom’ (uploader specifies which users may view)
  • 🔐 Security: If this app were to go to production, the security would need to be improved. I would likely implement Devise (or similar) as a more robust authentication solution.

Test Suite

Tests
The test suite was created with Capybara, Selenium, and RSpec. They test the functionality of user creation / deletion, and image upload, editting, and deletion. I created a github action to run the tests after every commit or pull request. The change won’t be deployed to Heroku unless all the tests pass.

The tests can be run locally with the following command:

HEADLESS=true bundle exec rspec spec/features
# OR
bundle exec rspec spec/features

Local Setup

Clone this repo, and cd into the jpeg-stash folder.

git clone https://github.com/aethelind/jpeg-stash.git
# OR
git clone git@github.com:aethelind/jpeg-stash.git
cd jpeg-stash

Ensure all the required dependencies are installed:

bundle install

Run the Database Migrations:

rake db:migrate

Serve jpeg-stash:

rails s

jpeg-stash should now be running locally on port 3000!