Uploading Images to AWS S3

With our backend endpoints and user authentication in place, it’s now time to revisit S3. Amazon’s simple storage service provides developers to store whatever they need in the cloud.

Our project utilizes multiple resources with the hope of staying on the free tiers for each. The frontend is hosted on Vercel, while our backend is running on my personal server here at home. Although it’s handy to have our backend hosted locally, I don’t want to see major delays in communication with the frontend.

In my limited experience using S3, I didn’t need to worry about delays since my code was running on the same domain. There are a few options I’ve come across to handle file uploads to S3.

Use Multer to stream file to S3 bucket:

This is the traditional approach that I have used before. It requires reading the file contents, storing the data in a temporary location on the server, and streaming the file to S3. Before handling the file, you can easily check for a valid JWT in the request headers. If all of our code was running on my server, this is probably the solution I would use.

Pre-signed POST to upload directly from client-side:

With this option, the client sends a request for an “upload URL,” which is “pre-signed” with the necessary data (AWS credentials, file field requirements, user authentication, etc.) for the file to be uploaded directly to S3. With this approach, our backend would not be dealing with file streaming. This also allows for finer control of restricting the file size and type.

The downside to this approach is the higher level of complexity. Amazon Lambda functions and the use of Amazon’s API Gateway are often referenced in tutorials and guides. It may be possible to use our server to pre-sign a post for upload to S3, but with only a few more weeks left in the quarter, this option could become too time-consuming.

Pre-signed URLs???

This approach is very similar to a pre-signed POST in that the client has to request access to upload a file to S3. Pre-signed URLs use a PUT request to S3 but follow a similar pattern of requesting the URL from your own server or through API Gateway and Lambda functions. With Pre-signed URLs, you lose flexibility and some security. You can’t check the file size, and once the URL is generated, anyone can access it and use it multiple times until the URL expires. Implementing this option appears to be much simpler than the pre-signed POST.

I’ll need more time to research these options before implementing file upload routes. Our front end uses the NextJS framework, which I have not had as much time to work with so far. The built-in server functionality with NextJS could be the best way to handle file uploads to S3!

Post-Graduate Blogging

As the weeks progress through the Capstone quarter, I’ve started to think about blogging in a post-graduate sense. Short of creating a full-blown custom solution, there are many off-the-shelf options available such as WordPress, LiveJournal, and Tumblr. I recently became aware of Static Site Generators such as Jekyll, Next.js, Hugo, and Gatsby, which are somewhere in the middle of these two camps and leverage templating languages as part of the “glue” holding everything together.

Along with these solutions are hosting providers such as GitHub Pages and Cloudflare, which provide hosting for free/at minimal cost, offering clever integrations to kick off builds and publish content when a new commit is pushed to the main branch. These solutions seemed to provide the right balance of flexibility and management overhead as they can be completely serverless solutions if desired, which also comes with inherent benefits to security and scalability. I’ve learned many developers on GitHub take advantage of this offering to showcase their portfolios.

By generating static assets from a series of templates, metadata, and content material, you eliminate the need for a dedicated backend in most cases. There are no databases to manage, and when publishing to a hosting provider there are no frontend servers to manage either. Your pre-generated pages are all neatly bundled and shipped off to a server, or collection of servers in the case of CDNs like GitHub Pages and Cloudflare, for blazing-fast load times!

I’ve been tinkering around with this for the past week and have started to get a personal blog put together. Landing on Cloudflare Pages for content hosting and Jekyll for the static content generation, I’m able to make updates and add new content fairly easily by pushing my changes to the main branch after verifying locally. I can see how this approach could work well for a collaborative blog, as anyone with access to the repository could add new pages or posts to the site by pushing commits via Git for publishing.

Local development is easy too, with a couple of YAML configurations you can specify overrides for easier debugging. Any changes on disk also cause Jekyll to rebuild immediately, so you can quickly iterate on design and content. I’m using a spare Linux machine for my development environment which I connect to via Visual Studio Code over SSH.

If you’re looking for a lightweight blogging solution that can grow with you long-term, I recommend you check out some of the static site generators on jamstack.org.

The COVID Vaccine…

Knocked out by the third dose

Since I received my shot a couple of days ago, I have been glued to the couch, suffering from the typical body aches and chills most have felt after each COVID dose. Thankfully, this is my first encounter with side effects worse than a sore arm. It’s been challenging focusing on project-related tasks, but the pandemic and the impact it has had on our lives crossed my mind.

More specifically, how new graduates will have several interviews conducted online. I applied to a few “new grad” positions during my fall term and went through Zoom meetings for code and behavioral assessment.

If the last two years have been anything like mine, then the most conversing you’ve had with strangers involves a greeting followed by thanking them as they hand you a receipt for your groceries.

I can be pretty introverted, and the pandemic caused me to embrace that trait.

When it comes to interviewing preparation, we have likely encountered similar advice or read through similar guides. If I summarized all that into a few bullets points:

– Get an internship or have some CS-related job experience
– Leetcode 24/7
– Keep all that data structure/algorithms knowledge fresh
– Practice problem solving out loud

As I began my 1-on-1 Zoom meetings for a couple of positions last fall, I didn’t find myself struggling with the coding challenges. I was working through the problems while giving the interviewer an explanation of my thought process. I could answer questions or apply suggestions given by the interviewer without derailing my progress. In a few meetings, I ended up with a detailed simple solution and a more efficient solution. 

So what went wrong? Why didn’t I get a job offer? Well, there’s obviously much more that can go into the interview process, but in my opinion, I felt like I had forgotten even the most basic social skills!

Who can blame me? Most of my close friends and my household have been following the stay-at-home policy for nearly 2 years. Plus, 99% of my responsibilities can be done at my house. I’ll admit, the few times I’ve driven somewhere other than our local grocery store, I’m shocked at how different things look due to the road and building construction progress.

I was in my own little world, surrounded by my pets, wearing pajamas, and focused on learning everything I could.

So while you practice for your interviews, make sure you practice your communication skills! Despite all these technical assessments and code testing during interviews, human bias will play a key role in whether interviewers will move forward with you. One of these biases is known as the First Impression Bias.

It’s essential to know your facial expressions and tone and be mindful of the interviewer’s interest level in you. Make sure the first impression you give is positive!

The Decision Lab: Anchoring Bias, explained.

The best advice I’ve received is to go into every interview with a list of questions to ask. Not just the role specifically, but maybe you know the names of your interviewers and can look at their recent job experience. You could look into the company and its products. Whenever you get an opportunity to ask the interviewer questions, ask questions! Fill up all the time you can with questions. Ask about the role, the company, the interviewer’s experience, and their personal interests. If you find a common interest with one of your interviewers, take some time to explore that subject.

So while your cramming Leetcode, take frequent breaks and brush up on your social skills!

Combining technology with biological research

What do you remember from high school or the college intro biology class(es)? Unless you have a professional background in the field, you might recall concepts like biological evolution and ecology or the dread of memorizing cellular processes. What about the tools or technology? Like my early years working in a research lab, you probably remember doing everything by hand.

I didn’t get an opportunity to learn and use the latest biological technologies until my last job studying cancer biology, but I was immediately all for the cross-disciplinary advancements.

So what are some exciting technologies?

Transgenics and Gene-Editing:

You might have seen or heard the acronym CRISPR-Cas9[1] in news media, which is a technology that utilizes single-cell organisms such as bacteria immune defense systems to edit genes in other organisms in the most accurate, cost-effective, and versatile way. Transgenic animals in research have been vital to understanding diseases and developing treatments.

Nanotechnology:

Understanding cellular mechanisms require strict control of variables ranging from the outside environment to the molecular structure of the plate the cells are cultured in. Some instruments can sort individual cells from a small sample containing 100s of millions of cells based on a fluorescently tagged protein!

Bioinformatics:

I had the opportunity to use some of the best microscopy systems available to researchers. Despite some UI frustrations, I always loved looking through the confocal images I’d take. Here is a link to a short article that includes one of the first images I captured!

https://www.fredhutch.org/en/news/releases/2016/02/shedding-new-light-on-breast-cancer-metastasis.html

With all of the advancements in biological research, I know there’s an increasing demand for interdisciplinary professionals, and I look forward to becoming one of them!

Why does Craigslist need saving?

Last week our Capstone groups and project were assigned. We will be developing a cross-platform app to help improve the concept of Craigslist. As I’ve spent time researching possible technologies to use, I keep asking myself, “what happened to Craigslist?”

I wouldn’t consider myself an active user of Craigslist. Still, back in the mid-2000s, when I was working on my first bachelor’s degree, Craigslist was the best way for a broke college student to furnish their room. I also found and adopted, Zoey the first dog I raised as an adult, through a local shelter’s foster program. My personal experience using Craigslist has been positive! I felt it necessary to do a little research on Craiglist’s history and learn more about their competitors.

