Skip to content

Omskriving av intoit sin frontend. Bygget med TypeScript, Hooks og Redux

Notifications You must be signed in to change notification settings

Casperfeng/intoit-frontend2.0

Repository files navigation

Deprecated

Why are the production/dev id's displayed publicly?

As of mid 2020, the project is no longer being developed/maintained.

Installation

  • npm install
  • npm start

Git-conventions

branches:

  • master: update only for deployment (merge from dev)
  • dev: development branches, update continously
  • feat/feature-name: a branch that creates/improves a new feature into dev
  • design/area-name: a branch that creates/improves GUI/UX into dev
  • fix/bug-name: a branch that fix a bug for dev

Pull request:

  • At least two collaborators have to approve a pull request before it is merged in to dev-branch
  • Always use "Squash and merge" as merge-options

Technologies

GUI is developed with ReactJS using functional components and hooks. Redux is used for state management and TypeScript is used for the entire application.

Styling is done with styled-components.

Resources

Subject

Exercise

Subject

Fetch all subjects

Get list of all subjects. Every subject has a field 'favorite' that communicates that a subject has been favorited by the client

GET /subjects

Headers:

  • Client-Id: (Optional) To authenticate user

Success response:

200 OK
[
  {
    "id": 1,
    "name": "Learn about Barack Obama",
    "code": "TDT4242",
    "description": "Just Barack Obama",
    "color": "3ea12c",
    "published": "yes",
    "favorite": false
  }
]

Fetch subject

GET /subjects/{subjectId}

Headers:

  • Client-Id: (Optional) To authenticate user

Success response:

200 OK
{
  "id": 1,
  "name": "Learn about Barack Obama",
  "code": "TDT4242",
  "description": "Just Barack Obama",
  "color": "3ea12c",
  "published": "yes",
  "collections": []
}

Add subject to favorites

PUT /subjects/{subjectId}

Required headers:

  • Client-Id: (Required) To authenticate user

Data

{
  "favorite": true / false
}

Success response:

204 No content

Exercise

Answer exercise

PUT /exercises/{exerciseId}

Required headers:

  • Client-Id: (Required) To authenticate user

Data

{
  "answer_status": true
}

Success response:

204 No content

Report exercise

POST /exercises/{exerciseId}/reports

Data

{
  "message": "String",
  "device": "String",
  "email": "Optional String"
}

Success response:

201 Created

About

Omskriving av intoit sin frontend. Bygget med TypeScript, Hooks og Redux

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published