Components
Tech stack
- Flutter
- Firebase
- Django-REST
- Gemini
Usage of tech stack
We used github for our project workflow, frontend work was started with design choices like colour pallets and the responsiveness of the app. We used figma for designing different pages, it's vector design tools helped us create a wide variety of pages
Django-REST framework was used to create the API for all the communication between the client and the server, it was used for all requests and responses. It was also used to modify the data in a more readable form where it was necessary.
The database was initially in the form of json files, to implement searching, gemini was used. First, it was used to map the json files to categories on which we are gonna search upon. Then we used the natural language processing of gemini to map the user prompt of a certain situation into those categories, and return the result with the most weights associated to it.
Firebase was used to store the scraped data, and user data, like the user identification and the file system for a particular user. Firebase is used for the OTP verification process, in case a user doesn't have an account, firebase creates one for the user. Firebase provided a seamless interface to apply server side features
For the frontend interface Flutter framework was used with a wide variety of packages to handle the features that the app offers to users. Some of these packages and their uses were:-
- file_picker: picking files from external storage
- flutter_widget_from_html: convert string containing html code to flutter widgets
- permission_handler: asking user for permissions to manage external storage
- http: converting files from external storage into a form which can be transferred to firebase
Iteration and Challenges
The frontend started with Figma designs and seamlessly transitioned into Flutter development, leveraging its rapid development capabilities for fast paced page creation. During implementation of certain functionalities like external storage file selection, or rendering html strings of legal precedents, we would often encounter the problem of using the right package with the right versions. Flutter goes through upgrades very frequently which makes it hard for a developer to keep up, which also deprecates a lot of online resources even dating a couple of years back. The frontend team often had to refer to the documentation and cross checking the compatibility of packages before using them in the project, this slowed down the process but made the work much more streamlined.
A major challenge the team faced was making a File System inside our application, this required collaboration from both the teams working on the frontend and the backend side of the application. Together we figured out a solution in which we store the directory path as a string, and manipulated it whenever a frontend event that changed directories was called, we then shared this variable with the backend to keep track of it so that we don't loose when popping states.
The backend team started with the creation of databases with web scraping different websites, it took some time to find the right source that was open to developers. We end up using the indian kanoon website for making out database. Then the team proceeded to transfer everything to firebase cloud storage. One of the major challenges encountered by the team was providing the file to the front end interface in the form of an html string to be rendered. Initially, sending the json data byte by byte proved to be a failure, with the reference of some documentation, the team figured out that sending the data through octet streams solved the problem.
Some other small challenges faced by the team were tuning the Gemini model with the right initialization parameters, it took a lot of experimentation and testing to come up with the right values. Initially, there was a security concerns of the API key being exposed, the team constructed the env file to patch that error.