Table of Contents
Backend service for minimalistic social network logity. A user in logity communicates with others using chat rooms, each user can send a log (analogue of a message in social networks). Each log can contain a photo, text or picture.
- Authentication / Authorization User with using JWT tokens and Postgresql.
- Maintain relationships between users and manage their chat rooms Neo4j.
- Real-time messaging management using Websocket and Centrifugo.
- Create file dev.env from template.env and fill variables with your values
YOUR_POSTGRES_USERNAME
,YOUR_POSTGRES_PASSWORD
- postgres credentials, which you specify in environment postgres docker container.YOUR_LOGITY_USERNAME
,YOUR_LOGITY_PASSWORD
- specify user credentials for neo4j-database logity.YOUR_CENTRIFUGO_API_KEY
- the api key by which logity to access centrifugo.YOUR_CENTRIFUGO_SECRET_KEY
- the secret key which logity will sign the client's JWT tokens for access to the centrifugo.YOUR_SECRET_ACCESS_KEY
- the secret key which logity will sign access tokens.YOUR_SECRET_REFRESH_KEY
- the secret key which logity will sign refresh tokens.
- To run locally without container, we recommended create another one file local.env.
- Create file config.json from exports/template_config.json and fill variables with your values
YOUR_CENTRIFUGO_SECRET_KEY
- the secret key which centrifugo will verify client's JWT tokens. Must be equal logity environment variableYOUR_CENTRIFUGO_SECRET_KEY
YOUR_CENTRIFUGO_API_KEY
- the api key which centrifugo will verify service's JWT token. Must be equal logity environment variableYOUR_CENTRIFUGO_API_KEY
.YOUR_ADMIN_PASSWORD
,YOUR_ADMIN_SECRET
- admin credentials.
- Property
token_issuer
must be equal env variableAPP_NAME
.
- Run the docker-container with neo4j:
docker-compose up neo4j --build
- Go to http://localhost:7474/browser/.
- Authenticate with neo4j / testify.
- In command line
CREATE DATABASE logity;
and:use logity
- Create user with role architect using
:server user add
and check it using:server user list
- Run the docker-containers:
docker-compose up --build
- Neo4j UI: http://localhost:7474/browser/.
- Centrifugo admin panel: http://localhost:9123/.
- If liquibase containers fail, try running them later. If successful, then postgres or neo4j did not have time to start to run.
logity has a REST API.
- OpenApi docs: http://localhost:8080/swagger/index.html.
- The postman v2.1 collection is also stored in the scripts/postman folder.
To test the operation of real-time messages, you can use a simple go-client that uses the centrifugo API.
- Go to
scripts/client/client.go
- SignIn by route
http://<<**host**>>/auth/sign-in
and copy - From response copy
rtc_token
intoconst Token = <TOKEN>
- Run client.go
- Update subscribes using
http://<<**host**>>/op/update-subscribes
- Transactions Manager. Need to manage transactions from many sources(neo4j postgres).
- Role model.
- Logging, Tracing.
Your Name - @Tobiska - [email protected]
Project Link: https://github.com/Tobiska/logity