Skip to content

Instantly share code, notes, and snippets.

@arnaldoaparicio
Last active August 1, 2022 20:05
Show Gist options
  • Save arnaldoaparicio/c91ffdefd2573c21ba2c3c921760f8e1 to your computer and use it in GitHub Desktop.
Save arnaldoaparicio/c91ffdefd2573c21ba2c3c921760f8e1 to your computer and use it in GitHub Desktop.

Overview

This gist is to document the untitled MUGEN database that is being created using a Ruby on Rails frontend AND backend. Project is a work in progress.

Link to GitHub repos

Frontend: https://github.com/arnaldoaparicio/mugen_db_fe
Backend: https://github.com/arnaldoaparicio/mugen_db

Screenshots

alt text


alt text

Challenges

There have been a few challenges involving the creation of this app. One is implementing Amazon S3 for uploading images from the app. I've noticed several tutorials that go over how to do it on Rails. The problem is that the tutorials I've seen thus far are for a Rails monolith, which would have made the process much more easier and painless to do. Currently, there is only one bucket but next is to create two separate buckets, one for development and the other for production.

Another challenge is uploading an image from the Rails frontend. Initially, I was successful in making the post request required to upload an image and json data using Postman.

alt text

However, I found it to be incredibly difficult to pass an image and json data from the frontend to the backend without the image being converted to pure json once it was passed to the backend. Ultimately I used the Faraday Multipart gem to pass all the necessary data to the backend from the frontend and successfully make a post request.

There were many guides on how to do this with a React frontend and a Rails API backend but none for a Rails frontend and a Rails API backend. As I mentioned above, the tutorials I found that only used Rails was for a monolith, not a separate backend and frontend.

What's next?

  • Clean up code. Location of some code is not very conventional so I may rearrange some code.
  • TESTS TESTS TESTS
  • Make edge cases for a bunch of stuff.
  • Remove attributes from the FighterVariant model
  • Change some of the names of the tables. It may be confusing to someone who may be looking at the code
  • Add styling to the frontend. The frontend has very few styling designs so I'll have to make it pretty.
  • Create two separate buckets; one for development and another for production
  • Possibly change my Amazon S3 buckets permissions. I believe the links to the images provided after uploading are temporary so I may need to change something to make them "permanent".
  • Deploy app to Heroku
  • More developer empathy

Future goals

  • Have more functionality to create a new Character and Fighter.
  • Add user registration to allow user submissions.
  • Implement OAuth, perhaps Google OAuth.
  • Create a banner for this app
  • Maybe make another version of this app utilizing GraphQL instead of HTTP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment