Skip to content
Juan Ignacio Cuiule edited this page Jul 13, 2017 · 2 revisions

Models

Dashboard

{
    "_id": String
  , "domain": String
  , "title": String
  , "description": String
  , "link": String
  , "open": Boolean
  , "showcase": [String] //Project ids in the order for showcase
  , "covers": [String] //contained projects cover list
  , "projectsCount": Number
  , "created_at": Date
  , "owner": User // Creator of this dashboard
}

User

{
    "_id": String
  , "provider": String
  , "username": String
  , "name": String
  , "picture": String
  , "admin_in": [String] //dashboard domains where the user is admin or owner
  , "bio": String
  , "created_at": Date
}

Profile

A User Model plus following info:

{
    "collections": [Collection]
  , "dashboards": [Dashboard]
  , "projects": [Project]
  , "contributions": [Project]
  , "likes": [Project]
}

Project

{
    "_id": String
  , "title": String
  , "domain": String
  , "description": String
  , "leader": User
  , "status": String
  , "contributors": [User]
  , "followers": [User]
  , "cover": String
  , "link": String
  , "tags": [String]
  , "active": Boolean
  , "created_at": Date
}

Collection

{
    "_id": String
  , "owner": User
  , "title": String
  , "description": String
  , "dashboards": [Dashboard]
  , "created_at": Date
}

Resources

Cross-origin resource sharing (CORS)

  • GET /api/v2/dashboards
  • GET /api/v2/dashboards/:domain
  • GET /api/v2/projects
  • GET /api/v2/projects/:project_id
  • GET /api/v2/users
  • GET /api/v2/users/:user_id
  • GET /api/v2/profiles/:user_id
  • GET /api/v2/:dashboard_domain/admins
  • GET /api/v2/:dashboard_domain/projects
  • GET /api/v2/collections
  • GET /api/v2/collections/:collection_id

Dashboards

  • Get a dashboard by subdomain CORS
    GET /api/v2/dashboards/:dashboard-subdomain
    Response: Dashboard Model

  • Update a dashboard by subdomain
    PUT /api/v2/dashboards/:dashboard-subdomain
    RequestBody: Dashboard Model
    Response: Empty

  • Create a dashboard
    POST /api/v2/dashboards
    RequestBody: Dashboard Model
    Response: Dashboard Model

  • Search dashboards by subdomain, title and description CORS
    GET /api/v2/dashboards?q=[keywords]
    Response: Array: Dashboard Model

  • Get a dashboard CSV export
    GET /api/v2/dashboards/:dashboard-subdomain/csv
    Response: CSV file

Projects

  • Search projects by title, description and tags CORS
    GET /api/v2/projects?q=[keywords]
    Response: Array: Project Model

  • Create a project into a dashboard
    POST /api/v2/projects
    RequestBody: Project Model
    Response: Project Model

  • Get a project CORS
    GET /api/v2/projects/:id
    Response: Project Model

  • Update a project
    PUT /api/v2/projects/:id
    RequestBody: Project Model
    Response: Empty

  • Remove a project
    DELETE /api/v2/projects/:id
    RequestBody: Empty
    Response: Empty

  • Add login user as follower to a project
    POST /api/v2/projects/:pid/followers

  • Remove login user from follower of a project
    DELETE /api/v2/projects/:pid/followers

  • Add login user as contributor to a project
    POST /api/v2/projects/:pid/contributors

  • Remove login user from contributor of a project
    DELETE /api/v2/projects/:pid/contributors

Users

  • Search users by name and username CORS
    GET /api/v2/users?q=[keywords]
    Response: Array: User Model

  • Get Dashboard Administrators CORS
    GET /api/v2/:dash-domain/admins
    Response: Array: User Model

  • Add Dashboard Administrator
    POST /api/v2/:dash-domain/admins/:user-id
    Response: User Model

  • Get a user CORS
    GET /api/v2/users/:id
    Response: User Model

  • Get a profile CORS
    GET /api/v2/profiles/:userId
    Response: Profile Model

  • Get site Team
    GET /api/v2/users/team
    Response: Profile Model

  • Update a user
    PUT /api/v2/profiles/:id
    RequestBody: User Model
    Response: Empty

Collections

  • Search collections by title and description CORS
    GET /api/v2/collections?q=[keywords]
    Response: Array: Collection Model

  • Create a collection
    POST /api/v2/collections
    RequestBody: Collection Model
    Response: Collection Model

  • Get a collection CORS
    GET /api/v2/collections/:id
    Response: Collection Model

  • Update a collection
    PUT /api/v2/collections/:id
    RequestBody: Collection Model
    Response: Empty

  • Remove a collection
    DELETE /api/v2/collections/:id
    RequestBody: Empty
    Response: Empty

  • Add a dashboard to a collection
    POST /api/v2/collections/:cid/dashboards/:did
    RequestBody: Empty
    Response: Empty

  • Remove a dashboard to a collection
    DELETE /api/v2/collections/:cid/dashboards/:did
    RequestBody: Empty
    Response: Empty