- client
- common
- server
Initial GUI design mockups can be viewed on Fluid UI.
The GUI was designed with the user in mind. It was important to restrict access to the platform from as early as possible, for security and for the sake of keeping accurate transactional logs. As such, the decision was made for the first screen to be a log in screen.
Upon successful login, the user is taken to the landing page. Here they have a complete overview of everything they can access in the program. It is important for these to be quickly identifiable, so they are all buttons in a vertical line. They are split where necessary to minimize mental overhead.
The all trades screen is a simple table. This provides all information needed in a clear manner. The ability to sort trades by any of the column fields means the user has all the power for which trades are more important to them. To find out more information about a trade, it is available by double-clicking the table row, which will open a dialog. A helper label is included to assist first-time users.
The trades history page follows a very similar structure for the sake of familiarity.
The my unit's trades page also includes a table view of trades. However, because the domain has support for multiple unit users (users can be in 1 or many units, and units can contain 1 or many users), we include a combo box of the user's enrolled units. This allows them to filter on a per-unit basis.
The new trade dialog has a simple graph which illustrates asset price history over time. This is achieved through a line graph which appears front and centre in the dialog. It populates onces a specific asset has been selected. This helps users in making trading decisions on which assets to buy or sell by allowing them to easily identify visual trends.
Once administrators log in, they are taken to the same landing page but with a couple extra buttons.
From the manage assets page, administrators can view a table of all listed assets. Here they can add new assets or remove those that are no longer in circulation.
The manage units page allows administrators to create new and update existing units.
The manage users page allows administrators to create new and update & remove existing users.
The project uses MariaDB for storage of all its relational data. This is because MariaDB is open-source and complies with all requirements. However, another relational database can be substituted provided the same schema is followed. See below for this schema.
- users
- id - {PK} VARCHAR(255)
- username – VARCHAR(255)
- password – VARCHAR(255)
- admin – BOOLEAN
- units
- id - {PK} VARCHAR(255)
- name – VARCHAR(255)
- credits – INT
- unitusers
- user_id – {PK} {FK} VARCHAR(255)
- unit_id – {PK} {FK} VARCHAR(255)
- assets
- id - VARCHAR(255) {PK}
- name – VARCHAR(255)
- date_added - DATE
- unitassets
- unit_id – {PK} {FK} VARCHAR(255)
- asset_id – {PK} {FK} VARCHAR(255)
- quantity – INT
- trades
- id – {PK} VARCHAR(255)
- unit_id – {FK} VARCHAR(255)
- asset_id – {FK} VARCHAR(255)
- user_id – {FK} VARCHAR(255)
- date_listed – DATE
- type – VARCHAR(4)
- quantity – INT
- price – INT
- quantity_filled - INT
- date_filled - DATE
- Client create a serializable data transfer object (DTO) with any information required to be relayed
- The client sends this DTO to the server over a socket connection
- The server intercepts this request
- An appropriate handler route is found for the request
- The request is handled and the result sent back over the socket
- Client receives this serializable result
- Server
- Create socket at startup.
- Listen and accept incoming connections.
- Client
- Create socket at startup.
- Login
- Client sends
LoginDTO
withstring username
- Server returns
User | null
- Client sends
- Add asset
- Client sends
AddAssetDTO
withstring assetName
- Server returns an array of
FullAsset
- Client sends
- Add user to unit
- Client sends
AddUserToUnitDTO
withstring userId
andstring unitId
- Server returns success
boolean
- Client sends
- Create or update unit asset
- Client sends
CreateOrUpdateUnitAssetDTO
withstring unitId
,string assetId
andint quantity
- Server returns an array of
UnitAsset
- Client sends
- Delete asset
- Client sends
DeleteAssetDTO
withstring assetId
- Server returns a success
boolean
- Client sends
- Delete user
- Client sends a
DeleteUserDTO
withstring userId
- Server returns a success
boolean
- Client sends a
- Get assets
- Client sends an empty
GetAssetsDTO
- Server returns an array of
FullAsset
- Client sends an empty
- Get historic trades
- Client sends an empty
GetHistoricTradesDTO
- Server returns an array of
Trade
ornull
if there are no historic trades
- Client sends an empty
- Get trades
- Client sends an empty
GetTradesDTO
- Server returns an array of
Trade
ornull
if there are no active trades
- Client sends an empty
- Get unit assets
- Client sends a
GetUnitAssetsDTO
with astring unitId
- Server returns an array of
UnitAsset
belonging to the specifiedunitId
- Client sends a
- Get units
- Client sends a
GetUnitsDTO
with an optionalstring userId
- Server returns an array of all
Unit
in the database, or all theUnit
the specifieduserId
is part of
- Client sends a
- Get unit trades
- Client sends a
GetUnitTradesDTO
with astring unitId
- Server returns an array of
Trade
- Client sends a
- Get unit users
- Client sends a
GetUnitUsers
with astring unitId
- Server returns an array of
User
- Client sends a
- Get users
- Client sends an empty
GetUsersDTO
- Server returns an array of all
User
- Client sends an empty
- New trade
- Client sends a
NewTradeDTO
with:string assetId
(for what asset)string unitId
(from what unit trade is coming from)string userId
(who is making the trade)TradeType type
(BUY or SELL)int quantity
int price
- Server returns a
Trade
representing the newly constructed trade offer
- Client sends a
- New unit
- Client sends a
NewUnitDTO
withstring unitName
andint credits
- Server returns
Unit | null
representing the new unit or an error in creating it
- Client sends a
- New user
- Client sends a
NewUserDTO
withstring username
,string password
andboolean isAdmin
- Server returns
User | null
representing the new user or an error in creating it
- Client sends a
- Remove trade
- Client sends a
RemoveTradeDTO
withstring tradeId
- Server returns a success
boolean
- Client sends a
- Remove unit asset
- Client sends a
RemoveUnitAssetDTO
withstring unitId
andstring assetId
- Server returns a success
boolean
- Client sends a
- Remove user from unit
- Client sends a
RemoveUserFromUnitDTO
withstring userId
andstring unitId
- Server returns a success
boolean
- Client sends a
- Update credits
- Client sends a
UpdateCreditsDTO
withstring unitId
andint newCredits
- Server returns a
Unit | null
depending on success of request
- Client sends a
- Update password
- Client sends a
UpdatePasswordDTO
withstring userId
andstring newPassword
- Server returns
User | null
depending on success of request
- Client sends a
- Update user permission
- Client sends a
UpdateUserPermissionsDTO
withstring userId
andboolean isAdmin
- Server returns
User | null
depending on success of request
- Client sends a