**Project:** Loka.ai/**Members:** Quan Nguyen, Duc Nguyen, Long Bui

## I. Motivations

While small businesses represent 44% of the U.S. GDP, 99% of all firms, and have generated 63% of new jobs over the last decade, they face challenges in leveraging data-driven decision-making to enhance profitability comparing larger enterprises. This may be due to the lack of resources and experience necessary to implement data-driven technologies and invest in research and development.

A platform that could help small firms to **optimize** their **financial resosurces** and **understand** of **market dynamics** has become more **urgent**.

## II. Solution Overview

Given our limited resources and time, we aim to focus on a specific area that best showcases the potential of this approach:

*An innovative approach to identify the **ideal locations** for small-scale food and beverage enterprises.*

Most optimized location. **What it demonstrates ?**

* Customer demographics
* Potential Markets
* Rental & operational costs
* Competitor presence

Focusing first on F&B industry. **Why F&B ?**

* **99.9%** of businesses in F&B industry are small firms.
* **56%** of F&B business owners struggle with managing operational costs and profitability
* **52%** cite economic uncertainty as a major hurdleeconomic uncertainty as a significant hurdle.
* The U.S. packaged food market is projected to reach **US$1.6 trillion** by 2030

## III. Milestones & Challenges

![System Diagram](https://raw.githubusercontent.com/qnhn22/loka/refs/heads/main/pics/system_diagram.png)

* Pull APIs from different data sources (GoogleMapAPI, Census Bureau, NY Open Data)
* Integrate pulled data into [MongoDB](https://github.com/mongodb/mongo)
* Utilize [React](https://github.com/facebook/react) to construct web interface
* Optimize [Flask](https://github.com/pallets/flask) to build server
* Develop a machine learning model that captures essential parameters using [Cerebas API](https://github.com/Cerebras) to rank most optimized locations
* Leverage [PropelAuthority](https://github.com/orgs/PropelAuth/repositories) to authorize user management
* Design, reorganize, and visualize metrics into meaningful and understandable insights

## IV. Takeaways

### Pros

* **Operational and Functional**: The app is fully operational, allowing users to access its features seamlessly, enabling immediate utilization for business enhancement.
* **Showcases Essential Capabilities**: It effectively demonstrates the necessary skills and functionalities, providing valuable insights for optimizing processes and decision-making.
* **Room for Improvements**: The project shows solid foundation that could potentially develop new features and continous improvability in the future.

### Cons

* **Potential Model Biases**: Some biases have been identified in the model, which may affect accuracy. Further testing and fine-tuning are needed to improve reliability.
* **Capacity Limitations**: The app currently has restrictions on handling larger datasets and accommodating more users, necessitating enhancements for scalability.
* **Data Dependencies**: Fetching data from different sources and does not have inernal data may lead to disrupt the system if sources collasped.

## V. Future Enhancements

### Model Improvements:

1. **Market Equilibrium Adjustment**:
Implement dynamic Supply & Demand balancing algorithms to reflect real-time market conditions.
2. **Logistics Analysis Implementation**: Incorporate advanced logistics modeling to optimize supply chain operations and reduce costs.
3. **Data Backup Sources**: Utilize redundant cloud storage, regular snapshots, and blockchain technology for secure and reliable data backups.
4. **Features Added**: Introduce machine learning price predictions, real-time sentiment analysis, customizable alerts, and interactive visualizations.

### Platform Integrations:

1. **Market Data Providers:** Establish connections with providers like Bloomberg for comprehensive market data feeds.
2. **Integration with CRM Systems**: Connect with platforms like Microsoft Business Central (launched in 2021 to serve small business's data solutions) to retreive more accurate financial data.
## Inspiration

Small businesses have suffered throughout the COVID-19 pandemic. In order to help them get back on track once life comes back to normal, this app can attract new and loyal customers alike to the restaurant.

## What it does

Businesses can sign up and host their restaurant online, where users can search them up, follow them, and scroll around and see their items. Owners can also offer virtual coupons to attract more customers, or users can buy each other food vouchers that can be redeemed next time they visit the store.

## How we built it

The webapp was built using Flask and Google's Firebase for the backend development. Multiple flask modules were used, such as flask\_login, flask\_bcrypt, pyrebase, and more. HTML/CSS with Jinja2 and Bootstrap were used for the View (structuring of the code followed an MVC model).

## Challenges we ran into

-Restructuring of the project:
Sometime during Saturday, we had to restructure the whole project because we ran into a circular dependency, so the whole structure of the code changed making us learn the new way of deploying our code

-Many 'NoneType Object is not subscriptable', and not attributable errors
Getting data from our Firebase realtime database proved to be quite difficult at times, because there were many branches, and each time we would try to retrieve values we ran into the risk of getting this error. Depending on the type of user, the structure of the database changes but the users are similarly related (Business inherits from Users), so sometimes during login/registration the user type wouldn't be known properly leading to NoneType object errors.

-Having pages different for each type of user
This was not as much of a challenge as the other two, thanks to the help of Jinja2. However, due to the different pages for different users, sometimes the errors would return (like names returning as None, because the user types would be different).

## Accomplishments that we're proud of

-Having a functional search and login/registration system

-Implementing encryption with user passwords

-Implementing dynamic URLs that would show different pages based on Business/User type

-Allowing businesses to add items on their menu, and uploading them to Firebase

-Fully incorporating our data and object structures in Firebase,

## What we learned

Every accomplishment is something we have learned. These are things we haven't implemented before in our projects. We learned how to use Firebase with Python, and how to use Flask with all of its other mini modules.

## What's next for foodtalk

Due to time constraints, we still have to implement businesses being able to post their own posts. The coupon voucher and gift receipt system have yet to be implemented, and there could be more customization for users and businesses to put on their profile, like profile pictures and biographies.
## Inspiration

Despite being a global priority in the eyes of the United Nations, food insecurity still affects hundreds of millions of people. Even in the developed country of Canada, over 5.8 million individuals (>14% of the national population) are living in food-insecure households. These individuals are unable to access adequate quantities of nutritious foods.

## What it does

Food4All works to limit the prevalence of food insecurity by minimizing waste from food corporations. The website addresses this by serving as a link between businesses with leftover food and individuals in need. Businesses with a surplus of food are able to donate food by displaying their offering on the Food4All website. By filling out the form, businesses will have the opportunity to input the nutritional values of the food, the quantity of the food, and the location for pickup.

From a consumer’s perspective, they will be able to see nearby donations on an interactive map. By separating foods by their needs (e.g., high-protein), consumers will be able to reserve the donated food they desire. Altogether, this works to cut down unnecessary food waste by providing it to people in need.

## How we built it

We created this project using a combination of multiple languages. We used Python for the backend, specifically for setting up the login system using Flask Login. We also used Python for form submissions, where we took the input and allocated it to a JSON object which interacted with the food map. Secondly, we used Typescript (JavaScript for deployable code) and JavaScript’s Fetch API in order to interact with the Google Maps Platform. The two major APIs we used from this platform are the Places API and Maps JavaScript API. This was responsible for creating the map, the markers with information, and an accessible form system. We used HTML/CSS and JavaScript alongside Bootstrap to produce the web-design of the website. Finally, we used the QR Code API in order to get QR Code receipts for the food pickups.

## Challenges we ran into

Some of the challenges we ran into was using the Fetch API. Since none of us were familiar with asynchronous polling, specifically in JavaScript, we had to learn this to make a functioning food inventory. Additionally, learning the Google Maps Platform was a challenge due to the comprehensive documentation and our lack of prior experience. Finally, putting front-end components together with back-end components to create a cohesive website proved to be a major challenge for us.

## Accomplishments that we're proud of

Overall, we are extremely proud of the web application we created. The final website is functional and it was created to resolve a social issue we are all passionate about. Furthermore, the project we created solves a problem in a way that hasn’t been approached before. In addition to improving our teamwork skills, we are pleased to have learned new tools such as Google Maps Platform. Last but not least, we are thrilled to overcome the multiple challenges we faced throughout the process of creation.

## What we learned

In addition to learning more about food insecurity, we improved our HTML/CSS skills through developing the website. To add on, we increased our understanding of Javascript/TypeScript through the utilization of the APIs on Google Maps Platform (e.g., Maps JavaScript API and Places API). These APIs taught us valuable JavaScript skills like operating the Fetch API effectively. We also had to incorporate the Google Maps Autofill Form API and the Maps JavaScript API, which happened to be a difficult but engaging challenge for us.

## What's next for Food4All - End Food Insecurity

There are a variety of next steps of Food4All. First of all, we want to eliminate the potential misuse of reserving food. One of our key objectives is to prevent privileged individuals from taking away the donations from people in need. We plan to implement a method to verify the socioeconomic status of users. Proper implementation of this verification system would also be effective in limiting the maximum number of reservations an individual can make daily.

We also want to add a method to incentivize businesses to donate their excess food. This can be achieved by partnering with corporations and marketing their business on our webpage. By doing this, organizations who donate will be seen as charitable and good-natured by the public eye.

Lastly, we want to have a third option which would allow volunteers to act as a delivery person. This would permit them to drop off items at the consumer’s household. Volunteers, if applicable, would be able to receive volunteer hours based on delivery time.