Sketchbook is a web application used to help artists manage and share their sketches, and to allow users to search and explore the sketches of others. It is built with an AngularJS front end and a Rails serialized JSON back end.
You can see a demo version of the application deployed to Heroku here: https://angular-sketchbook.herokuapp.com/
Users can create an account, upload images (sketches), and view the sketches of other artists through searching and filtering based on tags. With AngularJS, it works as a single page application and communicates with the back end asynchronously.
- Back end dependencies are handled by Bundler and specified in the Gemfile.
- Front end dependencies are handled by Yarn and Webpacker and specified in the package.json file.
- Authentication (user registration and login) is handled by the Rails Devise gem and implemented in AngularJS with Angular Devise.
- Image uploading is managed by Active Storage, and facilitated in AngularJS with ng-file-upload. For production, it's configured to use AWS S3 to store images.
- Serialization (responding to requests with data converted to JSON) is handled by Active Model Serializers.
To get it running in development, install dependencies from the Gemfile via Bundler by running bundle install
. Front end dependencies are managed with Yarn. Follow the instructions here to install Yarn. Once Yarn is installed, you can install dependencies from the package.json file by running yarn install
. Styles are included in the CSS manifest file.
Since the application uses PostgreSQL, you need to have it installed locally on your machine with a user that has table creation privileges. You can get further instructions here.
Create the database with bundle exec rails db:create
and run migrations with bundle exec rails db:migrate
, then run bundle exec rails db:seed
to populate the database with sample artists and sketches.
For production, the application is configured to use AWS S3. You can read more about setting up S3 here (with Heroku).
The back end test suite is developed using Rspec via the rspec-rails gem with shoulda-matchers. Model factories are set up with FactoryBot.
Rspec tests are located under the /spec
directory. In order to run tests, run bundle exec rspec
followed by an optional folder or file under the /spec
directory (for example, if you only want to test models, run bundle exec rspec spec/models
).
You can read a blog post going further into the application here.
This project is open source under the terms of the MIT License.