Skip to content
Server for Pragyan's Dalal Street
Go Other
  1. Go 98.8%
  2. Other 1.2%
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci [minor] Use config.json.example instead of config.json for git conven… Nov 10, 2018
bots @ 1828ba5
frontend @ 0fe65ac
matchingengine [matchingengine]: Added rest of MatchingEngine and OrderBook tests (#271 Feb 23, 2019
migrations [server]: Add GeneralLog table (#285) Mar 6, 2019
mocks [matchingengine]: Added rest of MatchingEngine and OrderBook tests (#271 Feb 23, 2019
models [server]: Add GeneralLog table (#285) Mar 6, 2019
proto @ a4971d2 Bug Fix Email Verification (#282) Feb 28, 2019
session [refactor] Change export paths from thakkarparth007 to delta Nov 2, 2018
templates Bug Fix Email Verification (#282) Feb 28, 2019
.env.example [docker]: Fix docker conf (#259) Feb 25, 2019
Dockerfile [Registration]: Added email verification to Production (#242) Feb 28, 2019
docker-compose.yml Add new frontend submodule with dockerization Feb 6, 2018

CircleCI build status Go Report Card

Server for Dalal Street


Check prerequisites

  • Check the go version installed.
go version
  • Check protobuf installation.
protoc --help
  • Setup SECRET_KEY environment variable to some string

Build instructions

  • Download the repository and cd into it.
go get
cd $GOPATH/src/
  • Install dependencies
go get -v ./...
go get -v
go get -v
go get -v
go get -v
go get -v
  • Setup submodules
git submodule init
git submodule update --recursive
  • Create databases and run migrations
mysql -u root -p -e "CREATE DATABASE dalalstreet_dev; CREATE DATABASE dalalstreet_test;"
migrate -url "mysql://root:YOUR_MYSQL_ROOT_PASSWORD@/dalalstreet_dev" -path ./migrations up
  • Generate proto files
  • Run cp config.json.example config.json
  • Fill in the database credentials in the Dev section of config.json.
  • Run go run main.go


  • Run the test script locally before pushing commits.

Docker usage instructions

  • Install docker and docker-compose.
  • Run cp .env.example .env. Fill in the DB_NAME and DB_PASS in .env. These are the credentials for the database container.
  • Use the same credentials in Docker section config.json (DbName and DbPassword) and (in the migrate command).
  • Run docker-compose up.
  • Once the containers are up, you can get shell access by using
docker exec -it <CONTAINER_ID> bash

GoMock usage instructions

  • To generate mock for a file using mockgen, place this comment after import statement
 //go:generate mockgen -source {YOUR_FILE_NAME}.go -destination ../mocks/{YOUR_FILE_NAME}.go -package mocks
  • To generate mocks for all packages that has above comment
go generate ./...

  • To manually generate a mock package
mockgen -destination=mocks/{YOUR_FILE_NAME}.go -package=mocks {PATH_TO_YOUR_FILE}

You can’t perform that action at this time.