Local Installation
This guide walks you through setting up Prodly on your local machine for development or testing. By the end of these steps, youâll have a fully functional instance running on http://localhost:3000.
Prerequisites
Before you begin, make sure you have the following installed and configured:
- Node.js 18.x or later (LTS recommended)
- npm or bun (weâll use npm in this guide)
- Git (to clone the repository)
- A Supabase account (free tier works) â sign upÂ
- API keys for the services used by Prodly (see Environment Variables)
If you havenât set up your environment variables yet, complete the Environment Setup guide first. You will need those values during installation.
StepâbyâStep Installation
1. Clone the Repository
Since Prodly is a commercial product, the source code is stored in a private GitHub repository. You should have received access to it after purchasing a license.
git clone https://github.com/your-organization/prodly.git
cd prodlyReplace the URL with the actual repository URL you were provided.
2. Install Dependencies
Install all required packages using npm (or bun):
npm installThis will read the package.json and install everything needed to run the application.
3. Set Up Environment Variables
Prodly uses a .env.local file to store configuration and secrets. You should have prepared this file while following the Environment Setup guide.
If you havenât done so already, create a .env.local file in the root of the project and fill in all the required variables:
# Domain (use localhost for local development)
NEXT_PUBLIC_APP_URL=http://localhost:3000
# Supabase
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key
# AI - Text generation (Groq)
GROQ_API_KEY=your_groq_api_key
# AI - Image analysis (Google Gemini)
GOOGLE_API_KEY=your_google_gemini_api_key
# Keyword suggestions (Serper)
SERPER_API_KEY=your_serper_api_key
# Rate limiting (Upstash Redis)
UPSTASH_REDIS_REST_URL=your_upstash_redis_url
UPSTASH_REDIS_REST_TOKEN=your_upstash_redis_token
# Stripe (if you use payments)
STRIPE_SECRET_KEY=sk_test_...
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...
STRIPE_WEBHOOK_SECRET=whsec_... # optional for local testing
.env.local to version control. It is already listed in .gitignore. 4. Set Up the Database
Prodly uses Supabase as its database. You need to apply the database schema to your Supabase project.
-
Log in to your Supabase Dashboard .
-
Open your project.
-
Go to the SQL Editor.
-
Copy the entire contents of
supabase-schema.sql(provided in the project root) and paste it into a new query. -
Run the query. This will create all the required tables and set up Row Level Security policies.
5. Start the Development Server
Now youâre ready to launch the application locally:
npm run devAfter a few seconds, you should see output like:
ready - started server on http://localhost:3000Open http://localhost:3000Â in your browser. You will see the Prodly landing page.
6. First User Becomes Admin Automatically
The database schema includes a special mechanism that grants administrator privileges to the very first user who registers. Hereâs how it works:
-
A trigger on the
user_profilestable runs before a new row is inserted. -
It calls a function
handle_first_user_admin()that checks if any user profile already exists in the table. -
If no profiles exist (i.e., this is the first user), the function sets
is_admin = TRUEfor the new profile. -
All subsequent users will have
is_admin = FALSEby default.
What this means for you:
-
After applying the schema, register immediately â the account you create will become the administrator.
-
You can then access the admin panel at
http://localhost:3000/adminwith full privileges. -
No manual SQL updates are required for the first user.
If you already have users in your database before adding the trigger (for example, if you ran the schema without the trigger or created users earlier), the automatic mechanism wonât apply. In that case, you can manually promote a user to admin using the following SQL (replace user@example.com with the actual email):
UPDATE user_profiles
SET is_admin = true
WHERE id = (SELECT id FROM auth.users WHERE email = 'user@example.com');7. Verify Everything Works
-
Register a new user account.
-
Check that you can generate a description (trial generation).
-
Verify that your credits are deducted correctly.
-
If youâve set up Stripe, test a payment using Stripe test cards.
đ Troubleshooting Local Installation
| Problem | Solution |
|---|---|
| npm install fails | Make sure you have Node.js 18+ installed. Delete node_modules and package-lock.json, then run npm install again. |
| Database connection error | Doubleâcheck your Supabase URL and keys in .env.local. Ensure your Supabase project allows connections from your IP (by default it does, but check network restrictions). |
| Missing environment variable error | Verify that all required variables are set in .env.local. Refer to the Environment Setup guide for a complete list. |
| Port 3000 already in use | Either stop the process using that port or start the app on a different port: npm run dev -- -p 3001 |
| License key invalid | Ensure the LICENSE_KEY in your .env.local matches the one you received. Contact support if the issue persists. |
Next Steps
Once your local installation is running smoothly, you can:
-
Explore the codebase and start customizing.
-
Set up Stripe for payments (see Stripe Setup).
-
Deploy the application to production (see Deploy on Vercel).
Happy coding!