Skip to content

jackietrang/image-repository

Repository files navigation

Image Repository by Jackie Trang

Built an image repository that allows uploading images and deleting images using Flask framework and SQLite database.

🤔 Assumptions

  • Small application with ~1000 users per month

✔️ Use cases

  1. Sign up new user
  2. Log in existing user
  3. Upload images, duplications are allowed
  4. Delete images

🏗️ Project Structure

--- README.md
--- requirements.txt
--- db_setup.py
--- app.py  
--- Procfile
--- .gitignore
--- templates
        |
        |----- index.html
        |----- signin.html
        |----- signup.html
--- static
        |
        |----- uploads (folder to store images uploaded)
        |----- style.css
--- tests
        |
        |----- unittests.py (tests with unittest)
        |----- test_features.py (test with pytest)

💃 Project Demo

Here's a walkthrough of the app:

  1. Sign up new user and log in existing user

Video Walkthrough

  1. Upload and delete images in that user's repository

Video Walkthrough

GIF created with LiceCap.

🧪 Tests

Note: Make sure the app is running when test files are executed. This can be done by having split terminals in IDE. Go to /tests directory:

python unittests.py # test with unittest
python -m pytest test_features.py -v # test with pytest

🧗 Improvements

  • Better seperation of concerns for app.py
  • Write a more comprehensive testing for all features (upload, delete images, test database connection)

☁️ Deployment:

The application is running at: https://image-repo-app.herokuapp.com/

🏃‍♀️ How to run the app

Windows

  1. Clone this repository to local computer
  2. Set up virtual environment and install dependencies
python -m venv .venv
source .venv/Scripts/activate
pip install -r requirements.txt
  1. Set up database (main directory)
python db_setup.py
  1. Run the application
python app.py

The app will be running on http://127.0.0.1:5000/ in your web browser.

MacOS

Step 1, 3, 4 are similar to Windows. The only difference is in activating virtual environment (step 2):

python3.6 -m venv .venv
source .venv/bin/activate
pip3 install -r requirements.txt

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published