Built an image repository that allows uploading images and deleting images using Flask framework and SQLite database.
- Small application with ~1000 users per month
- Sign up new user
- Log in existing user
- Upload images, duplications are allowed
- Delete images
--- 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)
Here's a walkthrough of the app:
- Sign up new user and log in existing user
- Upload and delete images in that user's repository
GIF created with LiceCap.
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
- Better seperation of concerns for
app.py
- Write a more comprehensive testing for all features (upload, delete images, test database connection)
The application is running at: https://image-repo-app.herokuapp.com/
- Clone this repository to local computer
- Set up virtual environment and install dependencies
python -m venv .venv
source .venv/Scripts/activate
pip install -r requirements.txt
- Set up database (main directory)
python db_setup.py
- Run the application
python app.py
The app will be running on http://127.0.0.1:5000/
in your web browser.
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