Skip to content

waseemhnyc/instagraph-nextjs-fastapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

InstaGraph 🌐 Next JS and FastAPI

Original project and inspiration: Yohei Nakajima - Instagraph

Even though I love working with Python apps (previous Django developer), modern frontend technologies like NextJS (and Tailwind CSS, Shadcn etc) enable you to move faster. Also with the popularity of LLMs, streaming and server-sent-endpoints have become more important in AI products. FastAPI is perfect for building backends to support this.

Demo

Sign up for updates and more information about the deployed app.

Project made with:

Installation 🛠️

  1. Clone the repository
git clone https://github.com/waseemhnyc/instagraph-nextjs-fastapi.git
  1. Navigate to the project directory
cd instagraph-nextjs-fastapi
  1. Install packages
yarn
  1. Set environment variables
OPENAI_API_KEY=your-api-key-here
  1. Run Next JS app
yarn run dev

Now that the frontend is working, it's time to get the backend up and running.

  1. Move into the api directory, create a virutalenv and source the environment
cd api/
python3 -m venv venv
source venv/bin/activate
  1. Install libraries
pip install -r requirements.txt
  1. Create a .env file and input your OpenAI API Key in the file
cp .env.example .env
  1. Run local server
uvicorn main:app --host 0.0.0.0

Usage 🎉

Web Interface

  • Open your web browser and navigate to http://localhost:3000/.
  • Type your text in the input box.
  • Click "Submit" and wait for the magic to happen!

License 📝

MIT License. See LICENSE for more information.