From 74fcc75ee910fb880c0bd1c3ed55147781d6bdca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Murat=20Emir=20Cabaro=C4=9Flu?= Date: Sat, 6 Feb 2021 00:06:21 +0300 Subject: [PATCH] update instalation steps and add basic usage of this project --- README.md | 69 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 61 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5567c50..ba9f49e 100644 --- a/README.md +++ b/README.md @@ -2,20 +2,73 @@ Association software by [Özgür Yazılım Derneği](https://oyd.org.tr) -### Dev install +## Dev install ```bash # clone the repository and get submodules -git clone https://git.oyd.org.tr/oyd/Adunatio.git -cd Adunatio -git submodule init -git submodule update -docker-compose -f docker-compose-dev.yaml up +git clone --recurse-submodules git@git.oyd.org.tr:oyd/Adunatio.git Adunatio + +# Go to project directory +cd Adunatio + +# Create a encrytion key +ssh-keygen -t rsa -b 4096 -f ./privkey.pem + +# Run all system with docker +docker-compose -f docker-compose-dev.yaml up --build -d +``` + +You can access Adunatio from + +## How to use + +- First, You must create a union from here + +- Check your union password in logs. With this command, you should see this kind of line in logs + +```sh +docker-compose -f docker-compose-dev.yaml logs web + +... +... +[2021-02-04 20:39:16,685] INFO in Union: New union password : +... ``` -You can access Adunatio from +- login with your union and get your Berear token. Your username is combination of your `Legal Registration Number` and `@root` + +```sh +# Example Request with curl +curl --request POST \ + --url http://localhost:5000/auth/login \ + --header 'Content-Type: application/json' \ + --data '{ + "username":"@root", + "password":"" +}' + +# Response +{ + "access_token": "", + "status": true +} +``` + +- Test avaliable endpoints with your Berear token. Note that, header title must be `Adunation_Session_Token` + +```sh +export ACCESS="" +``` + +```sh +curl -H "Adunation_Session_Token: Bearer $ACCESS" http://localhost:5000/api/user/ +``` + +```sh +curl -H "Adunation_Session_Token: Bearer $ACCESS" http://localhost:5000/api/union/ +``` -### License +## License Copyright (C) 2021 Özgür Yazılım Derneği