Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/explodingcamera/fantasymarket-api

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/explodingcamera/fantasymarket-api

  • v0.0.0-20210816195507-119021381ccf
  • Source
  • Go
  • Socket score

Version published
Created
Source

Website Website netlify codecov Security Headers Mozilla HTTP Observatory Grade Maintainability

Table of Contents

Introduction

We are creating a stock market simulation, where the user can invest in-game currency in a simulated market completely separated from the real world. By providing custom events that pop up randomly and alter the course of our stocks, coupled with a market that never sleeps, we are presenting a fun and fast-paced introduction into the stock market. This is the repository for the backend, the corresponding frontend can be found here.

Structure

fantasymarket-app
├── api        # rest api service
├── database   # database service
├── game       # game service
└── utils      # utility functions

Installation

1. Install Requirements

  • go >=1.13
  • Task (optional)
  • Revive (optional) To install, you can also run $ task install-linter after installing task.
  • go-bindata (required for building a binary) - To install, you can also run $ task install-bindata after installing task.
  • Windows:
  • OSX:
    • You might need to install sqlite (should be installed already)
  • Linux:

NOTE: Due to some changes in gcc 10, you might see some warnings because of the sqlite bindings we use. This won't cause any issues.

2. Clone Repo

$ git clone https://github.com/fantasymarket/fantasymarket-app.git
$ cd fantasymarket-app

Development

VSCode with the official GO extension or goland

Testing

With Task installed:

$ task test # run tests
$ task lint # lint code

Alternative:

$ go test ./...

Impressions

Landing Page

Landing Page

Chart View

Chart View

Trading View

Trading View

Running the app:

After installing all the requirements, start the program by running $ go run main.go.
The console should output information about the status of the program:

INF successfully connected to the database
INF successfully started the game loop
INF successfully started the http server address=localhost:5000

It will then load the last tick from the Database before printing it and the ingame time:

DBG running tick date="2020-01-01 00:00:00 +0000 UTC" tick=2

After this setup, the program prints the indices from the two currently implemented stocks Google and Apple. This is done every 10 seconds, like this:

DBG updated stock index=60032 name=GOOG
DBG updated stock index=60024 name=APPL

The corresponding instructions for running the frontend can be found here.

FAQs

Package last updated on 16 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc