-
-
Notifications
You must be signed in to change notification settings - Fork 148
docs: complete beginner-friendly local setup with all API keys & Python venv #189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,110 +73,119 @@ Inpact is an open-source AI-powered platform designed to connect content creator | |
|
|
||
| ### Prerequisites | ||
|
|
||
| Ensure you have the following installed: | ||
| Make sure you have these installed: | ||
| - Node.js (v18 or higher) + npm | ||
| - Python 3.9+ | ||
| - Git | ||
| - A Supabase account (free tier is enough) | ||
|
|
||
| - Node.js & npm | ||
| - Python & FastAPI | ||
| - Supabase account | ||
| ### Local Development Setup (Step-by-Step) | ||
|
|
||
| ### Installation | ||
|
|
||
| #### 1. Clone the repository | ||
|
|
||
| ```sh | ||
| #### 1. Clone the Repository | ||
| ```bash | ||
| git clone https://github.com/AOSSIE-Org/InPact.git | ||
| cd inpact | ||
| cd InPact | ||
| ``` | ||
|
|
||
| #### 2. Frontend Setup | ||
|
|
||
| 1. Navigate to the frontend directory: | ||
| ```sh | ||
| ```bash | ||
| cd frontend | ||
| ``` | ||
|
|
||
| 2. Install dependencies: | ||
| ```sh | ||
| npm install | ||
| ``` | ||
|
|
||
| Create a `.env` file in the `frontend/` folder: | ||
| ```env | ||
| VITE_SUPABASE_URL=https://your-project.supabase.co | ||
| VITE_SUPABASE_ANON_KEY=your-anon-public-key | ||
| VITE_YOUTUBE_API_KEY=your-youtube-api-key | ||
| ``` | ||
|
|
||
| 3. Create a `.env` file using `.env-example` file: | ||
| **How to get Supabase frontend keys:** | ||
| 1. Go to [https://app.supabase.com](https://app.supabase.com) | ||
| 2. Open your project → **Settings** → **API** | ||
| 3. Copy **Project URL** → `VITE_SUPABASE_URL` | ||
| 4. Copy **anon public** key → `VITE_SUPABASE_ANON_KEY` | ||
|
|
||
| **How to get Youtube API Key** | ||
| 1. Log in to the [https://console.cloud.google.com/](https://console.cloud.google.com/) | ||
| 2. Create a new project or select an existing one from the project drop-down menu. | ||
| 3. In the Cloud Console, search for "YouTube Data API" in the search bar and select "YouTube Data API v3" from the results. | ||
| 4. Click the "Enable" button to enable the API for your project. | ||
| 5. Navigate to the "Credentials" tab in the left-hand menu. | ||
| 6. Click "Create Credentials" and then select "API key" from the dropdown menu and now use that api key. | ||
|
|
||
| #### 3. Backend Setup (with Python Virtual Environment – Highly Recommended) | ||
|
|
||
| 4. Get your Supabase credentials: | ||
| - Go to [Supabase](https://supabase.com/) | ||
| - Log in and create a new project (or use existing) | ||
| - Go to Project Settings -> API | ||
| - Copy the "Project URL" and paste it as VITE_SUPABASE_URL | ||
| - Copy the "anon public" key and paste it as VITE_SUPABASE_ANON_KEY | ||
| ```bash | ||
| cd ../backend | ||
|
|
||
| #### 3. Backend Setup | ||
| # Create a virtual environment (isolates dependencies) | ||
| python -m venv venv | ||
|
|
||
| 1. Navigate to the backend directory: | ||
| ```sh | ||
| cd ../backend | ||
| ``` | ||
| # Activate it | ||
| # Windows: | ||
| venv\Scripts\activate | ||
| # macOS / Linux: | ||
| source venv/bin/activate | ||
|
|
||
| 2. Install dependencies: | ||
| ```sh | ||
| # Install backend dependencies | ||
| pip install -r requirements.txt | ||
| ``` | ||
|
|
||
|
|
||
| 3. Navigate to the app directory: | ||
| ```sh | ||
| cd app | ||
| ``` | ||
|
|
||
| 4. Create a `.env` file using `.env-example` as a reference. | ||
|
|
||
| 5. Obtain Supabase credentials: | ||
|
|
||
| - Go to [Supabase](https://supabase.com/) | ||
| - Log in and create a new project | ||
| - Click on the project and remember the project password | ||
| - Go to the **Connect** section at the top | ||
| - Select **SQLAlchemy** and copy the connection string: | ||
| #### 4. Create Backend `.env` File | ||
|
|
||
| ```sh | ||
| user=postgres | ||
| password=[YOUR-PASSWORD] | ||
| host=db.wveftanaurduixkyijhf.supabase.co | ||
| port=5432 | ||
| dbname=postgres | ||
| ``` | ||
| Create `.env` in `backend/app/` and fill all values: | ||
|
|
||
| --OR-- | ||
| ```env | ||
| # Supabase Database Connection | ||
| user=postgres | ||
| password=YOUR_DB_PASSWORD | ||
| host=db.yourproject.supabase.co | ||
| port=5432 | ||
| dbname=postgres | ||
|
|
||
| [The above works in ipv6 networks, if you are in ipv4 network or it cause errors, use the below connection string which could be found in Session Pooler connection] | ||
|
|
||
| ```sh | ||
| user=postgres.<project> | ||
| password=[YOUR-PASSWORD] | ||
| host=aws-<location>.pooler.supabase.com | ||
| port=5432 | ||
| dbname=postgres | ||
| ``` | ||
| # API Keys | ||
| GROQ_API_KEY=your_groq_key | ||
| SUPABASE_URL=https://your-project.supabase.co | ||
| SUPABASE_KEY=your-anon-public-key | ||
| GEMINI_API_KEY=your_gemini_key | ||
| YOUTUBE_API_KEY=your_youtube_key | ||
| ``` | ||
|
Comment on lines
+118
to
+156
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainBackend setup and environment configuration look clear and well-structured. The virtual environment setup (lines 118–131) is excellent for beginners, with platform-specific activation commands. The consolidated Minor suggestions:
Run this script to verify the directory structure and key files exist: 🏁 Script executed: #!/bin/bash
# Verify backend structure for the documented setup
echo "=== Checking backend directory structure ==="
find . -type d -name backend -o -type d -name frontend 2>/dev/null | head -5
echo "=== Checking for requirements.txt in backend ==="
find . -name requirements.txt -path "*/backend/*" 2>/dev/null
echo "=== Checking for main.py in backend/app ==="
find . -name main.py -path "*/backend/app/*" 2>/dev/nullLength of output: 137 I need to explore the repository structure more broadly to understand the actual layout and locate the backend files. Length of output: 1171 Now I need to check the actual README content to see if there's a case-sensitivity mismatch in the documented paths. Length of output: 1069 Correct the directory path casing throughout the backend setup instructions. The repository uses capitalized directory names (
The required files ( 🤖 Prompt for AI Agents |
||
|
|
||
| **Where to get each key (with direct links):** | ||
|
|
||
| 6. Get the Groq API key: | ||
| - Visit [Groq Console](https://console.groq.com/) | ||
| - Create an API key and paste it into the `.env` file | ||
| | Variable | Service | How to Get (Step-by-Step) | | ||
| |---------------------|--------------------------------|-------------------------------------------------------------------------------------------------------------| | ||
| | `SUPABASE_URL` & `SUPABASE_KEY` | Supabase | Same as frontend → **Settings → API** → copy URL & anon key | | ||
| | `host` & `password` | Supabase PostgreSQL | **Settings → Database → Connection info** → copy Host + the password you set when creating the project | | ||
| | `GROQ_API_KEY` | Groq (fast AI inference) | → [console.groq.com/keys](https://console.groq.com/keys) → Create API Key → copy (`gsk_...`) | | ||
| | `GEMINI_API_KEY` | Google Gemini | → [aistudio.google.com/app/apikey](https://aistudio.google.com/app/apikey) → Create API key | | ||
| | `YOUTUBE_API_KEY` | YouTube Data API v3 | 1. [console.cloud.google.com](https://console.cloud.google.com)<br>2. New Project → Enable YouTube Data API v3<br>3. Credentials → Create API Key | | ||
|
|
||
| #### 4. Start Development Servers | ||
| All are free for development use. | ||
|
|
||
| #### 5. Start the Servers | ||
|
|
||
| 1. Start the frontend server (from the frontend directory): | ||
| ```sh | ||
| **Terminal 1 (Frontend):** | ||
| ```bash | ||
| cd frontend | ||
| npm run dev | ||
| ``` | ||
| → Opens at `http://localhost:5173` | ||
|
|
||
| 2. Start the backend server (from the backend/app directory): | ||
| ```sh | ||
| **Terminal 2 (Backend – make sure venv is active):** | ||
| ```bash | ||
| cd backend/app | ||
| uvicorn main:app --reload | ||
| ``` | ||
| → Runs at `http://127.0.0.1:8000` | ||
|
|
||
| You’re all set! Open `http://localhost:5173` and register/login. | ||
|
|
||
| --- | ||
|
|
||
| ## Data Population | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix markdown linting violation and formatting inconsistency at line 110.
Line 110 triggers a markdown linting issue (MD036) by using emphasis instead of a heading. Additionally, the text has grammatical issues and inconsistent capitalization. The Supabase section (lines 104–109) uses a numbered list format, but the YouTube section should use a heading for consistency.
Apply this diff to fix the linting violation and formatting:
Then adjust the remaining steps (lines 111–116) to align with the Supabase section's structure.
📝 Committable suggestion
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
110-110: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
🤖 Prompt for AI Agents