Skip to content
Max Vaessen edited this page May 11, 2020 · 3 revisions

With a self-hosted Community website you can modify all aspects to your likings. This guide assume you forked the Community Website and have it up and running on your own webserver.

Basic information

The Community website is build upon the Laravel Framework 5.4. Please consult the Laravel documentation for more information about Laravel.

MVC

Laravel is build using a MVC (model view controller) structure. The models in the Community website represent API models and are automatically converted into models for you.

Community website basics

The Community Website retrieves all information from GSA using the GSA API. This includes the page setup. You can use the page builder to build up a page or build a custom page. All features and data is available to both page builder pages and custom pages. To create new page builder blocks, GSA has to add these to the page builder.

You can find the page builder blocks in resources/views/pages/v1/page/blocks.

Get data via API

With the special Helpers and Wrappers, you can easily retrieve data from the API. In the HomeController you can find a good example of how data can be retrieved. It uses GameserverApp\Api\Client (a GSA API Wrapper) to get information like Top Characters, all servers and community statistics. The Client wrapper handles authentication stuff for you automatically.

Custom API requests

You can create your own API requests, using the OAuth API Wrapper (app/GameserverApp/Api/OAuthApi.php). This can be used to retrieve user data, make a guest request or an auth (authenticated) request. A public request retrieves data available for everyone. Information that is specific to a user or group can only be retrieved using an auth (authenticated) request.

Steam authentication

The authentication flow ensures player data can only be accessed by the rightful owner (the player). This also means that no community admin is able to read private messages from a player. Every steam account can authenticate with a Community website. If the player has never played on your servers, some actions might be restricted.

The steam auth flow happens on the GSA system, the flow happens like this:

  1. Community website redirects user to a special GSA dashboard link
  2. GSA Dashboard redirects user to Steam, for authentication
  3. User logs in on steam
  4. User is redirected back to a special link on GSA dashboard
  5. User is redirected back to Community website
  6. Community website requests access_token based on GSA Auth code
  7. GSA sends back access token to Community website
  8. Community website sets cookie with user, which is used on all API calls