Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/basemax/graphneo4jgo
This is a simple twitter-like api written in go as an example to use neo4j with golang. (postgresql, neo4j, graph)
https://github.com/basemax/graphneo4jgo
api go go-api go-neo4j go-postgresql neo4j neo4j-database neo4j-go neo4j-graph neo4j-tutorial postgresql restful restful-api restful-webservices restfulapi
Last synced: 1 day ago
JSON representation
This is a simple twitter-like api written in go as an example to use neo4j with golang. (postgresql, neo4j, graph)
- Host: GitHub
- URL: https://github.com/basemax/graphneo4jgo
- Owner: BaseMax
- License: gpl-3.0
- Created: 2022-09-29T12:48:55.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-11T23:47:53.000Z (2 months ago)
- Last Synced: 2025-02-04T07:15:38.779Z (6 days ago)
- Topics: api, go, go-api, go-neo4j, go-postgresql, neo4j, neo4j-database, neo4j-go, neo4j-graph, neo4j-tutorial, postgresql, restful, restful-api, restful-webservices, restfulapi
- Language: Go
- Homepage:
- Size: 182 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Graph Neo4j Go
This is a simple twitter-like api written in go as an example to use neo4j with golang.
### Technologies
- [neo4j](https://neo4j.com/)
- postgresql
- [mux](https://github.com/gorilla/mux)
- [jwt](https://github.com/golang-jwt/jwt)
- [go-playground/validator](https://github.com/go-playground/validator)### Api documentation
A guide for endpoints.#### User endpoints
Base path: `host://api/v1/user`- **Register**
- Path: `/register/`
- Method: `POST`
- Request body:
```json
{
"username": "username_length_higher_than_6",
"name": "name of user",
"email": "[email protected]",
"password":"a_good_password",
"gender": 1
}
```
- Response:
```json
{
"status": "Created",
"id": 5,
"token": ""
}
```- Description: available genders are: Male=1, Female=2, Other=3. use token to access authenticated endpoints.
- **Login**
- Path: `/login/`
- Method: `POST`
- Request body:
```json
{
"username": "username",
"password": "user_password"
}
```
- Response body:
```json
{
"status": "Found",
"id": 5,
"token": ""
}
```- **Info**
- _**Auth**_ : need jwt token in headers as Bearer token.
- Path: `/info/{username}`
- Method: `GET`
- Response Body:
```json
{
"status": "Found",
"data": {
"id": 3,
"username": "username",
"name": "users name",
"email": "[email protected]",
"gender": 1
}
}
```- **Delete**
- _**Auth**_
- Path: `/delete/`
- Method: `DELETE`
- Response Body:
```json
{
"status": "Deleted",
"id": 4
}
```Copyright 2023, Max Base