The Craigslist controversy:

Before I continue, let’s acknowledge a common sentiment regarding transactions on Craigslist; be careful! That was a valid concern even in Craigslist’s early days, given the anonymity of listings. Craigslist’s free and straightforward community service hoped to bring out the best from people. But with limited or no moderating, scammers could create listings and successfully deceive a buyer with no consequence.

One interesting fact that I don’t think is well known is that Craigslist is a private for-profit company.[1] As they expanded to cover more cities and countries, they kept their same ideals and simplistic website design. They refused to profit from ads and other marketing strategies and dismissed outside developers looking to collaborate on new features.[2] With millions of users on their site, it’s not surprising to learn that Craigslist has faced numerous legal battles. The most controversial was their personals category, which they shut down after the FOSTA-SESTA bill was passed into law in 2018.[1]

Who is the competition?

Facebook Marketplace:

I admittedly don’t use Facebook often and have never used their marketplace. I can imagine the appeal of connecting to people through Facebook. Users can view the profiles of potential buyers or sellers, which takes away some of the concerns users of Craigslist face.

As I browsed through listings on Facebook Marketplace, it didn’t feel like a local community classifieds website. Even with my location filter set, I see more sponsored ads and listings from businesses than individuals. If I wanted to find something to buy, I wouldn’t enjoy sifting through ads, and I bet sellers have a difficult time connecting with buyers as well.

Shifting towards cross-platform solutions:

OfferUp and Mercari are Craigslist competitors that chose to pursue the rising popularity of mobile devices to create cross-platform apps.

Mercari is a Japanese company that became Japan’s largest community-powered marketplace.[3] They have expanded to the U.S. and have gained a small foothold. They also have developed a shipping protocol to allow users to explore beyond their local community.

OfferUp, located in Bellevue, Washington, is similar to Mercari but focuses more on safety concerns. OfferUp created user profiles with detailed rating systems to help hesitant buyers. They also formed partnerships with local police stations and businesses to give their users well-monitored places to meet for transactions.[4]

So how can I improve Craigslist?

If you visit Craigslist now, you won’t see anything new. Select a category or search for an item; you will encounter an unorganized mess of posts and come across obvious spam that hasn’t been flagged by a user or removed by a Craigslist employee. Developing a user profile with a rating system would significantly decrease spam and provide a more personal touch to users conducting transactions. Developing a more intelligent search algorithm and creating a modern UI will also be beneficial.

As Craigslist’s competitors have done, making a mobile app in addition to a website will appeal to a broader audience. However, those apps exist to profit from their user base. I think Craigslist has the right idea about not profiting from its users. I will need to research frameworks and free database and hosting services to keep my project free to use and free from ads.

My computer science progress

The final quarter:

If someone told me I’d soon be on a trajectory to begin a new career in computer science back in 2018, I doubt I would have believed them. To be clear, the thought had definitely crossed my mind during my time working as a scientist. I had tried working through some beginner-level coding coursework over the years, but it was far more overwhelming than anything else I had learned.

By the end of spring in 2019, I had drafted up an academic plan with an advisor at my local community college and let my boss know I’d be resigning that summer. My initial plan was to take the few classes I needed to complete a transfer degree and apply to a local university’s computer science program. But the COVID-19 pandemic led me down a different path; an online computer science post-baccalaureate degree at Oregon State University.

Despite my initial concerns with learning complex material strictly online, I found myself progressing more quickly and with a deeper understanding of the material than I expected. I started exploring new technologies beyond the scope of my coursework and would constantly be thinking through possible solutions to problems in my head while taking breaks from classwork. For the first time, I felt confident that I was headed down the right career path.

Tobi, our cuddly Pit Bull mix. (May, 2019)

I’ve had my fair share of stressful weeks during my time at OSU, especially while coping with the effects of the pandemic. Despite being stuck at home throughout the pandemic, one positive has been having the time to adopt and raise a second puppy, which was always the goal but logistically challenging being away most of the day.

Bruiser joined our family about one year ago, and Tobi has been the most caring and patient older brother. I can’t imagine a life without these two handsome dogs.

Bruiser, modeling for National Dog Day. (2021)

This winter quarter will be my final term and the beginning of my career in computer science. I am incredibly excited and feel that I am ready to reenter the workforce and take on the new challenges that await!