Giter Site home page Giter Site logo

ConTroll

ConTroll convention management software

API Documentation

Found here

Database Model

Found here

Setup

  1. git clone [email protected]:con-troll/con-troll.git
  2. composer install

Deployment to Heroku

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/

Database Configuration

The database setup is using a versioned database creation schema:

  1. Schema changes are stored in database/schema-X.sql where X is the "data schema version number".
  2. The database has a system_settings table with a record with the name data-version and the value is the number of the last schema version that was applied to the database.
  3. 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 the data-version field automatically.

Creating a new data version

  1. Create a new database/schema-X.sql file with X replaced with the next higher number after the highest one existing.
  2. Add the require DDL commands to transform the previous version to the required schema of the new version.
  3. Add a DML command to set the data-version field to the new version number.
  4. Test the database changes (see below).
  5. Commit and push the changes to the source control.
  6. Deploy (TODO: write automatic deployment)

Test database changes

  1. 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.
  2. Edit mysql.dockerfile to reference the new file that you've just created.
  3. Run docker-compose up mysql - this will start the database and block the current terminal. Press CTRL-C to stop the database.
  4. In a new terminal, run mysql -h$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' controll_mysql_1) -uroot -psecret heroku_3f90e079b7e30b6 < database/schema/schema-X.sql
  5. To test again, stop the database and run docker rm controll_mysql_1 to clear the mysql container and then start it again

Testing the application

The application can be tested using Docker Compose.

Setup

  1. Make sure the docker-compose command line tool is working on your system.
  2. The application uses a non-default Heroku local docker setup, using PHP 7.0. To get it to run:
  3. Clone the Github repo for the docker image at https://github.com/heroku/docker-php.git
  4. Edit the Dockerfile and replace the PHP_VERSION value to 7.0.3
  5. Build the required local image using docker build -t heroku/php:7.0

Running

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.

Testing with Postman

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 to http://localhost:8080 for local testing
  • convention_key - this is the public convention key for the convention you'd be running scenarios on. For local testing you can obtain this from the api_keys table
  • user_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.

Con Tools's Projects

client-polymer icon client-polymer

A ConTroll client using the Polymer UI and the Controll.js library

con-tools icon con-tools

Con.Tools hobby gaming convention management software

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.