Skip to Content
Prodly 2.0 is released 🎉
InstallationInstall on Localhost

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 prodly

Replace the URL with the actual repository URL you were provided.

2. Install Dependencies

Install all required packages using npm (or bun):

npm install

This 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
Never commit .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.

  1. Log in to your Supabase Dashboard .

  2. Open your project.

  3. Go to the SQL Editor.

  4. Copy the entire contents of supabase-schema.sql (provided in the project root) and paste it into a new query.

  5. Run the query. This will create all the required tables and set up Row Level Security policies.

If you prefer to run migrations manually, you can also use the Supabase CLI, but the SQL editor is the simplest approach.

5. Start the Development Server

Now you’re ready to launch the application locally:

npm run dev

After a few seconds, you should see output like:

ready - started server on http://localhost:3000

Open 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_profiles table 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 = TRUE for the new profile.

  • All subsequent users will have is_admin = FALSE by default.

What this means for you:

  1. After applying the schema, register immediately – the account you create will become the administrator.

  2. You can then access the admin panel at http://localhost:3000/admin with full privileges.

  3. 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

ProblemSolution
npm install failsMake sure you have Node.js 18+ installed. Delete node_modules and package-lock.json, then run npm install again.
Database connection errorDouble‑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 errorVerify that all required variables are set in .env.local. Refer to the Environment Setup guide for a complete list.
Port 3000 already in useEither stop the process using that port or start the app on a different port: npm run dev -- -p 3001
License key invalidEnsure 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:

Happy coding!

Last updated on