{"id":19214714,"url":"https://github.com/talhaahussain/restful-spreadsheet","last_synced_at":"2026-06-15T04:33:06.086Z","repository":{"id":230445135,"uuid":"779396768","full_name":"talhaahussain/RESTful-spreadsheet","owner":"talhaahussain","description":"Continuous Assessment for ECM3408 - Enterprise Computing, set by Prof. David Wakeling (Year 3, Semester 2). Involves the use of a RESTful interface to implement a spreadsheet MVP as an SC microservice. ","archived":false,"fork":false,"pushed_at":"2024-07-24T10:51:39.000Z","size":169,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-25T16:25:36.233Z","etag":null,"topics":["firebase-realtime-database","microservice","microservices","rest-api","restful-api","sqlite3"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/talhaahussain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-29T18:36:34.000Z","updated_at":"2024-07-24T10:51:42.000Z","dependencies_parsed_at":"2024-03-29T21:25:07.423Z","dependency_job_id":"86bc2ac2-308a-4706-9373-2148e3efb776","html_url":"https://github.com/talhaahussain/RESTful-spreadsheet","commit_stats":null,"previous_names":["talhaahussain/ecm3408-assessment","talhaahussain/restful-spreadsheet"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/talhaahussain/RESTful-spreadsheet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talhaahussain%2FRESTful-spreadsheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talhaahussain%2FRESTful-spreadsheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talhaahussain%2FRESTful-spreadsheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talhaahussain%2FRESTful-spreadsheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/talhaahussain","download_url":"https://codeload.github.com/talhaahussain/RESTful-spreadsheet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talhaahussain%2FRESTful-spreadsheet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34348291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["firebase-realtime-database","microservice","microservices","rest-api","restful-api","sqlite3"],"created_at":"2024-11-09T14:11:07.805Z","updated_at":"2026-06-15T04:33:06.071Z","avatar_url":"https://github.com/talhaahussain.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RESTful-spreadsheet\n\nContinuous Assessment for ECM3408 - Enterprise Computing, set by Prof. David Wakeling (Year 3, Semester 2). Involves the use of a RESTful interface to implement a spreadsheet MVP as an SC microservice. This microservice was implemented in Flask and uses the repository design pattern, currently supporting 2 data sources, an SQL and a No-SQL database. This project also makes use of abstract syntax trees, for parsing formulas from the user.\n\nThis work received a final mark of 92/100.\n\nPlease see `specification.pdf` for specification.\n\n### Prerequisites\n\nPython 3.6.8, the libraries *flask* and *requests*, as well as SQLite3.\n\nInstall prerequisites with:\n\n```\n. install.sh\n```\n\nor alteratively, if virtual environment is already available and activated:\n\n```\npip install -r requirements.txt\n```\n\n### Usage\n\n#### Starting Microservice\n\nThis submission includes this file and three other Python files. `sc.py` is the main program containing the Flask app.\n\nThe following instructions assume that you are trying to run the program on a Linux machine.\n\nTo run the program, please use either\n\n```\npython3 sc.py -r sqlite\n```\n\nor\n\n```\npython3 sc.py -r firebase\n```\n\nThe option selected depends on whether you intend to have data stored in an SQLite database, or a Firebase Realtime Database. Please note that you must set up your own Firebase Realtime Database and obtain your own unique link to use the latter option. You will also need to ensure that you have a valid database name stored in an environment variable `FBASE`. This can be done using the following\n\n```\nexport FBASE=\u003cyour database name here\u003e\n```\n\nPlease note that `sc.py` will not run unless the `-r` flag has been supplied, followed by one of the two above options provided.\n\n`firebase_backend.py` can be run to clear any current data in a Firebase Realtime Database (assuming you've already exported the database name in this session). `sqlite_backend.py` can be run to test the database functions.\n\nThe microservice should listen on port 3000, once running.\n\n#### Creating/Updating Cells\n\nCells can be created using the PUT method to */cells/id*, providing a JSON object that has an `id` property whose value is a string representing the cell identifier, and a `formula` property whose value is a string representing its formula. Please note that the `id` property must match the id specified in */cells/id*.\n\nCells are updated in the exact same manner, where the id in */cells/id* points to an existing cell.\n\nWhen creating or updating a cell, if a mathematical formula is provided, or other cells are referenced (or both), the values of specified cells will be retrieved from storage and the given formula will be computed prior to storage. When this cell is read (see next section), the value will reflect the evaluated expression.\n\nAn example of cell creation (with id \"B2\" and formula \"6\") using cURL is specified below\n```\ncurl -X PUT -H \"Content-Type: application/json\" -d \"{\\\"id\\\":\\\"B2\\\",\\\"formula\\\":\\\"6\\\"}\" localhost:3000/cells/B2\n```\n\n#### Reading Cells\n\nCells can be read from using the GET method to */cells/id*, where id corresponds to the desired cell.\n\nAn example of cell reading (with id \"B2\") using cURL is specified below\n```\ncurl -X GET localhost:3000/cells/B2\n```\n\n#### Deleting Cells\n\nCells can be deleted using the DELETE method to */cells/id*.\n\nAn example of cell deletion (with id \"B2\") using cURL is specified below\n```\ncurl -X DELETE localhost:3000/cells/B2\n```\n\n#### Listing Cells\n\nA list of all cells can be obtained using the GET method to */cells*.\n\nAn example of listing all cells using cURL is specified below\n```\ncurl -X GET localhost:3000/cells\n```\n\n### Limitations\n\nThe formula evaluation function does not check for cycles between cells. Division by zero is not supported, neither are imaginary numbers. Only the following operators are accepted: '+', '-', '*', '/' and unary '-'.\n\n### Footnote\n\nThe `tests/` contains two bash scripts. `test10.sh` was provided to students to provide a benchmark for program functionality. `test50.sh` was the final script used to assess the project, run with both SQLite and Firebase.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalhaahussain%2Frestful-spreadsheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftalhaahussain%2Frestful-spreadsheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalhaahussain%2Frestful-spreadsheet/lists"}