Repository
GraphNeo4jGO
This is a simple twitter-like api written in go as an example to use neo4j with golang. (postgresql, neo4j, graph)
README
Graph Neo4j Go
This is a simple twitter-like api written in go as an example to use neo4j with golang.
Technologies
- neo4j
- postgresql
- mux
- jwt
- go-playground/validator
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": "[email protected]", "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>" }
- Path:
-
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": "[email protected]", "gender": 1 } }
-
Delete
- Auth
- Path:
/delete/ - Method:
DELETE - Response Body:
{ "status": "Deleted", "id": 4 }
Copyright 2023, Max Base