# picture upload and management system This project is created as part of the semester work of the course "Real-time Web Applications" in the 4th semester of multimedia production at Kiel University of Applied Sciences. -Course by: Florian Schatz ## Table of contents - [Project Description](#picture-upload-and-management-system) * [Setup Instructions](#setup-instructions) + [Clone the GitHub Repository](#1-clone-the-github-repository) + [Docker Compose](#2-docker-compose) + [Database Setup](#3-database-setup) + [Composer Dependencies](#4-composer-dependencies) * [Completion](#completion) * [Documentation](#documentation) + [Endpoints](#endpoints) + [Environment Variables](#environment-variables) + [php.ini Configuration](#phpini-config) ## Setup Instructions Follow these steps to set up the project: ### 1. Clone the GitHub Repository Clone the Repository ## #2. Configure your environment Rename the .env.example in `www/symfonyproject/` file to .env for configuration take a look at [Environment Variables](#environment-variables) ### 3. Docker Compose Use `docker-compose up -d` to start the necessary services deamonized. The following containers will spin up: `1. PHPmyAdmin -> default localhost:3442` `2. Web -> default localhost:3440` `2. DB -> default localhost:3441` ### 4. Database Setup Open PHPmyAdmin via browser and configure access with the following credentials: - Server: `segelparade_db` - Username: `root` - Password: `eselmachtia` Create a new table `test` and import `test_dbdump.sql` from the repository. (This is required because some logics are currently not working with an empty db) ### 5. Composer Dependencies Run `composer install` in the web container to install PHP dependencies. ## Completion After completing these steps, the project should be operational. These steps are only necessary during the initial setup or when dependencies change. ## Documentation ### Endpoints #### / Frontend, allows users to contribute images and tag them #### /backend Backend, allows managers to sort and download images #### /backend/entries/{status}/{option} returns filtered images by status (new,...,tag,id) `when using tag or id the option parameter expects tags array seperated by + or id` #### /download/{type}/{id} starts a download of the requested file(s) `type = original||processed` when requesting multiple files seperate their ids by + ### Environment variables specified in `www/symfonyproject/.env` next to the default symfony & doctrine env vars the following are relevant #### UPLOAD_PATH specifies the absulute path of the uploads, format: `/path/to/upload/` (notice the last /) #### NOTIFICATION_MAIL specifies the mail to send notifications to when a upload is complted (to get a status of the application) do not specify this ENV if you don“t want to be notified ### php.ini config php.ini settings are configured on the host machine in `phpconfig/php.ini` notice that if you change something you need to restart the docker container. Notable configurations are: `max_execution_time = 30` `max_input_time = 60` `memory_limit = 128M` `file_uploads = On` `post_max_size = 64M` `upload_max_filesize = 64M` `max_file_uploads = 20` `extension=pdo_mysql` `extension=zip`