Skip to content

jibrahem/Snapr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

399 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snapr

Snapr is our clone of the image posting site Flickr! You are able to upload images, comment, and create your profile.

Technologies used: Python, JavaScript, Flask, React, Redux, CSS, HTML, AWS



Screen Shots:

Landing page:

  • The landing page is the first page the user will see when they arrive at the site. You are able to click the start for free button or the log in/ sign up button in the top right corner.

Log in/Sign up page:

  • The log in page is where existing users can log in. If you don't have an account you may click the 'Sign up here' and you will be directed to the sign up page. Also if you don't want to create an account, you can use the demo user, which is an already created account.

User profile page:

  • This is where you are able to see all users images. By clicking on their name it will take you to their profile. You can also like the photo at the star in the bottom right corner. In addition, clicking on the photo will take you to the single image page.

Single image page:

  • On this page, if it isn't your photo, you are able to comment as well as favorite the photo. If you posted the photo, you are able to favorite, comment on, update, and delete the photo. Once you post a comment, you are then able to edit or delete the comment.

User's about page:

  • Here you can create and update your profile. We have a section to write about yourself, a place to showcase photos you have uploaded, and a place for socials.


AWS code snippet

def get_unique_filename(filename):
    ext = filename.rsplit(".", 1)[1].lower()
    unique_filename = uuid.uuid4().hex
    return f"{unique_filename}.{ext}"


def upload_file_to_s3(file, acl="public-read"):
    try:
        s3.upload_fileobj(
            file,
            BUCKET_NAME,
            file.filename,
            ExtraArgs={
                "ACL": acl,
                "ContentType": file.content_type
            }
        )
    except Exception as e:
        return {"errors": str(e)}

    return {"url": f"{S3_LOCATION}{file.filename}"}
  • get_unique_filename(filename): This helper function generates a unique and random UUID (Universally Unique Identifier) filename using Python "uuid" module.
  • upload_file_to_s3(file, acl="public-read"): This function uploads the selected file to the assigned AWS (Amazon Web Service) S3 bucket and returns a URL when the file is successfully uploaded. It also returns an error statement if the upload fails.

LinkedIn of developers:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors