A web-based repository for images built on PHP / MySQL / React. Features include searching, public / private uploads, upload deletions, Google OAuth sign-in, and much more!
View Live Demo · Report Bug · Request Feature
- Built with
- How to use the application?
- Getting started
- Testing
- API documentation
- Future features
- License
- Contact
- Acknowledgements
- PHP - backend responsible for user authentication, login / signup, searches, image upload / deletion, etc.
- MySQL - storage solution for holding existing users and image upload information
- React / JS - frontend responsible for UI/UX interface to perform actions
Go the Live Demo and signup for an account either with Google or with a custom username and password. If you would prefer not to create a new account, you can use the test account with username demo
and password demo
.
The homepage displays the most recent public uploads by users (including your own public uploads!)
Once logged in, you will be able to upload images and access your profile page via the account icon in the menu bar. On the profile page, you have options to view your public uploads, private uploads, and upload / delete images.
To get a local copy up and running follow these simple example steps.
NPM and Composer are required for installing the needed dependencies of this project.
composer --version
npm --version
- Clone the repo
git clone https://github.com/joshuajadaniel/image-repository.git
- Install Composer dependencies in
/api
composer install
- Follow the instructions in
/api/configSkeleton.php
to createconfig.php
- Have a PHP / MySQL enabled server running
/api
- Install NPM packages
npm install
- Update
basename
andhomepage
if needed in/src/App.jsx
andpackage.json
respectively. - Update
/api
links in/utils
- Start a local server for React
npm start
Frontend testing is conducted using Jest and RTL (React Testing Library) and backend testing is conducted using Postman.
# Frontend testing (components shown below)
npm run test -- --coverage --watchAll=false
# Example backend testing (recent feed shown below)
GET
/api/feed/recent.php
returns all public uploads ordered by time
GET
/api/feed/search.php
returns all public uploads with exact search query in the title
GET
/api/feed/user.php
returns uploads for a user (provided you are authenticated)
POST
/api/feed/upload.php
uploads an image (provided you are authenticated) to the repository
POST
/api/feed/delete.php
deletes an image (provided you are the owner) from the repository
POST
/api/user/login.php
returns a JWT token if user has the correct credentials
POST
/api/user/signup.php
returns a JWT token if user does not exist
POST
/api/user/validate.php
returns whether a given JWT token is valid
/api/google/auth.php
redirects user to Google OAuth flow
/api/google/return.php
return point after user is authenticated by Google (redirects back to frontend)
- Cropping prior to upload
- Direct download for each image
- Albums / collections for user organization
- Tagging system for uploads
- Edits to previous uploads
Distributed under the MIT License. See LICENSE
for more information.
Joshua J. A. Daniel
Email: joshuajadaniel@gmail.com
LinkedIn: https://linkedin.com/in/joshuajadaniel