/dog-pics-uploader

Rails app to let people send me pictures of their dogs for my dog breed teaching app.

Primary LanguageRubyApache License 2.0Apache-2.0

README

A web app written using Rails to let people send me pictures of their dogs for my dog breed teaching app. Users upload an image and tag it with their name and which breed it is. The app allows admins to export the metadata database as a CSV and the image library in a zip archive.

Setup

  1. Install ruby (>=3.0.0).

  2. Install rails.

$ gem install rails
  1. Get dependencies by running bundle install and npm install in the app directory.
$ bundle install
$ npm install
  1. Run database migrations.
$ rails db:migrate
  1. Run the server.
$ rails server

Production

  1. Copy master.key into /config, or generate a new key.
  2. Create the database:
RAILS_ENV=production rake db:create db:migrate db:seed
  1. Compile assets:
bundle install
bin/yarn install
rake assets:precompile
  1. Run the server:
rails s -e production

Setting up Admin Accounts

  1. Enable the sign-up page by changing config/initializers/clearance.rb:
Clearance.configure do |config|
  # Other clearance config.

  config.allow_sign_up = true
end
  1. Sign up with an email address and password at https://localhost:3000/sign_up. All accounts can be used to export the database and normal users should not need to, nor be able to sign up.

  2. Disable sign-up.