Read the API documentation
UNDER DEVELOPEMENT
This project aims to add some crucial but missing functionality to Webling, while using Weblings RESTful API and exposing a new, higher lever RESTful API. It is based on the fabulous Laravel framework to speed up the development. Check out the docs and start contributing 😍.
... is cool, simple and helps to make the 🌍 a better place 🤩
- Install docker
- Start docker
- Clone this repo
git clone https://github.com/grueneschweiz/weblingservice.git
cd
into the folder containing the repo- if it doesn't exists already, create the shared network
docker network create gruene-services-bridge-network
- Execute
docker compose run weblingservice composer install
and have a ☕️ while it installs. - Execute
docker compose up -d
to start up the stack. The first time you run this command, it will take a minute or two. Subsequent calls will be much faster. - Execute
docker exec wsapp cp .env.example .env
to get an instance of the environment variables - Execute
docker exec wsapp php artisan key:generate
to generate the app secrets - Execute
docker exec wsapp php artisan migrate
to initialise the database tables - Execute
docker exec wsapp php artisan passport:install
to setup oAuth2
Yupii, you're nearly done. Just add the WEBLING_API_KEY
, WEBLING_FINANCE_ADMIN_API_KEY
, WEBLING_BASE_URL
to the .env
file and you're ready to go. From now on, you can just start up the
stack with a single docker compose up -d
, without repeating all the commands
from above.
- Start up:
docker compose up -d
- Shut down:
docker compose down
- Execute Laravel CLI commands (enter container):
docker exec -it wsapp bash
useexit
to escape the container. - Add dependency using composer:
docker compose run wsapp composer require DEPENDENCY
All mail you send out of the application will be caught by Mailhog
Use the handy phpMyAdmin or access the mysql CLI using
docker exec -it wsmysql mysql --user=laravel --password=laravel laravel
The CLI is your interface.
php artisan client:list
lists all clientsphp artisan client:add <name> (--root-group=<id>)...
adds new clients. You may add multiple root groups while repeating the option (speed things up using the-g
shorthand).php artisan client:delete <client-id>
deletes your client. Add multiple client_ids separated by a space to delete several clients at a time.php artisan client:edit <client-id> [--name=<new-name>] [--root-group=<id>]...
updates your client. If you provide any group ids, the client is linked to only the given groups. Earlier assignments that are not in the list, are removed.
curl -X POST \
-F "grant_type=client_credentials" \
-F "client_id=%client_id%" \
-F "client_secret=%client_secret%" \
-F "scope=" \
https://%mydomain.tld%/oauth/token
curl -X GET "https://%mydomain.tld%/api/v1/member/%member-id%" \
-H "Authorization: Bearer %token%" \
-H "Content-Type: application/json"