pxp888 / partyshots

Photo Sharing and Collection Site
0 stars 0 forks source link

partyShots

image

This is a relatively simple photo sharing application that is meant to enable easy and simple photo sharing. Imagine a party where multiple people are in attendance, and may want to have photos to remember the event. They can either all take photos, or simply use a site like this one where anyone can upload photos and anyone else can get them. All they need is the album code.

Features

Structure

The site is run on Django which is hosted on heroku. Data storage is handled by a heroku postgres database for metadata, and amazon AWS S3 storage for the files themselves.

Information flow

Photos are first uploaded to the site, and from the site uploaded to AWS S3 buckets. This is because the site generates thumbnails for each photo, and then stores both the thumbnail and original photo in Amazon S3 buckets.

Only metadata for these files are kept on the postgres database.

When a user is browsing the site the link for each photo and thumbnail is generated by using pre-signed download links, and the photos themselves are pulled from AWS. This keeps the workload on the server low.

Database Structure

There are four database tables in addition to the tables used for user authentication.

Album

An album represents a collection of files.

Field Description
id Primary Key
code unique code for each album
name album name
user album creator/owner
created_at album creation time
thumbnail link for album thumbnail

Photo

A photo object represents an individual file.

Field Description
id Primary Key
user photo owner
album which album the photo belongs in
link link to retrieve file from AWS S3
tlink link to retrieve thumbnail from AWS S3
created_at file upload time
filename original filename

Tag

Tags are applied to photos, and are currently used to store descriptions for each photo.

Field Description
id Primary Key
photo which photo the tag applies to
key key for each tag
value data for each tag

Subs (subscriptions)

This table stores albums of other users that users may want easy access to.

Field Description
id Primary Key
album album identifier
user user subscribed to the album

Todo List