Skip to content

Pamoi/photo-gallery-api

Repository files navigation

photo-gallery-api

This project is a simple REST API to publish and manage photos organized in albums. It is built with PHP and the Symfony framework.

A web client is available to interactively view, comment or add photos shared through this API: photo-gallery-webclient.

Installation

To set up the API you have to clone this repository and install the dependencies using composer:

git clone https://github.com/Pamoi/photo-gallery-api.git
cd photo-gallery-api
composer install

Composer will automatically ask you to enter local parameters such as the database user and password. You can then create the database needed by the application by running the following commands:

php bin/console doctrine:database:create
php bin/console doctrine:schema:update --force

You can then add users to the system:

php bin/console user:add <name> <email> <password>

Note that the email field is currently not used.

The poject uses the image magick library. On Debian based systems you can install it by typing:

sudo apt-get install php-imagick

Finally, serve the web/app.php file with your favorite web server.

Additional note: do not forget to authorize large enough uploads in your web server configuration, otherwise the server will reject large photo files. For apache, set the fields post_max_size and upload_max_filesize to suitable values (e.g. 20M) in your php.ini.

About

A simple REST API serving as backend for a photo sharing app and website.

Resources

License

Stars

Watchers

Forks

Packages

No packages published