STTP (Short Text Transfer Protocol) is a made-up, lightweight protocol, designed for simple file management over TCP. The protocol allows clients to create, retrieve, update, delete, and list files containing short text snippets, each up to 160 characters long. Implement this server in any language you'd like.
A working agreement is essentially a promise to you or to your team on habits and processes you agree to follow while working on a project.
Tip: Try to incorporate as many of these habits as possible, as is they aim to reflect a real-world workflow vs just hacking away at something. They are designed to keep you organized and ensure you deliver a quality product.
The STTP Specification can be found in the following link.
As a developer, I agree to handle errors gracefully and provide feedback to the user.
As a developer, I agree to ensure each story is properly tested. (A lot of times it can be a pain to test a CLI's tool main function, you'll understand when you get there, try your best, 100% code coverage is not required)
As a developer, I agree to create a new git branch for each story I work on.
Set up the basic structure and configuration for the STTP server, including handling network connections and reading configuration files.
As a developer, I want to create a configuration file for the STTP server, so that I can easily manage settings like address, port, and docroot.
As a developer, I want to set up the TCP server to listen for incoming connections, so that the STTP server can accept client requests.
Implement the logic to parse incoming STTP requests, so the server can understand and respond to client commands.
As a developer, I want to parse incoming STTP requests, so that the server can understand the action, path, and optional content.
As a developer, I want to implement handlers for each STTP action, so that the server can process client requests.
Implement file operations for the STTP server, allowing it to create, read, update, and delete files as requested by the client.
As a developer, I want to implement the CREATE operation, so that the server can create new files with the provided content.
As a developer, I want to implement the SHOW operation, so that the server can retrieve and return the content of a specified file.
As a developer, I want to implement the LIST operation, so that the server can return a list of files in a specified directory.
As a developer, I want to implement the DELETE operation, so that the server can delete a specified file.
As a developer, I want to implement the UPDATE operation, so that the server can modify the content of a specified file.
Implement error handling and ensure the server returns appropriate responses for all operations.
As a developer, I want to handle invalid requests gracefully, so that the server provides useful feedback to the client.
As a developer, I want to implement the 310 FILENAME TOO LONG response, so that the server enforces the filename length limit.
As a developer, I want to handle errors related to paths, so that the server can correctly respond to issues with paths that don't exist.
As a developer, I want to implement a 500 SERVER ERROR response, so that the server can inform the client of internal errors.
Implement a caching system to improve the performance of the STTP server by storing frequently accessed files in memory.
As a developer, I want to initialize the caching system, so that frequently accessed files can be stored in memory.
As a developer, I want to implement file caching, so that the server can quickly serve cached files to clients.
As a developer, I want to manage and expire cached files, so that the cache remains within the defined limits.
Implement concurrency in the STTP server to handle multiple client requests simultaneously and ensure thread safety, especially in shared resources like the cache.
As a developer, I want to use concurrent execution to handle multiple client connections simultaneously, so that the server can serve multiple clients efficiently.
As a developer, I want to implement mutual exclusion mechanisms to protect access to the cache, so that concurrent reads and writes do not cause race conditions.
As a developer, I want to manage and expire cached files, so that the cache remains within the defined limits.
As a developer, I want to implement safe communication mechanisms for concurrent execution threads, so that the server can coordinate actions without shared memory issues.
As a developer, I want to thoroughly test for race conditions, so that the server remains stable and reliable under concurrent load.
Design and implement the basic structure for the STTP client CLI, including parsing commands and handling global flags.
As a user, I want a basic CLI structure that handles commands and options correctly.
As a user, I want a verbose flag that enables detailed output for debugging.
Implement the parsing of the `sttp://` URL format and handle domain lookup with a default port.
As a user, I want the CLI to correctly parse the `sttp://` URL format to extract the host, port, path, and filename.
As a user, I want the CLI to resolve domain names to IP addresses before making requests.
Implement the core STTP actions (create, show, list, delete, update) in the CLI.
As a user, I want to create a file on the STTP server with specified content using the `create` action.
As a user, I want to retrieve the content of a file from the STTP server using the `show` action.
As a user, I want to list all files in a directory on the STTP server using the `list` action.
As a user, I want to delete a file on the STTP server using the `delete` action.
As a user, I want to update the content of a file on the STTP server using the `update` action.