Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ruchip16/file_store
A simple file store that stores plain-text files
https://github.com/ruchip16/file_store
backend client-server kubernetes-cluster
Last synced: about 1 month ago
JSON representation
A simple file store that stores plain-text files
- Host: GitHub
- URL: https://github.com/ruchip16/file_store
- Owner: Ruchip16
- Created: 2023-07-02T06:47:11.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-07-03T03:41:09.000Z (over 1 year ago)
- Last Synced: 2024-10-30T06:36:00.394Z (about 2 months ago)
- Topics: backend, client-server, kubernetes-cluster
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Backend File Store Service
To implement the backend file store service that has a simple HTTP server and a command line client that stores plain-text files and the server would receive requests from clients to store,update, delete files & perform operations on files stored in the server. For the server, I used Python with Flask, and for the command line client, I used Python. Let's get started!
- For setting up the server:
- Installed Flask using pip: `pip install flask`
- Created the `server.py` file that sets up a basic Flask server with endpoints for adding files, listing files, removing files, and updating files. The files are stored in a dictionary called file_store, where the keys are the filenames and the values are the file contents.
- For command line client:
- Created a `client.py` file which uses the requests library to send HTTP requests to the server. It provides functions for adding files, listing files, removing files, and updating files based on the command-line arguments provided.
## To Run the code:**Note: both the server and the client should be running simultaneously for the commands to work correctly.**
- Fork and clone the repository
- to start the server: `python server.py`
- to start the client: `python client.py `
- where command represents - `add, ls, rm, update, wc, freq-words`
- arguments -`(name of text files you want to store) eg:file1.txt,etc`## The list of operations the file store supports are:
1. Add files to the store: `python client.py add file1.txt file2.txt`
2. List files in the store: `python client.py ls`
3. Remove a file: `python client.py rm file1.txt`
4. Update contents of a file in the store: `python client.py update file.txt`
5. Word count: returns the number of words in all the files stored in server
`python client.py wc`
6. Least or most frequent words: should return the 10 most frequent words in all the files combined.