delta / dalal-street-server

Server for Pragyan's Dalal Street
72 stars 16 forks source link
dalal-street golang grpc pragyan protocol-buffers stock-market

CircleCI build status Go Report Card

Server for Dalal Street

Prerequisites

Build instructions

Refer Setup Wiki for setting up Dalal-Street-Server

git submodule init
git submodule update --recursive
mysql -u root -p -e "CREATE DATABASE dalalstreet_dev; CREATE DATABASE dalalstreet_test;"
migrate -path "./migrations" -database "mysql://root:YOUR_MYSQL_PASSWORD@/dalalstreet_dev" up
./scripts/build_proto.sh

Create Migrations

migrate create -ext sql -dir ./migrations MIGRATION_NAME

Tests

./scripts/test.sh

Docker usage instructions

docker-compose up
docker exec -it <CONTAINER_NAME> bash

GoMock usage instructions

 //go:generate mockgen -source {YOUR_FILE_NAME}.go -destination ../mocks/{YOUR_FILE_NAME}.go -package mocks
go generate ./...
mockgen -destination=mocks/{YOUR_FILE_NAME}.go -package=mocks {PATH_TO_YOUR_FILE}