Quick Start
Prerequisites
Before you begin, ensure you have the following installed on your machine:
- Node.js 18+ and npm/yarn
- Python 3.9+ and pip
- Supabase Account: A free tier project is sufficient.
1. Supabase Configuration
Blogify relies on Supabase for Authentication, PostgreSQL, and Image Storage.
- Create a Project: In your Supabase dashboard, create a new project.
- Database: Run your migrations or set up your schema for
postsanduserstables. - Storage: Create a public bucket named
imagesin the Storage tab. - Credentials: From Project Settings > API, retrieve your
Project URL,Anon Key, andService Role Key.
2. Backend Setup (FastAPI)
The backend acts as a secure proxy to the database, handling JWT verification and business logic.
-
Navigate to the backend directory:
cd backend -
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate -
Install dependencies:
pip install -r requirements.txt -
Configure Environment Variables: Create a
.envfile in thebackend/folder:DATABASE_URL=your_supabase_postgresql_url SUPABASE_URL=your_supabase_project_url SUPABASE_KEY=your_supabase_service_role_key JWT_SECRET=your_supabase_jwt_secret -
Start the API server:
python APP/main.pyThe backend will be available at
http://127.0.0.1:8000.
3. Frontend Setup (Next.js)
The frontend provides the user interface and interacts with both Supabase (for Auth) and the FastAPI backend (for data).
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install -
Configure Environment Variables: Create a
.env.localfile in thefrontend/folder:NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key NEXT_PUBLIC_API_URL=http://127.0.0.1:8000 -
Start the development server:
npm run devThe application will be available at
http://localhost:3000.
4. Verification
- Open
http://localhost:3000in your browser. - Navigate to the Signup page and create a new account.
- Upon successful signup, you will be redirected to the Feed.
- Try creating a new post with Markdown content or an image upload to ensure the full stack is communicating correctly.
Common Troubleshooting
| Issue | Resolution |
| :--- | :--- |
| CORS Errors | Ensure NEXT_PUBLIC_API_URL in the frontend matches the origin allowed in backend/APP/main.py. |
| Auth Failures | Verify that your Supabase JWT Secret in the backend matches the one provided in the Supabase Dashboard. |
| Upload Errors | Ensure the images bucket in Supabase Storage is set to Public. |