Skip to content
Open
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update README.md
  • Loading branch information
tijin-abe-thomas authored Oct 29, 2023
commit 9c038815fafb5d698a0cbcb316d98abcbc625017
71 changes: 28 additions & 43 deletions xaea12/README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,37 @@
<p align="center">
<a href="https://nextjs-flask-starter.vercel.app/">
<img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96">
<h3 align="center">Next.js Flask Starter</h3>
</a>
</p>
## Team Name

<p align="center">Simple Next.js boilerplate that uses <a href="https://flask.palletsprojects.com/">Flask</a> as the API backend.</p>
XAEA12

<br/>
## Problem Statement

## Introduction
Currently, Google offers Direction Requests insights (Count of unique customers seeking directions to your business, adjusted for multi-tapping, cancellations, and spam) as a part of Google Business Profile performance metrics.
However, for a new business who wishes to set up a store in a particular locality, there is little to no data available on the customer density.

This is a hybrid Next.js + Python app that uses Next.js as the frontend and Flask as the API backend. One great use case of this is to write Next.js apps that use Python AI libraries on the backend.
## Team leader email

## How It Works
[email protected]

The Python/Flask server is mapped into to Next.js app under `/api/`.
## A brief of the prototype

This is implemented using [`next.config.js` rewrites](https://github.com/vercel/examples/blob/main/python/nextjs-flask/next.config.js) to map any request to `/api/:path*` to the Flask API, which is hosted in the `/api` folder.
# Idea
Develop an application utilizing the Google Maps Places API to extract business details and create heatmaps, addressing the problem of understanding market demand in specific geographic areas.

On localhost, the rewrite will be made to the `127.0.0.1:5328` port, which is where the Flask server is running.
# Solution
Our application collects data on business activity, including visit trends, and visualizes it using heatmaps. This helps businesses and local authorities make data-driven decisions, optimize operations, and identify growth opportunities.

In production, the Flask server is hosted as [Python serverless functions](https://vercel.com/docs/concepts/functions/serverless-functions/runtimes/python) on Vercel.
## Tech stack

## Demo
Next.js (with TypeScript) for the frontend, with Flask for the backend. We use Google maps APIs such as Places API to get place data, autofill as well as visualization information for creating heatmaps.

https://nextjs-flask-starter.vercel.app/
## Step by Step code execution instructions

## Deploy Your Own
First, edit the code to insert your API key with Places API enabled in
app/.env
api/.env
.env
app/page.tsx

You can clone & deploy it to Vercel with one click:

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?demo-title=Next.js%20Flask%20Starter&demo-description=Simple%20Next.js%20boilerplate%20that%20uses%20Flask%20as%20the%20API%20backend.&demo-url=https%3A%2F%2Fnextjs-flask-starter.vercel.app%2F&demo-image=%2F%2Fimages.ctfassets.net%2Fe5382hct74si%2F795TzKM3irWu6KBCUPpPz%2F44e0c6622097b1eea9b48f732bf75d08%2FCleanShot_2023-05-23_at_12.02.15.png&project-name=Next.js%20Flask%20Starter&repository-name=nextjs-flask-starter&repository-url=https%3A%2F%2Fgithub.amrom.workers.dev%2Fvercel%2Fexamples%2Ftree%2Fmain%2Fpython%2Fnextjs-flask&from=vercel-examples-repo)

## Developing Locally

You can clone & create this repo with the following command

```bash
npx create-next-app nextjs-flask --example "https://github.com/vercel/examples/tree/main/python/nextjs-flask"
```

## Getting Started

First, install the dependencies:
Install the dependencies:

```bash
npm install
Expand All @@ -53,6 +41,13 @@ yarn
pnpm install
```

Run

```npm run build
```

to build the packages.

Then, run the development server:

```bash
Expand All @@ -66,13 +61,3 @@ pnpm dev
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

The Flask server will be running on [http://127.0.0.1:5328](http://127.0.0.1:5328) – feel free to change the port in `package.json` (you'll also need to update it in `next.config.js`).

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
- [Flask Documentation](https://flask.palletsprojects.com/en/1.1.x/) - learn about Flask features and API.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!