Skip to content
This repository was archived by the owner on Oct 14, 2018. It is now read-only.
This repository was archived by the owner on Oct 14, 2018. It is now read-only.

Intro Arquitectura #11

@UlisesGascon

Description

@UlisesGascon

Hola a todos!

Os paso unas notas (muy en bruto) sobre lo que hablamos ayer en la reunión de cara al manejo de la información esencial, endpoints, etc... lógicamente todo esto puede cambiar y evolucionar a media que vaya detectando problemas o queramos realizar cambios :)

Arquitectura

Front

Back

  • Node.js
  • Express.js (Servidor HTTP)
  • Passport.js (Social Login)
  • MongoDB (Base de datos)

Endpoints de la API

Proyectos

  • [GET] .../api/v1/projects
  • [GET] .../api/v1/projects/{ID Proyecto}

Contributors

  • [GET] .../api/v1/contributors/
  • [GET] .../api/v1/contributors/{ID Colaborador}

Projects Render

.../api/v1/projects
Es un Array que contiene todos los proyectos y sus detalles, ver .../api/v1/projects/{ID Proyecto}

.../api/v1/projects/{ID Proyecto}

En principio la información básica de los repos esta disponible en este endpoint de la API de Github.

{
    "id": 73019950,
    "name": "c9scripts",
    "full_name": "OSWeekends/c9scripts",
    "owner": {
      "login": "OSWeekends",
      "id": 22908549,
      "avatar_url": "https://avatars2.githubusercontent.com/u/22908549?v=3",
      "gravatar_id": "",
      "url": "https://api.github.com/users/OSWeekends",
      "html_url": "https://github.com/OSWeekends",
      "followers_url": "https://api.github.com/users/OSWeekends/followers",
      "following_url": "https://api.github.com/users/OSWeekends/following{/other_user}",
      "gists_url": "https://api.github.com/users/OSWeekends/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/OSWeekends/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/OSWeekends/subscriptions",
      "organizations_url": "https://api.github.com/users/OSWeekends/orgs",
      "repos_url": "https://api.github.com/users/OSWeekends/repos",
      "events_url": "https://api.github.com/users/OSWeekends/events{/privacy}",
      "received_events_url": "https://api.github.com/users/OSWeekends/received_events",
      "type": "Organization",
      "site_admin": false
    },
    "private": false,
    "html_url": "https://github.com/OSWeekends/c9scripts",
    "description": "Here we will put the c9 scripts to make easier to work with",
    "fork": false,
    "url": "https://api.github.com/repos/OSWeekends/c9scripts",
    "forks_url": "https://api.github.com/repos/OSWeekends/c9scripts/forks",
    "keys_url": "https://api.github.com/repos/OSWeekends/c9scripts/keys{/key_id}",
    "collaborators_url": "https://api.github.com/repos/OSWeekends/c9scripts/collaborators{/collaborator}",
    "teams_url": "https://api.github.com/repos/OSWeekends/c9scripts/teams",
    "hooks_url": "https://api.github.com/repos/OSWeekends/c9scripts/hooks",
    "issue_events_url": "https://api.github.com/repos/OSWeekends/c9scripts/issues/events{/number}",
    "events_url": "https://api.github.com/repos/OSWeekends/c9scripts/events",
    "assignees_url": "https://api.github.com/repos/OSWeekends/c9scripts/assignees{/user}",
    "branches_url": "https://api.github.com/repos/OSWeekends/c9scripts/branches{/branch}",
    "tags_url": "https://api.github.com/repos/OSWeekends/c9scripts/tags",
    "blobs_url": "https://api.github.com/repos/OSWeekends/c9scripts/git/blobs{/sha}",
    "git_tags_url": "https://api.github.com/repos/OSWeekends/c9scripts/git/tags{/sha}",
    "git_refs_url": "https://api.github.com/repos/OSWeekends/c9scripts/git/refs{/sha}",
    "trees_url": "https://api.github.com/repos/OSWeekends/c9scripts/git/trees{/sha}",
    "statuses_url": "https://api.github.com/repos/OSWeekends/c9scripts/statuses/{sha}",
    "languages_url": "https://api.github.com/repos/OSWeekends/c9scripts/languages",
    "stargazers_url": "https://api.github.com/repos/OSWeekends/c9scripts/stargazers",
    "contributors_url": "https://api.github.com/repos/OSWeekends/c9scripts/contributors",
    "subscribers_url": "https://api.github.com/repos/OSWeekends/c9scripts/subscribers",
    "subscription_url": "https://api.github.com/repos/OSWeekends/c9scripts/subscription",
    "commits_url": "https://api.github.com/repos/OSWeekends/c9scripts/commits{/sha}",
    "git_commits_url": "https://api.github.com/repos/OSWeekends/c9scripts/git/commits{/sha}",
    "comments_url": "https://api.github.com/repos/OSWeekends/c9scripts/comments{/number}",
    "issue_comment_url": "https://api.github.com/repos/OSWeekends/c9scripts/issues/comments{/number}",
    "contents_url": "https://api.github.com/repos/OSWeekends/c9scripts/contents/{+path}",
    "compare_url": "https://api.github.com/repos/OSWeekends/c9scripts/compare/{base}...{head}",
    "merges_url": "https://api.github.com/repos/OSWeekends/c9scripts/merges",
    "archive_url": "https://api.github.com/repos/OSWeekends/c9scripts/{archive_format}{/ref}",
    "downloads_url": "https://api.github.com/repos/OSWeekends/c9scripts/downloads",
    "issues_url": "https://api.github.com/repos/OSWeekends/c9scripts/issues{/number}",
    "pulls_url": "https://api.github.com/repos/OSWeekends/c9scripts/pulls{/number}",
    "milestones_url": "https://api.github.com/repos/OSWeekends/c9scripts/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/OSWeekends/c9scripts/notifications{?since,all,participating}",
    "labels_url": "https://api.github.com/repos/OSWeekends/c9scripts/labels{/name}",
    "releases_url": "https://api.github.com/repos/OSWeekends/c9scripts/releases{/id}",
    "deployments_url": "https://api.github.com/repos/OSWeekends/c9scripts/deployments",
    "created_at": "2016-11-06T21:25:08Z",
    "updated_at": "2016-11-06T21:33:46Z",
    "pushed_at": "2017-01-10T12:25:40Z",
    "git_url": "git://github.com/OSWeekends/c9scripts.git",
    "ssh_url": "git@github.com:OSWeekends/c9scripts.git",
    "clone_url": "https://github.com/OSWeekends/c9scripts.git",
    "svn_url": "https://github.com/OSWeekends/c9scripts",
    "homepage": null,
    "size": 9,
    "stargazers_count": 0,
    "watchers_count": 0,
    "language": "Shell",
    "has_issues": true,
    "has_downloads": true,
    "has_wiki": true,
    "has_pages": false,
    "forks_count": 0,
    "mirror_url": null,
    "open_issues_count": 0,
    "forks": 0,
    "open_issues": 0,
    "watchers": 0,
    "default_branch": "master"
  }

Algunas ideas:
Podemos sacar más información (estadisticas básicas, lenguaje, forks, etc...) directamente si atacamos a la api preguntando por el repo, y además podemos sacar más información en detalle:

Contributors Render

.../api/v1/collaborators/
Es un Array que contiene todos los colaboradores y sus detalles, ver .../api/v1/collaborators/{ID Colaborador}

.../api/v1/collaborators/{ID Colaborador}
En principio la información básica de los usuarios esta disponible en este endpoint de la API de Github.

{
  "login": "UlisesGascon",
  "id": 5110813,
  "avatar_url": "https://avatars1.githubusercontent.com/u/5110813?v=3",
  "gravatar_id": "",
  "url": "https://api.github.com/users/UlisesGascon",
  "html_url": "https://github.com/UlisesGascon",
  "followers_url": "https://api.github.com/users/UlisesGascon/followers",
  "following_url": "https://api.github.com/users/UlisesGascon/following{/other_user}",
  "gists_url": "https://api.github.com/users/UlisesGascon/gists{/gist_id}",
  "starred_url": "https://api.github.com/users/UlisesGascon/starred{/owner}{/repo}",
  "subscriptions_url": "https://api.github.com/users/UlisesGascon/subscriptions",
  "organizations_url": "https://api.github.com/users/UlisesGascon/orgs",
  "repos_url": "https://api.github.com/users/UlisesGascon/repos",
  "events_url": "https://api.github.com/users/UlisesGascon/events{/privacy}",
  "received_events_url": "https://api.github.com/users/UlisesGascon/received_events",
  "type": "User",
  "site_admin": false,
  "name": "Ulises Gascón",
  "company": "@OSWeekends | @fictizia",
  "blog": "http://blog.ulisesgascon.com",
  "location": "Madrid",
  "email": null,
  "hireable": true,
  "bio": "Maker,  Developer, Open Source Evangelist | Co-organizer in @OSWeekends  | Instructor in @fictizia ",
  "public_repos": 161,
  "public_gists": 48,
  "followers": 90,
  "following": 187,
  "created_at": "2013-07-29T06:55:12Z",
  "updated_at": "2017-03-01T13:21:37Z"
}

Algunas ideas:

  • Podría ser interesante sustituir la propiedad /orgs por las organizaciones a las que realmente pertenece el usuario.

Objetivos primarios (Back)

  • Obtención y armonización de la información referente a los colaboradores y los proyectos de la organización

Objetivos secundarios (Back)

  • Actualización de la base de datos. Se puede hacer utilizando webhooks (probablemente), o podemos hacer uso de la propiedad pushed_at de los repositorios para así saber cuando se produjo el último cambio, y realizar un recorrido por los repos de la organización cada hora para poder saber que ha cambiado o no ... podemos usar Scheduled para gestionar las tareas CRON.

Dudas/Ideas

El proyecto debería dar soporte a más de una organización. Ya que puede darse el caso de tener varias organizaciones vinculadas entre si pero con una relación de jerarquía. Véase OSWeekends, Ginger Code y GoblinDB.... En principio deberíamos introducir en nuestra api y base de datos este concepto de Organización principal y Organizaciones secundarias (o derivadas)...

Voto por hacer una planificación del proyecto dividiendo todo en milestones y agrupando así los issues, permitiendo el trabajo front/back en paralelo y asegurando la integridad minima necesaria por release entre back y front.

¿Realmente necesitamos hacer un login social? Estoy pensando que con la cantidad de información disponible desde la API... la mayor parte ya existe. Y para las cosas que no existen, igual podemos hacer uso de una arquitectura un poco más alternativa como un google Sheet + Google Forms que también permite añadirse con fuente de datos (formato JSON). Y es un poquito más innovador :D

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions