Inspiration

This month, I read an article from CBS news, explaining that nearly 70 percent of people do not read legal contracts before signing it. I pondered over this article for the next few days,, and realized that life is short, and people do not want to spend their time reading through the legalese of long contracts. I then thought of a way to shorten this wait period. Why nor create an app where an AI model analyzes the legal document on your behalf? I then immediately got on my laptop and went to work.

What it does

Docalyzer is an app that helps users identify risks and ambiguities in contracts, specifically for each clause. The users will first upload a file with the legal document in it. The app will then process the text, and returns it to the user so the user knows what text will be parsed. Then, it runs it through Gemini's 2.5 Flash model, with Gemini parsing the results as a JSON array. The program will then convert the JSON into a tabular form, where each column represents the points of analysis, and each row represents the clause that was passed through for Gemini to inspect.

How we built it

We first configured a web server with Node.js. I first incorporated a package called pdf-parse, which helped parse the text from the pdf file that the user would upload. I set up an endpoint within the web server so that it could understand and proceed with the requests from the client to the server. Then, I learned how the Gemini API works, along with how to implement it into my application. When I integrated it into my web server, I set up another endpoint when the user clicks the "Start Analyzing" button. Finally, I utilized CSS to be able to provide a nice look and feel.

Challenges we ran into

Although I successfully built this web project, it was not an easy ride. I had many challenges which I had to take care of, which included the following:

  • I frequently hit the limit for the Gemini API: Since I had to do a lot of testing, I hit the requests per day limit quite often. Therefore, I had to wait a whole day in order to continue with the project.
  • Setting up the web server was a challenge: Many times, especially in the initial parts of the project, it was difficult in actually setting up the web server for the project. I had to follow along many tutorials, and it was not easy.
  • I accidently had deleted all my project story: The text that you are seeing right now has been written already, but I accidently wrote it and forgot to save it. I had to write this all over again, but this teaches me to put my work in a document in order to have a copy of it if something unfortunate were to happen.

Accomplishments that we're proud of

Although we ran into many challenges, I am proud to have created my first ever AI-powered application. Even though this is a small program, it still is significant, because in my mind, I feel that I am capable now of harnessing the power of generative artificial intelligence. I also am really glad that I know the basics of Node.js, which in today's times, is one of the most popular back-end servers. Finally, but most importantly, I am proud that I persevered, even though I had struggled with so many things.

What we learned

We learned many concepts while creating this app, some of which are listed here:

  • Configuring the Gemini API to effectively parse data and create a JSON array
  • Creating a Node.js web server, and importing many packages, in order to enhance web development.

What's next for Docalyzer

There are many other things that we look forward to implementing for Docalyzer, which include the following:

  • Create an app on the App Store or Google Play in order for mobile users to access it with ease.
  • Utilize Optical Character Recognition, which would be useful when analyzing a hard copy of contracts
  • Include analyzing capabilities of other legalese(e.g. court documents)
  • Accessibility features, including screen readers, bigger font modes, and high contrast mode.

Tech Stack

I have used the following tools to make this app:

  • Node.js (formidable, pdf-parse, http, and fs packages)
  • HTML
  • CSS
  • JavaScript
  • Gemini (2.5 Flash)

AI Usage

I have used AI to help me with my code, but I have used it when providing good CSS styling for the program, and also for code concision.

Share this project:

Updates