Crushing the Clock: How We Built SmartDoc and Won Smart India Hackathon 2024 in 36 Hours

Raghav SharmaRaghav Sharma
6 min read

SmartDoc: The Ultimate Document Verification Platform

1. Project Introduction

SmartDoc is an automated document issuance and verification platform designed to simplify and secure the way we handle official documents. The platform operates with three distinct roles:

  • User: The individual requesting document issuance or verification.

  • Issuer: The authority responsible for issuing official documents.

  • Verifier: The entity validating the authenticity of the documents.

SmartDoc leverages cutting-edge technologies like blockchain, IPFS storage, and OCR models to ensure documents are tamper-proof and easily verifiable.


2. My Building Journey

The Starting Point

Our journey began with a focus on the frontend. We uploaded our initial UI designs to Claude AI for refinement. The improved designs became the blueprint for developing three dashboards: User, Issuer, and Verifier.

Once the frontend groundwork was laid, we moved to the backend, starting with a meticulous planning session to outline:

  • API structures

  • Data models

  • Workflow design

My Role

As the team leader and full-stack developer, I primarily focused on backend development but also managed key frontend tasks when needed. With tight deadlines, I took on most of the responsibilities in my hand to ensure we stayed on track.

The Mentoring Session

Before diving deep into coding, I directed my team to craft a polished PowerPoint presentation for the mentoring session. The judges were impressed with our approach but suggested improvements:

  • Ensure all three roles (User, Issuer, Verifier) are independent.

  • Address scalability concerns.

We incorporated their feedback into our plan before resuming development.

Coding Begins

Round 1 Preparation (Day 1: 7 PM)

By the first round of evaluations, we had completed the User and Issuer dashboards. Our presentation included:

  • A 50% functional prototype

  • A detailed technical approach flowchart

The judges provided additional feedback:

  • Allow bulk data uploads for issuing certificates.

  • Enable certificate revocation in cases like user imprisonment.

  • Add support for new document types.

User Dashboard

Issuer Dashboard

Midnight Hustle

Picture this: It's late into the hackathon, and I'm standing in front of the college vending machine, desperately searching for some energy boost. Talk about perfect timing - there were exactly three Red Bulls left! My friend, being the absolute legend he is, grabbed all three for me.

Armed with caffeine and determination, we dove into what would become one of the most intense coding sessions of our lives. Here's what went down:

Bulk Data Upload: The First Challenge

The judges had raised a crucial question: "How will you handle thousands of user records?" Challenge accepted! We implemented a robust bulk upload system that could:

  • Process large CSV files with user data

  • Validate each record automatically

  • Generate documents in batches

  • Maintain performance even with large datasets

Document Revocation: The Trust Factor

A key security feature we added was the ability to revoke documents from the blockchain. Why? Because judges pointed out a critical scenario: what if someone with a digital certificate gets jailed? The solution had to be:

  • Immediate and irreversible

  • Traceable on the blockchain

  • Automatically synchronized across all platforms

Birth Certificate Blues 😅

Oh boy, this one was a challenge! The birth certificate implementation took way longer than expected because:

  • The template had to look official and professional

  • PDF generation kept breaking with different data lengths

  • The final design wasn't aesthetically pleasing

After multiple iterations and a lot of tweaking in our PDF generation function, we finally got it looking perfect around 4 AM.

The Power Nap Decision 😴

With the major features implemented, we faced a choice: push through or take a break? We chose a strategic 2-hour nap from 4 AM to 6 AM. Best decision ever! Although I was still feeling like a zombie when I woke up, that little rest proved crucial for what was coming next.

Round 2: The Morning Showdown (9 AM) 🌅

Walking into Round 2 with our 80% complete prototype, we were feeling confident but nervous. Then came the plot twist:

Pre-Round Drama

Just before the presentation, our system stopped working! The panic was real - imagine the whole team jumping from their seats, frantically checking logs. The culprit? A simple case mismatch: 'birth certificate' vs 'BIRTH_CERTIFICATE'. Sometimes it's the smallest things that cause the biggest scares!

The New Challenges

The judges threw us two major curveballs:

  • Multilingual Support: Documents in multiple Indian languages

  • Direct User Verification: Allow users to verify documents themselves

The Final Sprint: Racing Against Time ⚡

The OVIS Llama Solution

Lucky for us, our OVIS Llama 3.2 3B model supported 22+ Indian languages! But implementing it wasn't straightforward:

  • Size Management:

    • Added frontend size restrictions

    • Implemented document compression

    • Created a selective extraction algorithm

  • Processing Optimization:

    • Built a system to extract only crucial information

    • Implemented parallel processing

    • Added error handling for blurry images

The Final Hour Crisis 😱

With just 60 minutes to go, everything that could go wrong, did:

  • Crisis #1: The AI Apocalypse

    • Error: Free credits ended

    • Time Remaining: 60 minutes

    • Panic Level: EXTREME

    • Solution: Quick thinking led to the VPN workaround. Sometimes the simplest solutions are the best!

  • Crisis #2: Blockchain Blues

    • Error: Transaction Failed

    • Time Remaining: 40 minutes

    • Cause: Empty test Ethereum wallet

After some frantic wallet refilling, we were back in business!


3. Winning Moments

After 36 grueling hours, we sat in the auditorium, drained but hopeful. As the results for Problem Statement 1709 were announced, our team’s name “SMARTINSPECT” echoed through the hall.

The Announcement

The magical moment brought an electrifying surge of energy. We screamed in joy and walked up to the stage, shaking hands like VIPs. Holding the dummy cheque felt surreal. The crowd cheered, and cameras clicked as we celebrated our victory.

Post-Win Celebrations

Our mentor, emotional and proud, said this would have been impossible without me. We partied hard till 2 AM, reveling in the glory of our success.


Technical Highlights

Core Components

  • Document Issuance: Uses watermarking, IPFS storage, and blockchain registration.

  • Document Verification: Integrates OCR and blockchain for secure verification.

Key APIs

  • POST /requestDoc: Initiates document requests.

  • POST /issueDocument: Issues documents after validation.

  • POST /verifyDocument: Verifies document authenticity.

Security Features

  • Blockchain immutability

  • Digital watermarking

  • Multi-step validation


The journey of building SmartDoc was as challenging as it was rewarding. From sleepless nights to last-minute fixes, every moment added to our learning and growth. Winning was the cherry on top, but the experience was the real prize!

0
Subscribe to my newsletter

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

Written by

Raghav Sharma
Raghav Sharma

I write about tech. It could be my projects, a framework or anything that interests me.