An open API service indexing awesome lists of open source software.

https://github.com/imbios/nextjs-flask-lab


https://github.com/imbios/nextjs-flask-lab

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

        

# Next.js, Flask, Vercel Lab

I'm curious on capabilities of Next.js , Flask, and Vercel combination.

## Legends

- βœ… : Success
- πŸ”΄ : Failed
- πŸš€ : In Progress

## Lab Objective

### 1. βœ… Default template of Next.js, Flask, Vercel combination working properly

Commit:

Specifications (dir (url)):

- Python API directory: ./api (/api)
- Next.js API directory: -

Note: Of course, it's working. It's the default template.

βœ… Python API URL:

### 2. πŸ”΄ Use Next.js API with Flask API in the same project

#### 2.1. πŸ”΄ Use Next.js API (/api) with Flask API (/api-proxy) in the same project

Commit:

Specifications (dir (url)):

- Python directory: ./api (/api-proxy)
- Next.js directory: ./ (/api)

Note:

Test number 2 failed, means all test below will also failed. Vercel can only have single serverless function source in the same project. either Next.js API or Flask API. Although it's working locally, but it's not working in Vercel.

βœ… Next.js API URL:
πŸ”΄Python API URL:

#### 2.2. πŸ”΄ Use Next.js API (/api) with Flask API (/api) in the same project

Not tested yet, but I think it will failed.

#### 2.3. πŸ”΄ Use Next.js API (/api) with Flask API (/api-proxy) in the same project, but Flask directory changed from default (./api) to (./python)

Not tested yet, but I think it will failed.

#### 2.4. πŸ”΄ Use Next.js API (/api) with Flask API (/api) in the same project, but Flask directory changed from default (./api) to (./python)

Not tested yet, but I think it will failed.

### 3. πŸš€ Use Next.js as client side and Flask as server side

#### 3.1 πŸ”΄ Use Next.js as client side and Flask as server side, but Flask directory changed from default (./api) to (./python)

Not tested yet, but I think it will failed. It because I think Vercel recognize if there any serverless function in the project, is by detecting wether there is `api` directory or not. and if it has Next.js API, it will prefer to use Next.js API instead of Flask API.

#### 3.2 πŸ”΄ Use Next.js as client side and Flask as server side, but Flask API URL changed from default (./api) to (./python)

Commit:

Specifications (dir (url)):

- Python API directory: ./api (/python)

Note: It's working locally, but not working in Vercel.

πŸ”΄ Python API URL:

#### 3.3 πŸš€ Use Next.js as client side and Flask as server side, Flask API URL is using /api but having multiple endpoint in single file (index.py)

Commit: -

Note: It's working locally, start to test in Vercel.