diff --git a/server/README.md b/server/README.md new file mode 100644 index 000000000..a5328da75 --- /dev/null +++ b/server/README.md @@ -0,0 +1,23 @@ +# Xef Server + +The server module for the xef project. + +## Run Server + +In order to run the server, you need to run the following services: + +### Docker + +```bash + docker-compose -f docker/postgresql/docker-compose.yaml up +``` + +### Server + +```bash + ./gradlew server +``` + +### Web + +Please, refer to the [web README](web/README.md) for more information. diff --git a/server/docs/postman/xef_postman_collection.json b/server/docs/postman/xef_postman_collection.json new file mode 100644 index 000000000..24a35e25a --- /dev/null +++ b/server/docs/postman/xef_postman_collection.json @@ -0,0 +1,377 @@ +{ + "info": { + "_postman_id": "f3a7d08a-fbff-4d0b-9027-822bda25fbea", + "name": "Xef", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "28673065" + }, + "item": [ + { + "name": "Organizations", + "item": [ + { + "name": "Create Organization", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"TestOrganization\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{url}}/v1/settings/org", + "host": [ + "{{url}}" + ], + "path": [ + "v1", + "settings", + "org" + ] + } + }, + "response": [] + }, + { + "name": "Update Org", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_token}}", + "type": "string" + } + ] + }, + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"TestOrganization\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{url}}/v1/settings/org/10", + "host": [ + "{{url}}" + ], + "path": [ + "v1", + "settings", + "org", + "10" + ] + } + }, + "response": [] + }, + { + "name": "Get Orgs", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{url}}/v1/settings/org", + "host": [ + "{{url}}" + ], + "path": [ + "v1", + "settings", + "org" + ] + } + }, + "response": [] + }, + { + "name": "Get Org", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{url}}/v1/settings/org/8", + "host": [ + "{{url}}" + ], + "path": [ + "v1", + "settings", + "org", + "8" + ] + } + }, + "response": [] + }, + { + "name": "Get users in org", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{url}}/v1/settings/org/10/users", + "host": [ + "{{url}}" + ], + "path": [ + "v1", + "settings", + "org", + "10", + "users" + ] + } + }, + "response": [] + }, + { + "name": "Delete organization", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_token}}", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [], + "url": { + "raw": "{{url}}/v1/settings/org/10", + "host": [ + "{{url}}" + ], + "path": [ + "v1", + "settings", + "org", + "10" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Login", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"email\": \"jc@xebia.com\",\n \"password\": \"1234\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{url}}/login", + "host": [ + "{{url}}" + ], + "path": [ + "login" + ] + } + }, + "response": [] + }, + { + "name": "Register", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"JC2\",\n \"email\": \"jc2@xebia.com\",\n \"password\": \"1234\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{url}}/register", + "host": [ + "{{url}}" + ], + "path": [ + "register" + ] + } + }, + "response": [] + } + ], + "auth": { + "type": "oauth2", + "oauth2": [ + { + "key": "scope", + "value": "openid https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/accounts.reauth https://www.googleapis.com/auth/cloud-platform.read-only", + "type": "string" + }, + { + "key": "clientSecret", + "value": "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", + "type": "string" + }, + { + "key": "clientId", + "value": "387578666249-m407m87ks7jolf2lhflhtlm5heouubah.apps.googleusercontent.com", + "type": "string" + }, + { + "key": "accessTokenUrl", + "value": "https://oauth2.googleapis.com/token", + "type": "string" + }, + { + "key": "authUrl", + "value": "https://accounts.google.com/o/oauth2/auth", + "type": "string" + }, + { + "key": "useBrowser", + "value": true, + "type": "boolean" + }, + { + "key": "tokenName", + "value": "xef", + "type": "string" + }, + { + "key": "addTokenTo", + "value": "header", + "type": "string" + } + ] + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ], + "variable": [ + { + "key": "url", + "value": "0.0.0.0:8081", + "type": "string" + }, + { + "key": "access_token", + "value": "", + "type": "string" + } + ] +}