This project integrates a Supabase-authenticated API with a Next.js typescript frontend and a Python backend for Hugging Face model inference.
The project consists of two main parts:
- Backend: A Python API using serverless functions, which handles user authentication with Supabase and communicates with the Hugging Face API for model inference.
- Frontend: A Next.js application for user authentication and sending inference requests to the backend.
- User authentication using Supabase
- Secure token verification
- Hugging Face model inference integration
- Simple frontend for user interaction
- Python 3.12
- Node.js and npm
- Supabase account
- Hugging Face account
Create a .env
file in the root directory and add the following environment variables:
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_key
HUGGINGFACE_API_TOKEN=your_huggingface_api_token
NEXT_PUBLIC_SUPABASE_KEY=your_supabase_key
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
Deploy app to vercel and add the environment variables in the settings.
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_key
NEXT_PUBLIC_SUPABASE_KEY=your_supabase_key
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
HUGGINGFACE_API_TOKEN=your_huggingface_api_token