Sign inSign up

fvergaracl/game

By fvergaracl

•Updated 4 months ago

GAME (Goals And Motivation Engine) is a gamification engine

Image
API management
0

9.5K

fvergaracl/game repository overview

GAME (Goals And Motivation Engine) is a system designed to foster motivation and achievement of goals through gamification. This open-source project utilizes a PostgreSQL database and is developed with FastAPI in Python, managed via Poetry for environment handling.

It's an open-source project. Code available in https://github.com/fvergaracl/GAME⁠

⁠Environment variables

The GAME system is designed to drive user motivation and goal achievement through gamification. These environment variables control its behavior, including database connections, API settings, and key operational configurations.

VariableTypeDescription
VERSION_APPStringSpecifies the version of the GAME API (e.g., 1.0.0).
ENVStringDefines the environment for the application (e.g., dev, prod).
DB_ENGINEStringThe database engine used, typically postgresql in this case.
DB_NAMEStringThe name of the database that GAME connects to.
DB_USERStringThe database user required for authentication.
DB_PASSWORDStringPassword for the database user.
DB_HOSTStringHost where the database is running (e.g., localhost).
DB_PORTIntegerThe port where the PostgreSQL database is accessible (e.g., 5432).
DATABASE_URLStringThe full connection URL for the database, including credentials and host.
DEFAULT_CONVERSION_RATE_POINTS_TO_COINIntegerDefault conversion rate from points to coins in the gamification system.
API_URL_KPIStringURL of the API endpoint for KPI (Key Performance Indicators) and health checks.

Additional Notes:

  • The database URL (DATABASE_URL) integrates the engine, user, password, host, and port into a single string, making it easier to configure and connect to the database.
  • The conversion rate from points to coins is critical to the gamification aspect, providing a default value unless overridden in the application.

⁠2. Keycloak Configuration

Keycloak is an open-source identity and access management tool used to secure the GAME system's API. The variables in this section define how the GAME system interacts with Keycloak for authentication and authorization.

VariableTypeDescription
KEYCLOAK_ADMINStringUsername for the Keycloak administrator.
KEYCLOAK_ADMIN_PASSWORDStringPassword for the Keycloak administrator.
KEYCLOAK_REALMStringThe realm used in Keycloak for authentication purposes.
KEYCLOAK_AUDIENCEStringThe audience for Keycloak authentication tokens.
KEYCLOAK_CLIENT_IDStringThe ID of the client that GAME uses to communicate with Keycloak.
KEYCLOAK_CLIENT_SECRETStringClient secret for authenticating the GAME API in Keycloak.
KEYCLOAK_URLStringBase URL of the Keycloak server.
KEYCLOAK_URL_DOCKERStringKeycloak URL specific to a Docker environment (e.g., http://keycloakGame:8080).

Additional Notes:

  • Keycloak is used to manage users, roles, and permissions within the GAME system. The KEYCLOAK_REALM variable ensures that the correct user domain is referenced.
  • The KEYCLOAK_CLIENT_ID and KEYCLOAK_CLIENT_SECRET are essential for API-to-API communications, ensuring that only authorized clients can access secure endpoints.

⁠3. Kubernetes Configuration

These variables configure the deployment of GAME within a Kubernetes cluster. They handle routing, database connections, and TLS security. The Kubernetes configuration ensures scalability and reliability for production environments.

VariableTypeDescription
GAMIFICATIONENGINE_CERT_ISSUERStringCertificate issuer for TLS (e.g., letsencrypt).
GAMIFICATIONENGINE_INGRESS_NAMEStringThe name of the Kubernetes Ingress resource for routing traffic.
GAMIFICATIONENGINE_NAMESPACEStringKubernetes namespace for isolating GAME components.
GAMIFICATIONENGINE_INGRESS_HOSTStringHostname used by the Ingress for external traffic (e.g., example.com).
GAMIFICATIONENGINE_BACKEND_SERVICE_NAMEStringName of the backend service for the GAME API.
GAMIFICATIONENGINE_BACKEND_SERVICE_PORTIntegerPort used by the backend service (e.g., 8000).
GAMIFICATIONENGINE_TLS_SECRET_NAMEStringKubernetes secret name for storing TLS certificates.
GAMIFICATIONENGINE_SERVICE_NAMEStringGeneral service name for the GAME API within Kubernetes.
GAMIFICATIONENGINE_SERVICE_NAME_POSTGRESStringPostgreSQL service name in Kubernetes.
GAMIFICATIONENGINE_DATABASE_URLStringDatabase connection URL used within the Kubernetes cluster.
GAMIFICATIONENGINE_DB_ENGINEStringDatabase engine for the Kubernetes environment (e.g., postgresql).
GAMIFICATIONENGINE_DB_HOSTStringHostname for the database in Kubernetes.
GAMIFICATIONENGINE_DB_NAMEStringDatabase name for the Kubernetes environment.
GAMIFICATIONENGINE_DB_PASSWORDStringPassword for the PostgreSQL database in Kubernetes.
GAMIFICATIONENGINE_DB_PORTIntegerPort for the PostgreSQL database in Kubernetes (e.g., 5432).
GAMIFICATIONENGINE_DB_USERStringUsername for accessing the PostgreSQL database in Kubernetes.
GAMIFICATIONENGINE_DEFAULT_CONVERSION_RATE_POINTS_TO_COINIntegerDefault conversion rate for points to coins in the Kubernetes environment.
GAMIFICATIONENGINE_ENVStringThe application environment setting in Kubernetes (e.g., prod).
GAMIFICATIONENGINE_VERSION_APPStringThe version of the GAME application deployed in Kubernetes.

Additional Notes:

  • The GAMIFICATIONENGINE_NAMESPACE helps in logically grouping resources within Kubernetes, ensuring that all services, deployments, and configurations for GAME are isolated from other applications.
  • The GAMIFICATIONENGINE_INGRESS_HOST and GAMIFICATIONENGINE_TLS_SECRET_NAME are critical for exposing the application securely to the outside world, using TLS encryption for data in transit.

Tag summary

Content type

Image

Digest

sha256:d98e2dae9…

Size

127.7 MB

Last updated

4 months ago

docker pull fvergaracl/game