Skip to content

rarrazaan/be-player-performance-app

Repository files navigation

be-player-performance-app

by. Imam Rafiif Arrazaan

Content

Getting Started

  1. Make .env based on .env.example and populate the env variables.
  2. Make sure the GOOGLE_OAUTH_CLIENT_ID and GOOGLE_OAUTH_CLIENT_SECRET is filled correctly. Here is some video that might help when setting the client_id and client_secret link.
  3. Open the directory terminal and type
make compose-up
  1. To end the program, open the directory terminal and type
make compose-down

Features

Login With Google

This feature enable user to login with their google account. The access token to use protected feature will be stored as a cookie.
Use this feature using web browser (tested on Google Chrome)
Steps:

  1. Open browser and enter url {{HOST}}/oauth/google
  2. Sign in with your google account
  3. You can enter other feature endpoint then

If you want to use Postman/Insomnia etc. After browser shows Login Success message, inspect element, go to Application, select Cookies, click access_token Cookie, and you can get the access token there.

Identity

This feature enable user to get the identity of the searched user by using their firstname as a keyword.
Steps:

  1. Make sure to add access_token cookie before accessing this feature.
  2. Enter endpoint {{HOST}}/api/identity?name={{keyword}}.
  3. Fill the {{keyword}} with wanted identity firstname.

Calculate Performance

This feature enable user to get Diki final proficiency level as int the task.
Steps:

  1. Make sure to add access_token cookie before accessing this feature.
  2. Enter endpoint {{HOST}}/api/identity?n={{var}}&m={{var}}&a={{var}}&b={{var}}.
  3. Fill the {{var}}.

Database Schema

Click me

image info

API Documentation

After running the program, ypu can go to your browser and enter {{HOST}}/swagger/index.html.
OR
Open the directory terminal and type

swag init

Then open the swagger.yaml in docs directory in Swagger Editor
swag use swaggo/swag

Batasan Masalah

  1. Access Token is stored as cookie and need to be used as cookie to use protected feature. Swagger 2.0 can not use cookie as a Header.
  2. User login from browser with their google account.
  3. Make sure DB env variables in .env file are synced with the env variables in the docker-compose.yml file.
  4. Unit testing only be done for the services layer.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published