Inspiration
Nowadays, generating code is cheap and easy. However, getting sued for using the wrong license is not.
What it does
That's why we decided to build a system that checks the license of code. That way, when we use code we can be certain we are not breaking the law.
How we built it
License checker is built with MongoDB to store code files as vector embeddings. Then, vector search is used to find the 5 closest documents. In the front end, Nextjs takes in as input the code to be checked. Then, it makes a vector search with the MongoDB database. The output returned to the user is the list of non-permissive licenses and code snippets.
Challenges we ran into
By default, MongoDB does not allow connections from Vercel apps, so we had to explicitly enable the connections.
Accomplishments that we're proud of
The system is live and can now be used as a tool by simply going to https://code-license-checker.vercel.app/
What we learned
We were impressed by how fast and easily MongoDB can handle vector data types. In the past, we used the clunky strategy of saving vectors as strings and then making the conversion to vectors on the fly. That's all in the past now that we can handle vectors directly.
What's next for License Checker
Next steps include the following:
- Expand the database to include more code and more licenses.
- Improve user experience by integrating the tool as part of an IDE
Built With
- mongodb
- nextjs
- vercel
Log in or sign up for Devpost to join the conversation.