Skip to content

Instantly share code, notes, and snippets.

@dangerrg
Last active September 2, 2021 14:32
Show Gist options
  • Select an option

  • Save dangerrg/1ca1df312c6c4a6d8aae970d628c48bd to your computer and use it in GitHub Desktop.

Select an option

Save dangerrg/1ca1df312c6c4a6d8aae970d628c48bd to your computer and use it in GitHub Desktop.
This web application is a Salsa Blog, called Casineros Cubanos, and it's about Salsa dance and music. It's like a micro-social network, intending to connect people who love Salsa and allow others to learn more about Cuban and Latino culture. With this on Blog, people can share their knowledge, passion, and experience, related to Salsa music and …

Cuban Casineros (Casineros Cubanos)

Description

This web application is a Salsa Blog, called Casineros Cubanos, and it's about Salsa dance and music.

It's like a micro-social network, intending to connect people who love Salsa and allow others to learn more about Cuban and Latino culture.

With this on Blog, people can share their knowledge, passion, and experience, related to Salsa music and dance. Users can create, edit and categorize posts of a related topic. Also, they can upload videos and photos, make comments on other user's articles, on the blog page.

Built with Ruby on Rails

Ruby: v~ 2.6.3

Rails: v- 5.2.6

List of GEMS:

Main gems included in this project:

  • kaminari for pagination
  • carriewave to handle images uploads
  • geocoder to integrate geolocation in Rails with the Google Maps API
  • figaro to handle app variables configuration for deployment
  • bcrypt to secure users password
  • fog-aws to manipulate files on Amazon S3 Storage
  • aws-sdk to make easier the integration of AWS with Rails
  • pg to connect the Rails app to the Postgres database
  • action-mailer to send emails through a contact form and comments to the users
  • redcarpet for markdown support
  • sendgrid-ruby to send emails through Sendgrid services provider
  • bootstrap for some general styling

Database

Postgres is the database used for all environments:

  • Development environment
  • Test environment
  • Production environment

Default users:

Role Login Password
Admin lydia@salseros.cu password
Registered debora@salseros.cu password
Guest / Visitor No required No required

Services

Heroku, for the deployment of this web app:

https://casineros-cubanos.herokuapp.com/ (This version does not include the contact form view)

Sendgrid + ActionMailer: (Contact form)

It sends automatic email responses to the user after submitting the form. On top of this, it will be used to send reminders and notify registered users when updates on the website are made. This works as expected in the development environment, but not in production.

As developers, we learn that every single environment behaves completely different from each other. For me, it is a real challenge to make this feature work in the production environment. Initially, I got a lot of errors, but I could solve them. However, there is still one error: superclass mismatch for class Category (TypeError) which I have not been able to solve yet as the Gem installation gives a bug.

Nevertheless, I could send emails from the project to myself, in other words, I could test the implementation. Even though I get this bug, my professors told me to put it anyway in the project to demonstrate this implementation.

Amazon AWS S3 storage:

It is for users to upload images. I took advantage of Carrierwave and Minimagic gems to accomplish it. Also to ensure that users can only upload images and no other files.

GoogleMaps API: (Geocoder gem)

The initial intention for adding this feature in the project was only to display a static map of Lausanne with a few Salsa schools and Dance clubs in the area. However, the result is even better than my expectations because now users can:

Create new locations and save them in the database Search for places near a specific area of their choosing Interact with fully dynamic maps to Edit and Update places And navigate, zoom in, zoom out, and control the maps as they want I am really happy with this feature because it helped me to understand better the capabilities of the Geocoder gem and to improve my abilities with Javascript. It is also a really good base and experience for my future projects as a developer.

Youtube Iframe API:

I used it to build a dynamic video player that is making use of Javascript for users to listen and watch salsa music videos.

Summary

The differences between my proposal and my final project are as the following:

I decided to apply local translations instead of using globalize gem for content translations. I think it's more suitable in this case to use local translations as it's a blog, and not selling products company.

I changed Facebook API (Facebook authentication) for IFrame API. With IFrame API I was also able to demonstrate de use of Javascript. I found IFrame API more interesting for me to work within this project.

Extra

I included the Markdown feature to give users more flexibility to write and preview articles and comments they make. This gem is well structured and can be configured to prevent malicious content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment