{"id":20021455,"url":"https://github.com/dieg0code/portfolio_01_player_profile","last_synced_at":"2026-04-12T14:50:12.036Z","repository":{"id":248784084,"uuid":"829730450","full_name":"Dieg0Code/portfolio_01_player_profile","owner":"Dieg0Code","description":"Monolithic API built with Golang, implements DevSecOps and best practices (like TDD), diagrams, static code analysis, vulnerability analysis and more.","archived":false,"fork":false,"pushed_at":"2025-02-13T04:27:56.000Z","size":367,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T05:25:25.843Z","etag":null,"topics":["aws","cicd","devsecops","docker","golang","mermaid-diagrams","snyk","sonarqube","tdd","terraform"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Dieg0Code.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-17T00:41:24.000Z","updated_at":"2024-09-06T06:27:21.000Z","dependencies_parsed_at":"2024-08-01T22:17:47.742Z","dependency_job_id":"05d5ad54-14e3-4b52-9609-ef56850e2c4a","html_url":"https://github.com/Dieg0Code/portfolio_01_player_profile","commit_stats":null,"previous_names":["dieg0code/portfolio_01_player_profile"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dieg0Code%2Fportfolio_01_player_profile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dieg0Code%2Fportfolio_01_player_profile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dieg0Code%2Fportfolio_01_player_profile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dieg0Code%2Fportfolio_01_player_profile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dieg0Code","download_url":"https://codeload.github.com/Dieg0Code/portfolio_01_player_profile/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241455377,"owners_count":19965602,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","cicd","devsecops","docker","golang","mermaid-diagrams","snyk","sonarqube","tdd","terraform"],"created_at":"2024-11-13T08:36:49.912Z","updated_at":"2025-12-31T01:06:48.495Z","avatar_url":"https://github.com/Dieg0Code.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Project 01 - Player Profile\n\n## Description\n\nThe project consists of a REST API that exposes a database managing 3 entities:\n\n- User\n- PlayerProfile\n- Achievement\n\nA User can have multiple PlayerProfiles, and a PlayerProfile can have multiple Achievements.\n\nThe relationship would be as follows:\n\n```mermaid\n---\ntitle: DB Players\n---\n\nerDiagram\n    USER {\n        int user_id PK\n        string username\n        string password\n        string email\n        int age\n    }\n\n    PLAYERPROFILE {\n        int player_profile_id PK\n        string nickname\n        string avatar\n        int level\n        int experience\n        int points\n        int user_id FK\n    }\n\n    ACHIEVEMENT {\n        int achievement_id PK\n        string name\n        string description\n        int player_profile_id FK\n    }\n\n    USER ||--o{ PLAYERPROFILE : owns\n    PLAYERPROFILE ||--o{ ACHIEVEMENT : unlocks\n```\n\n## Technologies\n\n- Golang 1.22.1\n- Gin Gonic\n- Gorm\n- PostgreSQL\n- Docker\n- Docker Compose\n- Makefile\n- GitHub Actions\n- Terraform\n- AWS\n- Swagger\n- SonarCloud\n- Synk\n\nThe application consists of an API with respective endpoints for each entity. PostgreSQL is used as the database, and Docker Compose is used to set up both the database and the application. Deployment is handled via a GitHub Actions pipeline to an AWS environment using Terraform.\n\n## Class Diagram\n\n```mermaid\nclassDiagram\n    class User {\n        +int ID\n        +string Username\n        +string Password\n        +string Email\n        +int Age\n        +[]PlayerProfile Profiles\n        +CreateUser() error\n        +GetUser(id int) (User, error)\n        +UpdateUser() error\n        +DeleteUser() error\n    }\n\n    class PlayerProfile {\n        +int ID\n        +string Nickname\n        +string Avatar\n        +int Level\n        +int Experience\n        +int Points\n        +int UserID\n        +User User\n        +[]Achievement Achievements\n        +CreateProfile() error\n        +GetProfile(id int) (PlayerProfile, error)\n        +UpdateProfile() error\n        +DeleteProfile() error\n    }\n\n    class Achievement {\n        +int ID\n        +string Name\n        +string Description\n        +int PlayerProfileID\n        +PlayerProfile PlayerProfile\n        +CreateAchievement() error\n        +GetAchievement(id int) (Achievement, error)\n        +UpdateAchievement() error\n        +DeleteAchievement() error\n    }\n\n    User \"1\" --o \"*\" PlayerProfile : has\n    PlayerProfile \"1\" --o \"*\" Achievement : unlocks\n```\n\n## Endpoints\n\n### User\n\n- **GET /users**: Returns all users.\n- **GET /users/{id}**: Returns a user by their id.\n- **POST /users**: Creates a user.\n- **PUT /users/{id}**: Updates a user by their id.\n\n### PlayerProfile\n\n- **GET /player-profiles**: Returns all player profiles.\n- **GET /player-profiles/{id}**: Returns a player profile by its id.\n- **POST /player-profiles**: Creates a player profile.\n- **PUT /player-profiles/{id}**: Updates a player profile by its id.\n\n### Achievement\n\n- **GET /achievements**: Returns all achievements.\n- **GET /achievements/{id}**: Returns an achievement by its id.\n- **POST /achievements**: Creates an achievement.\n- **PUT /achievements/{id}**: Updates an achievement by its id.\n\n```mermaid\nsequenceDiagram\n    actor Client\n    participant Auth\n    participant User\n    participant PlayerProfile\n    participant Achievement\n\n    Client-\u003e\u003eAuth: POST /auth/login\n    Auth--\u003e\u003eClient: JWT Token\n\n    Client-\u003e\u003eUser: GET /api/v1/users\n    User--\u003e\u003eClient: Paginated list of users\n\n    Client-\u003e\u003eUser: POST /api/v1/users\n    User--\u003e\u003eClient: User created\n\n    Client-\u003e\u003ePlayerProfile: GET /api/v1/player-profiles\n    PlayerProfile--\u003e\u003eClient: Paginated list of player profiles\n\n    Client-\u003e\u003ePlayerProfile: POST /api/v1/player-profiles\n    PlayerProfile--\u003e\u003eClient: Player profile created\n\n    Client-\u003e\u003eAchievement: GET /api/v1/achievements\n    Achievement--\u003e\u003eClient: Paginated list of achievements\n\n    Client-\u003e\u003eAchievement: POST /api/v1/achievements\n    Achievement--\u003e\u003eClient: Achievement created\n\n    Client-\u003e\u003eAuth: POST /auth/logout\n    Auth--\u003e\u003eClient: Session closed\n```\n\n## AWS Infrastructure\n\n- **VPC**: For the internal virtual private network configuration of the application.\n- **EC2**: For the creation of the virtual instance hosting the application.\n- **RDS**: For the creation of the PostgreSQL database.\n- **Security Groups**: For configuring the application’s inbound and outbound ports.\n- **IAM**: For creating the necessary roles and permissions for the application.\n- **S3**: For storing Terraform configuration files.\n\n## Architecture Diagram\n\n```mermaid\ngraph TB\n    subgraph \"GitHub\"\n        A[Code Repository]\n        B[GitHub Actions]\n    end\n\n    subgraph \"AWS Cloud\"\n        subgraph \"VPC\"\n            C[EC2 Instance]\n            D[RDS PostgreSQL]\n            E[Security Groups]\n        end\n        F[IAM Roles]\n        G[S3 Bucket]\n    end\n\n    subgraph \"Developer Environment\"\n        H[Docker Compose]\n        I[Local PostgreSQL]\n        J[API Application]\n    end\n\n    A --\u003e|Trigger| B\n    B --\u003e|Deploy| C\n    B --\u003e|Configure| F\n    B --\u003e|Store State| G\n    C --\u003e|Connect| D\n    C --\u003e|Uses| E\n    C --\u003e|Access| F\n    H --\u003e|Local Development| I\n    H --\u003e|Local Development| J\n    J --\u003e|Deployed to| C\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdieg0code%2Fportfolio_01_player_profile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdieg0code%2Fportfolio_01_player_profile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdieg0code%2Fportfolio_01_player_profile/lists"}