WeB3

Made By Emma Johnson!

What is my project and what makes it awesome?

My project, WeB3, is a website that is specifically geared towards non males to make it easier for them to share their music. You can add your band to the website for free and post links to the songs your band has created.

How did you come up with your idea?

A few weeks ago, I was in a camp specifically for teaching girls how to start a band, and they talked a lot about how while there are quite a few female musicians out there, they are not all well known. This website I decided, will help change that.

What is the hardest piece of code or what was a problem you had to solve?

This is some of the code that saves the information when you add a band to the website. Its only job is to save (there is a different code for creating).
                            
  post "/headed_home/:id" do 
  user_id = params[:id].to_i
  @user = User.find(user_id)
  @band = Band.create(name: params["band_name"])
  @user.bands << @band
  @user.save
  
  if params[:email1] != ""
    user_email = params[:email1]
    @next_user1 = User.find_by email: user_email
    @next_user1.bands << @band
    @next_user1.save
  end
  if params[:email2] != "" 
    user_email = params[:email2]
    @next_user2 = User.find_by email: user_email
    @next_user2.bands << @band
    @next_user2.save
  end
  
  redirect to("/stuff_was_saved")
end
                            
                        

Why this code was so hard

There was a lot of trial and error, and I think this took the longest time to put together.

I started with 3 pages before the one where this snippet comes up, and I hd to link them all together so that they could find and remember the user and what information the user put in. Then I had to get it to actually save things to my database, which is what this code is here. The last step was to get this to redirect to another page.

But! I wound up changing my tables part way through, so instead of a user only being able to be in a single band, a user could be in multiple bands. This was the point in which I realized that I would have to restructure most of this code. I this took about 5 days and lots of help to get put together.

What is the next step?

The next step I am looking at is for my website to be able to teach musicians how to play other instruments. Finding a good music teacher can be difficult and expensive, so my website would give you tutorials on how to create music on a new instrument.

This Project was made for SheQL

SheQL is a free, 10 week course offered to high school girls, femmes, and non-males in the Summer of 2017 by Mystery Code Society and supported with materials and space by the Abrahams Branch library.

This project was built using Ruby, Postgres, ActiveRecord, and Sinatra.

If you think these sites are beautiful, that is thanks to a custom front-end framework by Cara Heacock (puzzalea on github). We are so lucky to have her!