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.
Sign up for updates and more information about the deployed app.
Project made with:
- Clone the repository
git clone https://github.com/waseemhnyc/instagraph-nextjs-fastapi.git
- Navigate to the project directory
cd instagraph-nextjs-fastapi
- Install packages
yarn
- Set environment variables
OPENAI_API_KEY=your-api-key-here
- Run Next JS app
yarn run dev
Now that the frontend is working, it's time to get the backend up and running.
- Move into the
api
directory, create a virutalenv and source the environment
cd api/
python3 -m venv venv
source venv/bin/activate
- Install libraries
pip install -r requirements.txt
- Create a .env file and input your OpenAI API Key in the file
cp .env.example .env
- Run local server
uvicorn main:app --host 0.0.0.0
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!
MIT License. See LICENSE for more information.