ConTroll convention management software
git clone [email protected]:con-troll/con-troll.git
composer install
git add heroku [email protected]:con-troll.git
git push heroku master
After this the updated application should be available at https://con-troll.herokuapp.com/
The database setup is using a versioned database creation schema:
- Schema changes are stored in
database/schema-X.sql
where X is the "data schema version number". - The database has a
system_settings
table with a record with the namedata-version
and the value is the number of the last schema version that was applied to the database. - To upgrade the database, check the
data-version
field and then run all the schema files with version numbers higher than the one recorderd. The schema files will update thedata-version
field automatically.
- Create a new
database/schema-X.sql
file withX
replaced with the next higher number after the highest one existing. - Add the require DDL commands to transform the previous version to the required schema of the new version.
- Add a DML command to set the
data-version
field to the new version number. - Test the database changes (see below).
- Commit and push the changes to the source control.
- Deploy (TODO: write automatic deployment)
- Create a new data dump from the current version of a running system (or just create a new system by running all
the previous schema files and data dump that), into
database/dumps/dump-X.sql
. - Edit mysql.dockerfile to reference the new file that you've just created.
- Run
docker-compose up mysql
- this will start the database and block the current terminal. Press CTRL-C to stop the database. - In a new terminal, run
mysql -h$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' controll_mysql_1) -uroot -psecret heroku_3f90e079b7e30b6 < database/schema/schema-X.sql
- To test again, stop the database and run
docker rm controll_mysql_1
to clear the mysql container and then start it again
The application can be tested using Docker Compose.
- Make sure the docker-compose command line tool is working on your system.
- The application uses a non-default Heroku local docker setup, using PHP 7.0. To get it to run:
- Clone the Github repo for the docker image at https://github.com/heroku/docker-php.git
- Edit the
Dockerfile
and replace thePHP_VERSION
value to7.0.3
- Build the required local image using
docker build -t heroku/php:7.0
The docker setup includes a full Heruko stack for testing. Run docker-compose up
to start the full web application.
When the docker web service is up, the application is accessible on port 8080 of the docker host.
In order to perform Single-Sign-On authentication (with Google/Facebook/Twitter), you'd need a .secrets
"environment file"
with the secret client keys for those services. Either ask Oded for the keys, or generate new ones yourself by creating an
application/project in each relevant provider, and add those to the .secrets
file like this:
FACEBOOK_AUTH_CLIENT=APPLICATIONSECRETKEY
GOOGLE_AUTH_CLIENT=CLIENT_ID.apps.googleusercontent.com:SECRETKEY
TWITTER_AUTH_CLIENT=CLIENT_ID:SECRETKEY
If you prefer to not use an SSO login - for example, to just run some API calls through Postman - you can use an administrator level password access to generate your authentication token. You can run this script:
./scripts/docker-login.sh
which will create an admin level login on the docker image and will present you with the authentication token for it.
A Postman collection is stored under docs
and includes many (if not all) API calls that are implemented in the system.
The configuration relies on an "Environment" being set in Postman, with the following tokens:
endpoint
- the URL for the web service. Set this tohttp://localhost:8080
for local testingconvention_key
- this is the public convention key for the convention you'd be running scenarios on. For local testing you can obtain this from theapi_keys
tableuser_key
- this is the user api token - you can get it by implementing an SSO login and completing the SSO challenge through the/auth/start
API call, or using the aforementioned docker login script.