{"id":18290813,"url":"https://github.com/debrajhyper/todo-space","last_synced_at":"2025-04-09T07:34:16.673Z","repository":{"id":243817417,"uuid":"810424972","full_name":"debrajhyper/Todo-Space","owner":"debrajhyper","description":"Develop a TODO API using Golang and ScyllaDB that supports basic CRUD operations and includes pagination functionality for the list endpoint.","archived":false,"fork":false,"pushed_at":"2024-06-11T10:31:10.000Z","size":544,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-15T01:44:25.337Z","etag":null,"topics":["golang","golang-application","scylladb"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/debrajhyper.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-06-04T17:08:41.000Z","updated_at":"2024-08-14T17:36:18.000Z","dependencies_parsed_at":"2024-06-11T10:43:05.088Z","dependency_job_id":"44d6b5de-2bac-4e89-abb2-79feabd3efdf","html_url":"https://github.com/debrajhyper/Todo-Space","commit_stats":null,"previous_names":["debrajhyper/todo-space"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debrajhyper%2FTodo-Space","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debrajhyper%2FTodo-Space/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debrajhyper%2FTodo-Space/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debrajhyper%2FTodo-Space/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/debrajhyper","download_url":"https://codeload.github.com/debrajhyper/Todo-Space/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247997895,"owners_count":21030698,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["golang","golang-application","scylladb"],"created_at":"2024-11-05T14:12:18.469Z","updated_at":"2025-04-09T07:34:16.634Z","avatar_url":"https://github.com/debrajhyper.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eTodo Space 📑\u003c/h1\u003e\n\n## 💡 Objective\n    Develop a TODO API using Golang and ScyllaDB that supports basic CRUD operations and includes \n    pagination functionality for the list endpoint.\n\n## 📒 Requirements\n- Set up a Golang project and integrate ScyllaDB as the database for storing TODO items. Ensure that items in the database are stored user-wise.\n- Implement endpoints for creating, reading, updating, and deleting TODO items for a single user at a time. Each TODO item should have at least the following properties: id, user_id, title, description, status, created, updated.\n- Implement a paginated list endpoint to retrieve TODO items.\n- Provide support for filtering based on TODO item status (e.g., pending, completed).\n\n\n## ⚙️ API Documentation\n\n### `POST` /v1/todo\n\nCreate a new todo item.\n\n-   **URL:** `http://localhost:8080/v1/todo`\n-   **Method:** POST\n-   **Body:** json\n    ```json\n    {\n        \"id\": \"004599c1-69d7-47b8-8306-a144d7265538\",\n        \"user_id\": \"004599c1-69d7-47b8-8306-a144d7265538\",\n        \"title\": \"Complete project tasks\",\n        \"description\": \"Finish coding the backend and write documentation\",\n        \"status\": \"Complete\",\n        \"created\": \"2024-06-10T12:00:00Z\",\n        \"updated\": \"2024-06-10T12:00:00Z\"\n    }\n\n![alt text](image-1.png)\n\n### `PUT` /v1/todo/:id\n\nUpdate a specific todo item.\n\n-   **URL:** `http://localhost:8080/v1/todo/:id`\n-   **Method:** PUT\n-   **URL Parameters:**\n    -   `id`: ID of the todo item to update\n\n![alt text](image-2.png)\n\n### `DELETE` /v1/todo/:id\n\nDelete a specific todo item.\n\n-   **URL:** `http://localhost:8080/v1/todo/:id`\n-   **Method:** DELETE\n-   **URL Parameters:**\n    -   `id`: ID of the todo item to delete\n\n![alt text](image-6.png)\n\n### `GET` /v1/todo/:id\n\nRetrieve details of a specific todo item.\n\n-   **URL:** `http://localhost:8080/v1/todo/:id`\n-   **Method:** GET\n-   **URL Parameters:**\n    -   `id`: ID of the todo item to retrieve\n\n![alt text](image-3.png)\n\n### `GET` /v1/todo\n\nRetrieve all todo items based on filters.\n\n-   **URL:** `http://localhost:8080/v1/todo`\n-   **Method:** GET\n-   **Query Parameters:**\n    -   `status`: Filter by status (`pending` or `completed`)\n    -   `size`: Number of items to retrieve (default 10)\n    -   `lastPageToken`: Offset for pagination (default 0)\n\n![alt text](image-4.png)\n\n![alt text](image-5.png)\n\n## 🏃‍♂️ Run Locally\n\n- Clone this repository.\n    ```js\n    https://github.com/debrajhyper/Todo-Space.git\n    ```\n- Install Docker Desktop.\n- Run `docker-compose -f todospace-api.yml up` to initialize a Scylla-DB instance running on port 9042.\n- Go from the main directory to `\\cmd\\api` and then run `go run main.go` to start the service.\n\nNote: If you are facing issue while connecting the golang backend services with the ScyllaDB then run the below steps.\n  - open ``cmd`` and enter the command to execute the cqlsh in the scylla-db instance.\n  ```bash\n    docker exec -it scylla-db cqlsh\n  ```\n  ![alt text](image-7.png)\n\n  Note down the ``IP(172.23.0.2)``(might be change according to your docker configuration) and change it to the ``scylladb.go`` file.\n\n  ![alt text](image-8.png)\n  \n  - Now in the cqlsh terminal create the ``KEYSPACE`` manually by the following command:\n  ```bash\n    CREATE KEYSPACE todo WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};\n  ```\n  - Now enter the command to use the ``todo KEYSPACE``\n  ```bash\n    use todo;\n  ```\n  - Now create the ``todos`` table from the below query\n  ```sql\n    CREATE TABLE IF NOT EXISTS todos (id UUID,user_id UUID,title TEXT,description TEXT,status TEXT,created TEXT,updated TEXT,PRIMARY KEY (id, user_id));\n  ```\n\n## Features Implemented:\n\n- Implemented CRUD routes for interaction b/w server and ScyllaDB.\n- The API's are paginated for easy data retrieval.\n- The application's DB part is Dockerized and is stateful through volumes.\n- Support for filtering based on TODO item status (e.g., pending, completed).\n\n## Current Architecture:\n\n- Containerized approach to solving the problem statement.\n- Two Interfaces one for the server and one for db are interacting between each other for the backend application.\n\n## Future Scope:\n\n- The current architecture is a very basic implementation of the problem statement.\n- Depending upon the scale, the entire architecture can be **scaled horizontally** using nginx load balancing.\n- Web can use a queueing mechanism like Rabbit or BullMQ to introduce pub-sub architecture to improve performance.\n- The Go-Server could be containerized to improve deployment.\n- Introduction to goroutines would increase the overall throughput of the service.  \n\n## 👨🏻‍💻 Developer's Talk\nDeveloped by \u003ca href=\"https://github.com/debrajhyper\"\u003eDebraj Karmakar\u003c/a\u003e\n\u003cspan style=\"display:inline-flex; justify-content:space-evenly; width:20%;\"\u003e\n\u003ca href=\"https://twitter.com/debraj_010\"\u003e\n  \u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/twitter/twitter-original.svg\" width=\"20px\"/\u003e\n\u003c/a\u003e\n\u003ca href=\"https://linkedin.com/in/debraj-karmakar-275570199\"\u003e\n  \u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/linkedin/linkedin-original.svg\" width=\"20px\"/\u003e\n\u003c/a\u003e\n\u003ca href=\"https://fb.com/debraj.karmakar.923\"\u003e\n  \u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/facebook/facebook-original.svg\" width=\"20px\"/\u003e\n\u003c/a\u003e\n\u003ca href=\"https://www.behance.net/debrajkarmakar\"\u003e\n  \u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/behance/behance-original.svg\" width=\"20px\"\u003e\n\u003c/a\u003e\n\u003c/span\u003e\n\n\u003e\u003ca href=\"https://github.com/debrajhyper/Todo-Space\"\u003eThis\u003c/a\u003e is a small effort from my side to build a small scale project using Golang and ScyllaDB technologies. The experience taught me so many things, as well as the challenges involved in overcoming problems encountered during the development phase. I consider this project very relevant to me as a full-stack developer.\n\n\u003cbr/\u003e\n\n---","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdebrajhyper%2Ftodo-space","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdebrajhyper%2Ftodo-space","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdebrajhyper%2Ftodo-space/lists"}