Skip to content

Repository files navigation

Graph Neo4j Go

This is a simple twitter-like api written in go as an example to use neo4j with golang.

Technologies

Api documentation

A guide for endpoints.

User endpoints

Base path: host://api/v1/user

  • Register
    • Path: /register/
    • Method: POST
    • Request body:
{
"username": "username_length_higher_than_6",
"name": "name of user",
"email": "valid_email@example.com",
"password":"a_good_password",
"gender": 1
}
  • Response:
{
"status": "Created",
"id": 5,
"token": "<jwt-token>"
}
  • Description: available genders are: Male=1, Female=2, Other=3. use token to access authenticated endpoints.

  • Login

    • Path: /login/
    • Method: POST
    • Request body:
{
"username": "username",
"password": "user_password"
}
  • Response body:
{
"status": "Found",
"id": 5,
"token": "<jwt-token>"
}
  • Info
    • Auth : need jwt token in headers as Bearer token.
    • Path: /info/{username}
    • Method: GET
    • Response Body:
{
"status": "Found",
"data": {
"id": 3,
"username": "username",
"name": "users name",
"email": "valid_email@example.com",
"gender": 1
}
}
  • Delete
    • Auth
    • Path: /delete/
    • Method: DELETE
    • Response Body:
{
"status": "Deleted",
"id": 4
}

Copyright 2023, Max Base

About

This is a simple twitter-like api written in go as an example to use neo4j with golang. (postgresql, neo4j, graph)

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages