This is a Laravel package that provides a code application for building platforms to host competitions.
The entire documentation is available at: https://quark.sdslabs.co
-
Create and setup a new Laravel app
-
Add the folowwing repositories to the
composer.json
'srepositories
field:
"repositories": [
{
"type": "vcs",
"url": "git@github.com:sdslabs/quark",
"no-api": true
},
{
"type": "vcs",
"url": "git@github.com:sdslabs/falcon.git",
"no-api": true
}
],
-
Add Quark as a dependency by adding
"sdslabs/quark": "dev-laravel-package"
torequire
field incomposer.json
-
Add Falcon as a dependency by adding
"sdslabs/falcon": "dev-composer-pkg"
torequire
field incomposer.json
-
Run
$ composer update sdslabs/*
-
Add
SDSLabs\Quark\QuarkServiceProvider::class,
under* Package Service Providers...
toconfig/app.php
. -
Remove the migration file for
create_users_table
andpassword_resets_table
fromdatabase/migrations
. -
Add
$this->call(SDSLabs\Quark\Database\Seeds\DatabaseSeeder);
toDatabaseSeeder
underdatabase/seeds
. -
Add following config to
.env.example
and also to.env
:
FALCON_CLIENT_ID=client_id
FALCON_CLIENT_SECRET=secret
FALCON_URL_ACCESS_TOKEN=http://falcon.sdslabs.local/access_token
FALCON_URL_RESOURCE_ONWER_DETAILS=http://falcon.sdslabs.local/users/
FALCON_ACCOUNTS_URL=http://arceus.sdslabs.local/
FALCON_SCOPES=email,image_url
-
ORGANIZATIONS_ALLOWED
in.env.example
can be provided in master app's.env
-
Update
config/auth.php
:- Update the
defaults.guard
tofalcon
- Delete the section on
guards
- Update the
-
Run the migrations with:
$ php artisan migrate
-
Run the seeds with:
$ php artisan db:seed
-
Go outside and do a dance ;)
To extend any of the default models, first create the new model.
Then add a line like $this->app->bind(QuarkCompetition::class, AppCompetition::class);
to AppServiceProvider.php
's register method.
Just override the router with your controller's methods
-
Don't explicitly call the static methods of any class like
Competition::get()
orSomethingHelper::help()
. Instead use the IoC container or Facades/Contracts .
e.g.App::resolve(Competition::class)->get()
-
Don't initialise the classes manually like
new Competition()
. Instead use IoC container'smake
method. -
The above practices makes it easier to swap the underlying classes, i.e. the classes used by Quark can be extended by the application and the extended classes will be used inside Quarks's classes/
- First you need an application. If you don't have one already setup, setup a demo application following the above instructions
- Symlink the
vendor/sdslabs/quark
folder to your local clone of quark.
Read here to know our contribution guidelines. Ping us at chat.sdslabs.co to get guidance. You can start with setting up Quark on your machine and try solving a few bugs listed here: https://github.com/sdslabs/quark/issues You can also have a look at the sample app sdslabs/laplace-no-ma that uses Quark.
This project is under the MIT license
If you are interested in talking to the SDSLabs team, you can find us on our SDSLabs Open Source Discord Server. Feel free to drop by and say hello. You'll find us posting about upcoming features and beta releases, answering technical support questions, and contemplating world peace.Created by SDSLabs with ❤️