stvhwrd / stock-trading-system-http-server Goto Github PK
View Code? Open in Web Editor NEWππ± [Containerized Go server] HTTP Server for Stock Trading System project
ππ± [Containerized Go server] HTTP Server for Stock Trading System project
In addition to the client activities, DayTrading requires full auditing capabilities; hence, complete transaction logs must be able to be produced on demand that detail of all client activities in the
system (including timestamps of all transactions), a record of each individual transaction, each transactionβs processing time information, and all account state changes within the system. This log must be dumped from the system as an ASCII text file when it receives theDUMPLOG
command.
(:point_up: Log files not of this exact schema will not be accepted)
Log files can be validated using xmllint against the provided XSD file
xmllint --schema logfile.xsd --noout OURLOGFILE.xml
https://www.ece.uvic.ca/~seng468/ProjectWebSite/ExampleLog.html
Transaction number is set to 0 when server starts up. If it crashes and restarts, it would start at 0 again.
It should instead continue from most recent transaction number.
Doesn't appear to be a downstream error. First command goes through but the second will return EOF to the workload_gen and the running thread on the server will crash.
Purpose: A summary of the given user's transaction history and the current status of their accounts as well as any set buy or sell triggers and their parameters is displayed to the user.
Data will be transferred to Web Client as JSON and rendered by Web Client.
{
"userSummary":
{
"account":
{
"userid": "", // Globally-unique identifier
"dollarsAvailable": "", // Current buying power
"dollarsPending": "" // Amount on hold
},
"transactions": [
{
"timestamp": "", // Timestamp of execution
"id": "", // Globally-unique transaction identifier of
"type": "", // Type of transaction eg. BUY, SELL
"status": "", // Status of transaction eg. pending, complete, cancelled
"dollarsAmount": "", // Dollar amount involved in transaction
"sharePrice": "", // Price per share at time of purchase
}],
"holdings": [
{
"stockSymbol": "", // Unique identifier
"shares": "", // Number of shares purchased
"sharePrice": "", // Price per share at time of purchase
"purchaseDate": "" // Timestamp of execution
}],
"triggers": [
{
"type": "", // Type of trigger, eg. BUY, SELL
"dollarAmount": "", // Dollar amount involved in transaction if triggered
"transactionId": "" // Globally-unique trigger identifier
}]
}
}
"This should be handled by commonlib. The workload generator already composes the messages correctly, so all you need to do is have a switch to handle the message type and go from there. See transaction server for reference."
HTTP Server will contribute four logs:
Debugging messages contain all the information of user commands, in
addition to an optional debug message
int
// UNIX timestampstring
// name of server eg. "Transaction Server"int
// enumeration of transactionstring
// one of the known commands ("BUY", "SELL" etc)string
// optional alphanumeric usernamestring
// optional three-char alphanumeric stock symbol ("NWC", "BTK")string
// optional name of file to be written todecimal
// optional dollars and cents (eg 24.99)string
// optional debug message or descriptionError messages contain all the information of user commands, in
addition to an optional error message
int
// UNIX timestampstring
// name of server eg. "Transaction Server"int
// enumeration of transactionstring
// one of the known commands ("BUY", "SELL" etc)string
// optional alphanumeric usernamestring
// optional three-char alphanumeric stock symbol ("NWC", "BTK")string
// optional name of file to be written todecimal
// optional dollars and cents (eg 24.99)string
// optional error message or descriptionSystem events can be current user commands, interserver communications,
or the execution of previously set triggers
int
// UNIX timestampstring
// name of server eg. "Transaction Server"int
// enumeration of transactionstring
// one of the known commands ("BUY", "SELL" etc)string
// optional alphanumeric usernamestring
// optional three-char alphanumeric stock symbol ("NWC", "BTK")string
// optional name of file to be written todecimal
// optional dollars and cents (eg 24.99)User commands come from the user command files or from manual entries
in UI web forms
int
// UNIX timestampstring
// name of server eg. "Transaction Server"int
// enumeration of transactionstring
// one of the known commands ("BUY", "SELL" etc)string
// optional alphanumeric usernamestring
// optional three-char alphanumeric stock symbol ("NWC", "BTK")string
// optional name of file to be written todecimal
// optional dollars and cents (eg 24.99)If no connection exists on eg. port 81 and HTTP Server tries to send a message to that port then it panics and crashes
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.