update instalation steps and add basic usage of this project

updateReadme
murat emir cabaroğlu 4 years ago
parent ce660c94e0
commit 74fcc75ee9
  1. 67
      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
git clone --recurse-submodules git@git.oyd.org.tr:oyd/Adunatio.git Adunatio
# Go to project directory
cd Adunatio
git submodule init
git submodule update
docker-compose -f docker-compose-dev.yaml up
# 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 <http://localhost:5000/admin>
## How to use
- First, You must create a union from here <http://localhost:5000/admin/union/>
- 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 : <PASSWORD>
...
```
You can access Adunatio from <http://localhost:5000>
- 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":"<Legal Registration Number>@root",
"password":"<PASSWORD>"
}'
# Response
{
"access_token": "<Your Access Token>",
"status": true
}
```
- Test avaliable endpoints with your Berear token. Note that, header title must be `Adunation_Session_Token`
```sh
export ACCESS="<Your Access Token>"
```
```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

Loading…
Cancel
Save