Content Database
Last updated
Last updated
Content services in bringin backend project use grpc server to serve logic. The grpc protocol defined at api/proto folder.
Content services serve logics like ( create content, generate feed, vote content, unvote content & comment content).
Golang version 1.20
Postgres version 14 as Primary Database
Redis for subscribing data from user services
Make sure you have golang version 1.20
Make sure you have postgres that support uuid, jsonb
Make sure you have installed redis
See Recommmended project structure section.
Make sure you already create social network database. Look at folder internal/sqls you can execute sql in that folder to migrate database. You must to migrate tables at social network database.
Besides executing the commands above, you can execute the command below to migrate database. But before you execute migrate command, make sure you already set database environment in .env file
There are 3 migrate commands :
command migrate:up
will create tables
command migrate:down
will drop tables
command migrate:both
will drop and then create tables
First to run this services, make sure your database and the tables that needed already created. Then create .env file from example.env template. The example.env file look likes below change the configuration and match with your environment.
For CONTENT_DATABASE_HOST, CONTENT_DATABASE_PORT, CONTENT_DATABASE_NAME, CONTENT_DATABASE_USER & CONTENT_DATABASE_PASSWORD must be same with social network services database environment. Why this ? Because to generate feed, i have to join activity_models table (content services) with user_network_models (Social network services)
After .env file created. Run this command