https://github.com/vskut/twigo
Repository for studying purposes
https://github.com/vskut/twigo
go golang grpc grpc-go jwt postgres protobuf protobuf3 rest rest-api rest-client
Last synced: 4 months ago
JSON representation
Repository for studying purposes
- Host: GitHub
- URL: https://github.com/vskut/twigo
- Owner: VSKut
- License: mit
- Created: 2019-12-17T22:08:24.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-26T21:13:30.000Z (over 5 years ago)
- Last Synced: 2023-03-03T11:19:45.181Z (over 2 years ago)
- Topics: go, golang, grpc, grpc-go, jwt, postgres, protobuf, protobuf3, rest, rest-api, rest-client
- Language: Go
- Homepage:
- Size: 43 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

[](https://travis-ci.org/vskut/twigo)
[](https://goreportcard.com/report/github.com/vskut/twigo)
[](https://golangci.com/r/github.com/VSKut/twigo)
[](https://codecov.io/github/vskut/twigo)


# Twigo APP### Install
1. Set your ENV
# Postgres
DB_HOST=db
DB_DRIVER=postgres
DB_USER=postgres
DB_PASSWORD=postgres
DB_NAME=postgres
DB_SSL_MODE=disable
# gRPC server
SERVER_HOST=server
SERVER_PORT=8081
# Rest gateway
GATEWAY_HOST=
GATEWAY_PORT=8080
# JWT secret key
JWT_SECRET=jwtSecretKey
2. `docker-compose -f deployments/docker-compose.yml up` or `make dockerize`
3. Endpoints hosted on http://GATEWAY_HOST:GATEWAY_PORT/
4. Open [Swagger](http://127.0.0.1:8082/)### Endpoints
`POST /register` - create new account with specified nick(unique in app), email, and password
Payload:
username - some user name
email - user email address
password - some password
Result:
id - primary key
username - username which you specified in payload
email - user email address which you specified in payload`POST /login` - accept email and password and return token, uses JWT
Payload:
email - user email address
password - some passwordResult:
token - jwt token
`POST /subscribe` - add account with login to your subscription list, you start seeing his tweets in your feeds
Payload:
nickname - nick name for account for which you want to subscribe`POST /tweets` - create a tweet, account id should be found from JWT
Payload:
message - some tweet messageResult:
id - message primary key
message - tweet message`GET /tweets` - return all tweets from your subscriptions
Result:
tweets - all tweets from your subscriptions