Project 4 of Software Engineering (CSCI-UA 474) course. This project is a fully containerized system composed of three components:
- A Flask web app to upload images and display classification results
- A machine learning client that performs fruit image classification
- A MongoDB database to store uploaded images and classification metadata
The system uses a webcam to capture fruit images, identifies the fruit via a machine learning model, and fetches a descriptive definition using the Merriam-Webster API. It is designed to be extended with features such as audio feedback, making it useful for visually impaired users or interactive learning environments.
Before running this app, make sure the following are installed:
If you are using Windows with WSL 2, you have two options:
- Open Docker Desktop
- Go to Settings → Resources → WSL Integration
- Enable integration for your Linux distro (e.g., Ubuntu)
- Click Apply & Restart
To verify that Docker is available in WSL, run:
docker --version
docker compose versionAfter installation, verify with:
docker --version
docker compose versionFor macOS users, ensure that Docker Desktop is running before proceeding. You can verify Docker is working with:
docker --version
docker compose versiongit clone git@github.com:cl3880/containerized-app-project.git
cd containerized-app-projectCopy the example .env file and add your Merriam-Webster API key:
cp env.example .envEdit .env with the following content:
MW_API_KEY=your_mw_api_key_here
MW_URL=https://dictionaryapi.com/api/v3/references/collegiate/json
MONGODB_URI=mongodb://mongodb:27017/containerapp
ML_CLIENT_URI=http://ml_client:5000
Important: You need a valid Merriam-Webster API key for the definition feature to work. You can get a free API key at the Merriam-Webster Developer Center.
docker compose up --buildThis command will:
- Build the Flask web app container
- Build the ML client container
- Start the MongoDB container
- Link all three containers together
This project uses
docker compose. If you're using legacy Docker, usedocker-composeinstead.
After the build completes, open your browser to:
http://localhost:5001
To stop the application, press Ctrl+C in the terminal where Docker Compose is running, or run:
docker compose downFor manual testing (e.g., verifying classification without using the UI), a helper script is provided.
Two test images are included in web-app/tests/test_data/, along with two sample training images in web-app/tests/sample_training_images
You can run the test upload script as follows:
python -m "web-app.tests.test_upload" bananaReplace banana with one of:
applebananatrain_appletrain_banana
Mahmoud Shehata
Patrick Cao
Chris Leu
Syed Naqvi
This project is licensed under the GNU General Public License. See the LICENSE file for details.