GenAI in Action: Accelerating Internal App Development for Enhanced Efficiency

| | 4 min read

At Zyxware Technologies, we've consistently embraced emerging technologies to streamline our operations and provide exceptional digital experiences. Our recent experience with GenAI is a prime example of how it can be used to build apps in an agile manner, enhancing the digital experience and optimizing processes.

The Challenge: Organizing a Wealth of Knowledge

Business Use Cases

For over 18 years, we've been helping clients with their digital needs. We've gathered a huge collection of real-world examples – solutions we've built and problems we've solved for clients in different industries.  We've kept these organized in a spreadsheet, sorted by industry, business area, and specific use cases. We wanted our engineers to create content showcasing the types of projects they've tackled. To help them get started, we wanted them to connect the projects they've worked on (or are currently working on) with the relevant examples we have in our database. 

The spreadsheet, while a valuable resource, presented a challenge. It contained over 2,500 use cases, often with multiple entries crammed into single cells. This made it difficult to share and analyze effectively. We knew that asking our engineers to manually sift through this data and map it to their projects would be an overwhelming and time-consuming task. We needed a more streamlined and efficient solution.

 

 

The Solution: GenAI-Powered App Development

Recognizing the potential of GenAI to expedite development and automate tasks, we turned to this technology to address our data management and digital experience challenge. By providing a carefully crafted prompt, we leveraged ChatGPT to generate the initial Python code for a Flask-based web application. Here is the prompt we used to create a python script to extract and restructure the use case data from the spreadsheet into a normalized, database-friendly format.

Write a Python script that performs the following tasks:
1. Create Database 
   - Create models for the following tables:
     - sectors with columns: id (primary key), name (unique).
     - functions with columns: id (primary key), name (unique), sector_id (foreign key referencing sectors.id).
     - sub_functions with columns: id (primary key), name (unique), function_id (foreign key referencing functions.id).
     - use_cases with columns: id (primary key), name (unique), sub_function_id (foreign key referencing sub_functions.id).
     - Use SQLAlchemy's relationship functionality to define relationships between these tables, ensuring proper data integrity.
2. Flask App with SQLite Database
   - Create a Flask application configured to use a SQLite database.
   - Define a Flask route /import_data that:
     - Initializes the database schema based on the SQLAlchemy models.
- Read CSV
- Use the argparse module to accept a CSV file path as a command-line argument.
- Use pandas to read the CSV file, ensuring proper handling of newline-separated values in the `Use Cases` column.
- Validate that the CSV file contains the required columns: Sector, Function, SubFunction, and Use Cases.
- If any of these columns are missing, the script should raise an appropriate error and terminate execution. - Processes the CSV data by: - Removing any numbering at the beginning of use cases (e.g., '1. ', '2. '). - Normalizing the data, avoiding duplicates by using sets or unique constraints. - Inserting the normalized data into the corresponding database tables. - Returns a JSON response indicating the success of the operation or details of any errors encountered. 4. Error Handling - Implement comprehensive error handling to manage: - CSV parsing errors. - Missing or unexpected columns in the CSV. - Database connection or insertion errors. - Any other exceptions that might occur during execution. 5. Design the application to be easily extendable, allowing for: - Addition of new routes or endpoints in the Flask app without disrupting existing functionality. - Modifications to the database structure, including the creation of new tables, adding new columns, or modifying existing ones. - Integrate Alembic or a similar migration tool to manage database schema changes, ensuring smooth migrations without data loss or corruption. - Use a modular design approach to allow for the easy addition of new features or changes in business logic with minimal impact on the rest of the codebase. 6. Dependencies and setup - Provide requirements.txt and instructions to implement and execute the script.

The GenAI-generated code served as a strong foundation, which we iteratively refined and expanded through additional prompts and development. The final application provided an easy to use UI to our engineers to create/select projects, filter use cases by sector, and efficiently map relevant ones to their projects.

The Impact: Streamlined Processes and Empowered Teams

Embracing GenAI in this project yielded significant benefits:

  • Weeks of potential manual effort were condensed into days, accelerating project delivery.
  • Unstructured spreadsheet data was converted into an organized and accessible database.
  • Engineers now have an intuitive tool to navigate and leverage the wealth of use case information.
  • The app facilitates knowledge sharing and collaboration among team members.

Conclusion

This experience underscores the transformative power of GenAI in streamlining workflows and optimizing processes. By providing clear prompts and iteratively refining the generated code, we rapidly developed an internal application that empowered our engineering team and enhanced our overall efficiency.