We help you find the peter for your pet. This is a standard PHP+PostgreSQL project. Bootstrap 4 is used as the front-end framework.
- Make sure you have installed the latest version of Bitnami WAPP stack (i.e., at least PHP 7).
- First, clone the repository to your repository (in the
apps
folder of your WAPP installation).
git clone git@github.com:yunpengn/peterfinder.git
- Add the following lines to the end of
apache2/conf/bitnami/bitnami-apps-prefix.conf
(the path may be different):
Include "C:/WAPP/apps/peterfinder/config/httpd.conf"
- Go to the
config
folder under thepeterfinder
folder we cloned just now. - Create a copy (do not delete the original ones) for
config.example.php
andhttpd.example.conf
each, and rename them toconfig.php
andhttpd.conf
respectively. - Change the
DB_USER
andDB_PASSWORD
inconfig.php
. You may also want to changeDB_PORT
if you changed the port of PostgreSQL before. - Change the paths in
httpd.conf
to the correct ones according to your WAPP installation. - Restart your Apache2 server.
- Open the browser and enter the URL
http://localhost/peterfinder
(please make sure it is nothttps
). Now you should see our nice homepage!
- Make sure you can use
psql
(Postgre's command-line user interface), which may be troublesome for Windows users. Thus, we have prepared the guide for Windows users. - Run the scripts under
scripts
folder.- For windows user: Type
setup.bat
- For mac/linux user: Type
bash setup.sh
- For windows user: Type
- Enter your password when appropriate.
Notice: If you use the default sample data, the account for testing is as follows:
- Username:
test
- Password:
peterfinder
We suggest you using PhpStorm by JetBrains.
- We are currently using Heroku's PaaS (platform-as-a-service). It provides a basic free plan which allows to experiement in a limited sandbox.
- To deploy the project, make sure you have installed the latest version of Heroku command-line tool and Composer. Here, we assume you have also installed the latest version of Git. You can run the following command to check
heroku -v
composer --version
git --version
- Run Composer to install all the dependencies and update the
composer.lock
file.
composer update
- Make sure you have modified
config.php
correctly. - Make sure you have already created a Heroku project on the Heroku control panel. Navigate to your local project repository and add the Heroku project
heroku git:remote -a <your_heroku_project_name>
- Push the changes to the Heroku server.
git push heroku master
The command above will by default push the local master branch to Heroku server. If you want to use a local non-master, use the following command instead
git push heroku <your_branch_name>:master
- To check the instances that are running now:
heroku ps
- To open the web app in production:
heroku open
- To start a remote interactive shell on Heroku server:
- Notice: This will start a new one-off dyno. In other words, it is a dyno with the same configuration as the running dyno, but they are not the same dyno.
heroku run bash
- To access the web dyno that is currently running:
heroku ps:exec
- To view the logs of your application:
heroku logs --tail
We have prepared the following tips to help you with the development:
We hope you are happy with development!
- Pexels [https://www.pexels.com/]
- Heroku [https://www.heroku.com/]
Peter Finder was initially a project for CS2102 Database Systems at the School of Computing, the National University of Singapore. We decided to open-source this project on April 26, 2018.
We welcome everyone to contribute to Peter Finder. Please follow the guidelines before starting your contributions.