Weekly Sprint #5: Security & Storage Rules

Evan Zodl
IMM at TCNJ Senior Showcase 2017
2 min readMar 8, 2017

This week I primarily focused on the improving server-side security and ensuring everything works correctly on the back-end of FoldFeed. I started by implementing security rules within Firebase Storage to limit file types (strictly to .gif, .jpg, or .png formats) when uploading photos to Firebase Storage. An error message is returned if the file is not an image and will not be uploaded. I plan to use this same technique to limit the input types when users upload documents for crease patterns and diagrams.

Comparison of invalid and valid image uploads.

I also implemented functionalities to scale images to a manageable size before uploading them to the database. This ensures that file sizes are not too large and the application runs efficiently. Currently, the images are scaled to a width of 800px. I am still working on uploading smaller copies of the images to use as a thumbnails on different pages. However, at this point the 800px image size reduction is working very well. I also implemented a 404 page that users are redirected to if they navigate to an invalid URL.

Screenshot of the new 404 (Page Not Found) error page.

I spent most of the week updating code to drastically improve the performance of the application. Instead of checking if the user is signed in on each page of the application, their authentication information is checked once and now persists throughout the application. This is one issue that I’ve been meaning to address for quite some time, so I am glad to see FoldFeed running much more smoothly.

--

--

Evan Zodl
IMM at TCNJ Senior Showcase 2017

Senior Interactive Multimedia and Computer Science double-major at The College of New Jersey