Skip to content

PhotoPond is a study project. Designed to gain experience in using Java, VueJS, PostgreSQL, Social accounts (Facebook, Twitter), CI/CD (Travis-CI, Heroku)

JIeIIIa/PhotoPond

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PhotoPond

Build Status Coverage Status

PhotoPond is a java study project. It available by https://photopond.herokuapp.com

The purpose of the PhotoPond project was to develop a user-friendly web-application for storing images. After signing up the user can create directories and upload files. Each directory and file can be moved, renamed or deleted. A user can link his/her social (Facebook or Twitter) account to PhotoPond profile. If the social account is linked, user can authorize with it. When Twitter account has been linked a user can create a tweet and easily share images. Administrator can view basic information about all users, change user's login or role, delete users.

Getting Started

These instructions will give you a copy of the project and running on your local machine for development

Prerequisites

For building and running the application you need:

Installing

Clone repository

Clone this repository onto your local machine. You can do it like this:

$ git clone https://github.com/JIeIIIa/PhotoPond

Create database

Open database terminal and type in the following command:

CREATE DATABASE PhotoPond;

Create Facebook application

  • Create an application following App development
  • Open created Facebook app
  • Set up Facebook login (from Add a Product section)
  • Open Settings->Basic and add App Domains (e.g. localhost)
  • Make a note of your App ID and App Secret

Create Twitter application

  • Create an application following How to create a Twitter application
  • On the Step 7 choose Read and Write Access permission
  • Open App details and add Callback urls (where <your_server_address> is the address to listen by Photopond application, e.g. http://127.0.0.1:8099):
    <your_server_address>/public/twitter-auth/callback/login
    <your_server_address>/public/twitter-auth/callback/associate
    <your_server_address>/public/twitter-auth
    

Running

Active profiles

You should choose exact one of prod or dev profiles and one of disk-database-storage or database-storage. Also, you are able to use another profiles if necessary. See below full list of available profiles:

  • prod - if application run in production environment;
  • dev - if application run in development environment (e.g. on your local pc);
  • database-storage - if you want to store all information in database;
  • disk-database-storage - if you want to store pictures on the disk. In this case in database store symbolic link on the picture;
  • postgresql - if you want to use PostreSQL database, otherwise MySQL will be used;
  • ssl - if you want to use https protocol. In this case you should replace localhostKeystore.p12 file to your own certificate

Environment Variables

Use environment variables below:

  • JDBC_DATABASE_URL - the JDBC URL to the database instance (e.g. jdbc:postgresql://localhost:5432/PhotoPond)
  • JDBC_DATABASE_USERNAME - the database username
  • JDBC_DATABASE_PASSWORD - the database password
  • FACEBOOK_APPLICATION_ID - App ID of your Facebook App
  • FACEBOOK_APPLICATION_SECRET - App Secret of your Facebook App
  • TWITTER_CONSUMER_KEY - Consumer Key of your Twitter App
  • TWITTER_CONSUMER_SECRET - Consumer Secret of your Twitter App
  • KEY_STORE_PASSWORD - the password for the keystore (*.p12)

Also, you can change corresponding variables in *.properties files

Running the application using the command-line

This project can be built with Apache Maven.

Use the following steps to run the application locally:

  1. Execute next Maven goals to create the target/photo-pond-1.0-SNAPSHOT.jar file:
    $ mvn clean install -Dmaven.test.skip=true
  2. Run the application using java -jar, as shown in the following example:
    java -Dspring.profiles.active=<ACTIVE_PROFILES_LIST> <OTHER_VARIABLES> -jar target/photo-pond-1.0-SNAPSHOT.jar
    where:
    • <ACTIVE_PROFILES_LIST> - list of spring boot active profiles (e.g dev,postgresql,database-storage)
    • <OTHER_VARIABLES> - list of environment variables that are required to run and have not been set before (e.g. -DJDBC_DATABASE_USERNAME=username)
  3. Once running with dev active profile, the application will be available at:
    http://localhost:8099/
    
    If you need to start your application on another port use -Dserver.port=PORT variable.

Built With

  • Spring boot - A framework that provides a simpler and faster way to set up, configure, and run both simple and web-based applications
  • Thymeleaf - A server-side Java template engine
  • Vue.js - An open-source JavaScript framework for building user interfaces and single-page applications
  • Maven - Dependency Management

Troubleshooting

  • Make sure that you are using java 8, and that maven version is appropriate.
    mvn -v
    should return something like:
    Apache Maven 3.5.3
    Maven home: C:\Program Files\Maven\bin\..
    Java version: 1.8.0_192, vendor: Oracle Corporation
    Java home: C:\Program Files\Java\jdk1.8.0_192\jre
    
  • Make sure that you have set all necessary variables.

Author

  • Oleksii Onishchenko - Initial work - JIeIIIa