An API client and simulator for testing social networks.
Project details
X is an API client designed for engaging with X-like social networks. Featuring a robust simulator, it allows developers to test interactions seamlessly while adhering to strict postability rules. Empower applications with a reliable testing environment and ensure optimal performance with X.
The X API Client and Social-Network Simulator provide a powerful framework for creating typed applications that interact with the X platform. This project is built on a customized clone of Spiral, ensuring robust functionality and efficient performance while enabling developers to simulate social network events.
The X client, located in apps/client, supports various operations such as timelines, thread management, posting, deletion, and OAuth refresh. It is designed to handle JSON data efficiently and operates seamlessly within Cells notebooks, compiling one Rust crate for each entry. For detailed usage, refer to the client README, where the end-to-end suite is thoroughly explained.
The X-like Event Simulator (xsim) in apps/sim serves to validate the application's behavior under various scenarios. Employing Elixir supervision over the Spiral framework, it compiles to Gleam, enabling comprehensive testing of scenarios, frames, invariants, and worlds.
The postability profile located in the postability directory outlines the guidelines for successful posts on the X platform. This includes limitations on post weights, code point weights, link rules, TLD lists, and headers, ensuring that tools checking compliance are informed and accurate.
The scripts folder includes a suite of scripts to aid development and continuous integration (CI):
init.ps1: Initializes the repository by cloning the Spiral project.build.ps1: Executes checks performed by CI.workflow.ps1: Combines initialization and building for CI processes.gate.ps1: Enforces a 1,000-line limit per file (excluding exceptions) to maintain quality code standards.publish.ps1: Renders the organization of the repository using Spiral’s publishing tools.To run the CI process, execute:
pwsh scripts/workflow.ps1
For a local rebuild without Cells notebooks, use:
pwsh scripts/build.ps1 -fast 1
For specific simulations, run:
pwsh apps/sim/build.ps1 -Ladder 6:8:3,10:8:4
To create a new repository based on this framework, copy the scripts/ directory as is, along with necessary configuration files like .github/workflows/ci.yml and Cargo.toml. This ensures a consistent setup across similar projects while facilitating updates as enhancements are made to Spiral.
Comments
0Start the conversation
Share the first comment.