DEV Community

Kareem Rufai
Kareem Rufai

Posted on

I built an AI code documentation tool to clean messy code with zero documentation.

If you've ever inherited someone else's code with zero documentation, you know the pain. You spend hours just figuring out what a function does before you can even touch it.

I built legacydoc to fix that.

What is legacydoc?

legacydoc is a tool that takes any undocumented code and generates clean, professional documentation for it instantly. You paste your code, click a button, and get structured docs back in seconds.

No setup. No configuration. Just paste and go.

👉 Try it here: https://legacydoc.io

How it works

You paste your code into the input box. The code gets sent to an API running on AWS Lambda, which processes it and returns structured documentation. The whole round trip takes a few seconds.

Here's a simple example. You paste this:

def calculate_discount(price, percentage):
    return price - (price * percentage / 100)
Enter fullscreen mode Exit fullscreen mode

And you get back something like this:

Overview
Calculates the final price after applying a percentage discount.

Parameters

  • price: The original price before discount
  • percentage: The discount percentage to apply

Returns
The discounted price as a float

Example
calculate_discount(100, 20) → 80.0

The tech stack

  • AWS Lambda — handles the API requests
  • GCP Cloud Run — backup API layer
  • GitHub Pages — hosts the frontend
  • Vanilla HTML/CSS/JS — no framework needed

What I learned building this

Deploying to AWS Lambda for the first time was intimidating. I kept running into CORS errors and IAM permission issues. But once it clicked, it clicked. The free tier covers everything for a small tool like this.

The biggest lesson: ship early. I spent too long trying to make it perfect before anyone had even used it. The first version was rough. That's fine.

What's next

I'm working on adding usage tracking and eventually a paid tier for teams who want unlimited documentation. If you're interested in following along, I'm building this in public.

Try legacydoc at https://legacydoc.io and let me know what you think in the comments.

Top comments (0)