{"id":16772527,"url":"https://github.com/pranav-kural/plamatio-backend","last_synced_at":"2026-01-30T22:03:44.787Z","repository":{"id":255055655,"uuid":"848343292","full_name":"pranav-kural/plamatio-backend","owner":"pranav-kural","description":"Performant, Scalable, and Resilient Backend for Plamatio E-Commerce.","archived":false,"fork":false,"pushed_at":"2024-09-25T22:08:13.000Z","size":170,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T03:29:13.902Z","etag":null,"topics":["api","confluent-kafka","ecommerce-api","encore","go","golang","kafka","rest","rest-api"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pranav-kural.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-08-27T15:33:21.000Z","updated_at":"2024-12-11T09:46:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"f1eab08d-7514-4476-9ce2-71335d3653cd","html_url":"https://github.com/pranav-kural/plamatio-backend","commit_stats":null,"previous_names":["pranav-kural/plamatio-backend"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pranav-kural%2Fplamatio-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pranav-kural%2Fplamatio-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pranav-kural%2Fplamatio-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pranav-kural%2Fplamatio-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pranav-kural","download_url":"https://codeload.github.com/pranav-kural/plamatio-backend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243896384,"owners_count":20365369,"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":["api","confluent-kafka","ecommerce-api","encore","go","golang","kafka","rest","rest-api"],"created_at":"2024-10-13T06:43:05.183Z","updated_at":"2026-01-30T22:03:44.688Z","avatar_url":"https://github.com/pranav-kural.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Plamatio Backend\n\nPlamatio is a production-ready E-commerce store focused on Llama-inspired products. This e-commerce store was built as part of [my portfolio](https://www.pkural.ca/) projects for demonstration of some cutting-edge technologies in building a highly performant, scalable, and resilient backend that composes of a robust Go-lang written REST API with PostgreSQL databases, Kafka-based real-time data streaming, Redis cache system, backend system monitoring and observability through Grafana, and more.\n\n[Plamatio Backend Documentation](https://pkural.notion.site/Plamatio-Backend-Documentation-d8c426f7851546c19df095c7fbf72282)\n\n![Plamatio Backend Deployment - Staging](https://img.shields.io/github/deployments/pranav-kural/plamatio-backend/staging?label=staging)\n![Plamatio Backend Deployment - Production](https://img.shields.io/github/deployments/pranav-kural/plamatio-backend/prod?label=production)\n\nTo learn more about Plamatio frontend, backend, and data streaming pipeline, check the blog post on [Introduction to Plamatio](http://www.pkural.ca/blog/posts/plamatio-intro/).\n\n## Primary Features\n\n- **Distributed REST API:** Plamatio backend consists of multiple distributed modularized REST API services, each with its Redis cache and PostgreSQL database. This distributed architecture allows for maximal scalability, reduced development and maintenance complexity, and increased productivity in fixing issues and releasing feature updates.\n- **PostgreSQL Database + Redis Cache:**  Low-latency request processing pipeline architected with a robust PostgreSQL database (with special indexes) and a distributed, responsive and scalable Redis-based cache for frequently accessed API endpoints.\n- **API-key Authenticated Endpoints:** Simple API-key based authentication for most of the endpoints, reducing overhead and request processing time for both frontends and the backend, without compromise on security.\n- **Kafka-powered Real-time Data Streaming:** Using Confluent-based Kafka services for architecting a real-time data streaming pipeline to not only provide a scalable solution for real-time updates on data mutations but also to enhance capturing of interactions and events on any number of frontends.\n- **Grafana:** Using Grafana Cloud for enchanced monitoring and observability going beyond basic logging, metrics collection and analysis, and API request tracing.\n- **Encore Cloud:** Using Encore Cloud for hosting backend application, secrets management, PostgreSQL database hosting, Redis hosting, and resource provisioning.\n\nBelow image provides a high-level overview of the overall architecture of the Plamatio project.\n\n\u003cp align=\"center\"\u003e\n\u003cimg alt=\"Plamatio Overall Architecture\" src=\"https://github.com/user-attachments/assets/98838e40-2331-41e0-8555-185e8196d0ca\" width=\"600px\" /\u003e\n\u003c/p\u003e\n\n## Project Structure\n\nPlamatio backend is built using the [Encore.go Backend Framework](https://encore.dev/docs/go).\n\nProject is structured in a way that reduces complexity and increases productivity. Since, Encore enables you to build distributed API services, dependency between each service is minimal.\n\nThere are five key services that Plamatio Backend exposes: Products, Categories, Cart, Orders, Users.\n\nFor each of these services, there are four key folders:\n\n- `api`: contains the core REST API endpoints defintions and code.\n- `db`: contains and abstracts methods required to interact with the required table(s) in the PostgreSQL database.\n- `models`: defines the data models used by the service.\n- `utils`: provides any utility functions used across the code of the service.\n\nBasic workflow when adding a new API service would look like:\n\n1. **Define Data Models:** Define data models required by the service. For example, Products service may require a `Product` type definition to store and work with products.\n2. **Define Utility Functions:** Define data validation functions for validating data for creating instances for your defined data models. For example, for Products service, you may define a method to validate data received in a request to create a new product.\n3. **Define Database Methods:** Define methods to interact with the appropriate table in the PostgreSQL database for the service. You might start by defining the SQL statements, followed by defining the methods that handle the execution of these statements.\n4. **Define Service API:** Define the API endpoint methods for the service. This may involve use of the database methods you defined earlier. Moreover, at this stage, you may also configure cache for storing data for frequently accessed API endpoints, and auth handler for authenticated API endpoints.\n\n\n## API Specifications\n\nPlease refer to [Plamatio Backend REST API Specifications](https://pkural.notion.site/REST-API-Specifications-c3fe4301baec4f23a01a86373896ff6a) for more information on the REST API endpoints and their specifications.\n\n## REST API Architecture\n\nBelow image presents a high-level overview of the distributed and scalable REST API architecture of the Plamatio Backend.\n\n\u003cp align=\"center\"\u003e\n\u003cimg alt=\"Plamatio Backend REST API Architecture\" src=\"https://github.com/user-attachments/assets/c2f2b947-d067-49b9-8dca-0df2c83627ed\" /\u003e\n\u003c/p\u003e\n\n## Real-time Data Streaming\n\nTo keep a scalable amounts of frontend interfaces in sync with data mutations, Plamatio uses a Confluent-based Kafka Service architecture to listen to and stream real-time data updates.\n\n\u003cp align=\"center\"\u003e\n\u003cimg alt=\"Plamatio Backend Real-time Data Streaming\" src=\"https://github.com/user-attachments/assets/bb29a411-b1da-4a62-8b99-55c2b8b482be\" width=\"700px\" /\u003e\n\u003c/p\u003e\n\n## Local Development\n\nFeel free to use this project as basis for developing your own high-quality scalable backend systems.\n\nBelow are some sections to assist in you in this.\n\n### Developing locally\n\nTo develop this project locally, you will need to install the [Encore CLI](https://encore.dev/docs/install).\n\nOnce you have Encore CLI installed, you can use the below command to clone this project.\n\n```bash\nencore app clone plamantio-backend-hoki [directory]\n```\n\n### Running locally\n\nBefore running your application, make sure you have Docker installed and running. It's required to locally run Encore applications with databases.\n\n```bash\nencore run\n```\n\n### Open the developer dashboard\n\nWhile `encore run` is running, open [http://localhost:9400/](http://localhost:9400/) to access Encore's [local developer dashboard](https://encore.dev/docs/observability/dev-dash).\n\nHere you can see API docs, make requests in the API explorer, and view traces of the responses.\n\n### Deployment\n\nDeploy your application to a staging environment in Encore cloud:\n\n```bash\ngit add -A .\ngit commit -m 'Commit message'\ngit push encore\n```\n\nThen head over to the [Cloud Dashboard](https://app.encore.dev) to monitor your deployment and find your production URL.\n\nFrom there you can also connect your own AWS or GCP account to use for deployment.\n\n### Testing\n\n```bash\nencore test ./...\n```\n\n## License\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.\n\n## Issues\n\nIf you encounter any issues or bugs while using Plamatio Backend, please report them by following these steps:\n\n1. Check if the issue has already been reported by searching our issue tracker.\n2. If the issue hasn't been reported, create a new issue and provide a detailed description of the problem.\n3. Include steps to reproduce the issue and any relevant error messages or screenshots.\n\n[Open Issue](https://github.com/pranav-kural/plamatio-backend/issues)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpranav-kural%2Fplamatio-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpranav-kural%2Fplamatio-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpranav-kural%2Fplamatio-backend/lists"}