Skip to content

Instantly share code, notes, and snippets.

@jasoet
Forked from madebyais/service_doc.md
Created February 20, 2018 03:28
Show Gist options
  • Save jasoet/10c35485e0e48ea2fca54c251dfa5869 to your computer and use it in GitHub Desktop.
Save jasoet/10c35485e0e48ea2fca54c251dfa5869 to your computer and use it in GitHub Desktop.
Service documentation

{SERVICE_NAME}

[build_status_badge_if_any] [code_coverage_badge_if_any]

Replace this text with service detail description.

  • What is the purpose of this service ?
  • Background why this service is needed

FEATURES

Replace this text with service main features. Add [feature_requirement_spec_doc_link] if any.

SERVICE TYPE

Replace this text with ***RESTFUL*** or ***GRPC*** or ***ANY OTHER TYPE***

LANGUAGE

Replace this text with ***GO*** or ***JAVA*** or ***CLOJURE*** or ***RUBY*** or ***ANY OTHER ELSE*** Make sure to include the version also.

FOLDER STRUCTURE

Replace this with project folder structure. It would be great if you can share the description for each folder. e.g.

|- application.default.yml
|- src/
    |- models
    |- repositories
    |- services
|- test
    |- repositories
    |- services

DATABASE

If the application has a database, it’s helpful to know the type of database, the server information as described above, the version, and if possible, the data model diagram or table information as below.

Users

Key Type Description
user_id string user_id is using uuid generated by the service

GET STARTED / HOW-TO

Replace this text with detail step-by-step:

  • what are pre-requisites needed to run this service e.g. install libraries, plugins, etc
  • how to setup application config
    • what mandatory keys should be changed to enable development
  • how to run tests in this service
  • how to do database migration (for dev-only)

DEPLOYMENT

Replace this text with detail step-by-step of service deployment.

  • What are things that need to be done before deploying the service:
    • cookbooks, contact infra team for create boxes, etc.

AVAILABLE APIs

If the type of this service is **RESTFUL**, then you can follow below format:

GET /something

Replace this text with API description. Flow chart: [flow_chart_link_if_any]

*** REQUEST ***
[HEADER]
"Content-Type": "application/json"
"Authorization": "Bearer 960d1261-6009-4e86-8351-7f0e2d73cb68"

[QUERY STRING]
?id=...

*** RESPONSE ***
[JSON]
{
    "something_name": "something_value"
}

POST /create-something

Replace this text with API description. Flow chart: [flow_chart_link_if_any]

*** REQUEST ***
[HEADER]
"Content-Type": "application/json"
"Authorization": "Bearer 960d1261-6009-4e86-8351-7f0e2d73cb68"

[BODY / JSON]
{
    "something_name": "something_value"
}

[BODY / JSON] Use this format if need ...
{
    "something_name": "something_value",
    "something_reference": "something_value"
}

*** RESPONSE ***
[200 / JSON]
{
    "something_name": "something_value"
}

[400 / JSON]
{
    "something_name": "something_value"
}

[401 / JSON]
{
    "something_name": "something_value"
}

If the type of this service is **GRPC**, then you can follow below format:

rpc GetSomething (SomethingQuery) returns (SomethingResult)

Replace this text with API description. Flow chart: [flow_chart_link_if_any]

[REQUEST] SomethingQuery
Key Type
token string
wallet_id string
[RESPONSE] SomethingResult
Key Type
success boolean

TROUBLESHOOTING

Replace this text if you encountered any issue during development and know how to solve the issue.

REFERENCES

  • Link to external diagrams (if any)
  • Other information related to this service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment