<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.spiretrading.com/index.php?action=history&amp;feed=atom&amp;title=Web_Portal</id>
	<title>Web Portal - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.spiretrading.com/index.php?action=history&amp;feed=atom&amp;title=Web_Portal"/>
	<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Web_Portal&amp;action=history"/>
	<updated>2026-04-07T13:02:18Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Web_Portal&amp;diff=244&amp;oldid=prev</id>
		<title>Kamal: Created page with &quot;= Web Portal = The Web Portal provides web-based access to account management and administrative functions through both an web API and an interactive HTML interface. It serves...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Web_Portal&amp;diff=244&amp;oldid=prev"/>
		<updated>2025-12-01T22:30:25Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;= Web Portal = The Web Portal provides web-based access to account management and administrative functions through both an web API and an interactive HTML interface. It serves...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Web Portal =&lt;br /&gt;
The Web Portal provides web-based access to account management and administrative functions through both an web API and an interactive HTML interface. It serves as the primary user interface for creating and managing trading accounts, configuring market data entitlements, defining compliance rules, setting risk parameters, and monitoring account activity. By aggregating functionality from multiple backend services, the Web Portal enables administrators and managers to perform operational tasks through a unified web application.&lt;br /&gt;
&lt;br /&gt;
The Web Portal integrates with the Service Locator for authentication and communicates with the Administration Server, Compliance Server, Risk Server, and Order Execution Server to provide comprehensive account management capabilities.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
The Web Portal is configured via a YAML file that defines its network interface and Service Locator integration. Below is the structure of the configuration file with example values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
---&lt;br /&gt;
server:&lt;br /&gt;
  # Primary network interface and port the Web Portal binds to.&lt;br /&gt;
  interface: &amp;quot;0.0.0.0:8080&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  # List of addresses the server is reachable at (for registration with Service Locator).&lt;br /&gt;
  # Typically includes both public-facing and local addresses.&lt;br /&gt;
  addresses: [&amp;quot;198.51.100.5:8080&amp;quot;, &amp;quot;10.0.0.5:8080&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
service_locator:&lt;br /&gt;
  # The address of the Service Locator (host:port).&lt;br /&gt;
  address: &amp;quot;10.0.0.5:20000&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
  # The account username used by the Web Portal to authenticate with the Service Locator.&lt;br /&gt;
  username: web_portal_service&lt;br /&gt;
  &lt;br /&gt;
  # The password for the Web Portal's Service Locator account.&lt;br /&gt;
  password: admin_password&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functionality ==&lt;br /&gt;
The Web Portal provides access to the following administrative and operational capabilities:&lt;br /&gt;
&lt;br /&gt;
=== Account Management ===&lt;br /&gt;
* Create new trading accounts&lt;br /&gt;
* Assign accounts to groups and directories&lt;br /&gt;
* Configure account permissions and access controls&lt;br /&gt;
* Set account roles (trader, manager, administrator, service)&lt;br /&gt;
* Modify account credentials and settings&lt;br /&gt;
&lt;br /&gt;
=== Market Data Entitlements ===&lt;br /&gt;
* View available market data packages and pricing&lt;br /&gt;
* Assign entitlements to accounts or groups&lt;br /&gt;
* Configure per-venue and per-message-type permissions&lt;br /&gt;
&lt;br /&gt;
=== Compliance Configuration ===&lt;br /&gt;
* Define compliance rules and rule schemas&lt;br /&gt;
* Assign rules to accounts, groups, or directories&lt;br /&gt;
* Configure rule states (active, passive, disabled)&lt;br /&gt;
* Monitor compliance rule violations&lt;br /&gt;
* Review historical compliance events&lt;br /&gt;
&lt;br /&gt;
=== Risk Management ===&lt;br /&gt;
* Configure risk parameters per account&lt;br /&gt;
* Set buying power limits&lt;br /&gt;
* Define net loss thresholds&lt;br /&gt;
* Configure risk state transitions&lt;br /&gt;
* Monitor real-time profit and loss&lt;br /&gt;
* View position summaries and inventory snapshots&lt;br /&gt;
&lt;br /&gt;
=== Order and Execution Monitoring ===&lt;br /&gt;
* View order history and execution reports&lt;br /&gt;
* Monitor active orders&lt;br /&gt;
* Review trade activity by account or region&lt;br /&gt;
* Generate reports on trading performance&lt;br /&gt;
* Track order routing and fill statistics&lt;br /&gt;
&lt;br /&gt;
=== Administrative Tools ===&lt;br /&gt;
* User session management&lt;br /&gt;
* System configuration and settings&lt;br /&gt;
* Audit logs and activity tracking&lt;br /&gt;
* Service health monitoring&lt;br /&gt;
* Operational reports and analytics&lt;br /&gt;
&lt;br /&gt;
== Access Control ==&lt;br /&gt;
The Web Portal enforces permissions based on account roles:&lt;br /&gt;
&lt;br /&gt;
* '''Administrators''' have full access to all management functions&lt;br /&gt;
* '''Managers''' can manage accounts within their assigned groups&lt;br /&gt;
* '''Traders''' can view their own account details and activity&lt;br /&gt;
* '''Service''' accounts have restricted programmatic access&lt;br /&gt;
&lt;br /&gt;
All operations are authenticated through the Service Locator and logged for audit purposes.&lt;br /&gt;
&lt;br /&gt;
== Installation &amp;amp; Setup ==&lt;br /&gt;
A &amp;lt;code&amp;gt;setup.py&amp;lt;/code&amp;gt; script is provided to generate the final &amp;lt;code&amp;gt;config.yml&amp;lt;/code&amp;gt; from the &amp;lt;code&amp;gt;config.default.yml&amp;lt;/code&amp;gt; template.&lt;br /&gt;
&lt;br /&gt;
The script supports the following arguments:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python setup.py&lt;br /&gt;
  --local 0.0.0.0           # Local interface (default: auto-detected IP)&lt;br /&gt;
  --world 198.51.100.5      # Global/public interface (optional)&lt;br /&gt;
  --address 10.0.0.5:20000  # Service Locator address (default: local_interface:20000)&lt;br /&gt;
  --password [REQUIRED]     # Service password for authentication&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Operations ==&lt;br /&gt;
The Web Portal is controlled using three operational scripts: &amp;lt;code&amp;gt;start.sh&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;stop.sh&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;check.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Log files are generated in the format:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
srv_YYYYMMDD_HH_MM_SS.log&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Upon startup, older log files are moved into the &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
=== check.sh ===&lt;br /&gt;
The &amp;lt;code&amp;gt;check.sh&amp;lt;/code&amp;gt; script verifies whether the server is currently running by inspecting the PID recorded in &amp;lt;code&amp;gt;pid.lock&amp;lt;/code&amp;gt; and testing whether the associated process exists.&lt;br /&gt;
&lt;br /&gt;
If the server is not running, it prints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WebPortal is not running.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== start.sh ===&lt;br /&gt;
The &amp;lt;code&amp;gt;start.sh&amp;lt;/code&amp;gt; script:&lt;br /&gt;
* Exits immediately if the server is already running&lt;br /&gt;
* Creates a &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt; directory if necessary&lt;br /&gt;
* Moves any existing &amp;lt;code&amp;gt;srv_*.log&amp;lt;/code&amp;gt; files into &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Starts the &amp;lt;code&amp;gt;WebPortal&amp;lt;/code&amp;gt; process in the background&lt;br /&gt;
* Writes the PID to &amp;lt;code&amp;gt;pid.lock&amp;lt;/code&amp;gt;&lt;br /&gt;
* Reads network interfaces from &amp;lt;code&amp;gt;config.yml&amp;lt;/code&amp;gt; and waits until the server is listening on at least one configured address&lt;br /&gt;
&lt;br /&gt;
This ensures the server is fully initialized before the script exits.&lt;br /&gt;
&lt;br /&gt;
=== stop.sh ===&lt;br /&gt;
The &amp;lt;code&amp;gt;stop.sh&amp;lt;/code&amp;gt; script:&lt;br /&gt;
* Reads the PID from &amp;lt;code&amp;gt;pid.lock&amp;lt;/code&amp;gt;&lt;br /&gt;
* Sends &amp;lt;code&amp;gt;SIGINT&amp;lt;/code&amp;gt; to request a graceful shutdown&lt;br /&gt;
* Waits for termination using exponential backoff (up to 300 seconds)&lt;br /&gt;
* Sends &amp;lt;code&amp;gt;SIGKILL&amp;lt;/code&amp;gt; if the server fails to stop cleanly&lt;br /&gt;
* Appends a forced-termination message to the most recent log file (if applicable)&lt;br /&gt;
* Removes the &amp;lt;code&amp;gt;pid.lock&amp;lt;/code&amp;gt; file&lt;br /&gt;
&lt;br /&gt;
This guarantees consistent shutdown behavior across normal and exceptional conditions.&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
</feed>