0 to 11k Lines of Code: My Journey with C4gt

Anmol AgrawalAnmol Agrawal
2 min read

A few months ago, I came across a unique opportunity to join the ranks of the 2nd Cohort in the Code for GovTech (C4GT) program. C4GT, India's pioneering annual coding initiative, is dedicated to fostering a community capable of developing and enriching global Digital Public Goods. I consider myself fortunate to have secured a place among 103 projects associated with 34+ different products, marking an exciting journey ahead.

I got a chance to work with Sunbird RC, you can get more info about it here: https://docs.sunbirdrc.dev/learn/readme. I was really fascinated by its codebase design. It took me a month to understand but it was really helpful.

Let's come to my project now:

The "Starter Pack for Location Master" project was conceived with a vital objective: to create a comprehensive database of Indian locations, ranging from villages and districts to states and PIN codes. This initiative aimed to address the recurrent challenge faced by numerous projects—reinventing the wheel when it came to sourcing location data from trusted authorities such as the Post Office or the Local Government Directory (LGD).

Visit issue ticket

Architecture on more scalable is fully project including frontend, backend, and database. I mainly worked on the backend side. Creating a node layer on top of Sunbird RC backend which is a combination of Postgres, registry, and elastic search as of now in my project.

I created the schemas, see the main config:

{
  "$schema": "http://json-schema.org/draft-07/schema",
  "type": "object",
  "properties": {
    "SourceConfig": {
      "$ref": "#/definitions/SourceConfig"
    }
  },
  "required": ["SourceConfig"],
  "title": "SourceConfig",
  "definitions": {
    "SourceConfig": {
      "type": "object",
      "uniqueIndexFields": ["source"],
      "properties": {
        "source": {
          "type": "string"
        },
        "entityFileMap": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/EntityFileMap"
          }
        },
        "hierarchy": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": ["source", "entityFileMap"]
    },
    "EntityFileMap": {
      "type": "object",
      "properties": {
        "entity": {
          "type": "string"
        },
        "keyMap": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "higherHierarchy": {
              "type": "string"
            }
          },
          "required": ["code", "name", "higherHierarchy"]
        }
      },
      "required": []
    }
  }
}

The main part is the logic and approach for considering all the cases and optimizing the product.

Here is the demo video:

I'm determined to take this project to the production stage and further optimize it. My vision includes generating valuable value propositions and use cases centered around this location registry. Imagine someone wanting to register their location and create a unique address for that specific place effortlessly. Beyond that, there's a multitude of exciting ideas that can be built on top of this project, opening doors to endless possibilities.

Here is the GitHub Code repository:

Explore the code!

10
Subscribe to my newsletter

Read articles from Anmol Agrawal directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Anmol Agrawal
Anmol Agrawal