Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/nayalsaurav/Storx/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you through running a full local instance of Storx — complete with Clerk authentication, ImageKit file uploads, and a Neon PostgreSQL database — so you can explore the codebase or develop new features against real services.
1

Clone the repository

Clone the Storx repository from GitHub and navigate into the project directory:
git clone https://github.com/nayalsaurav/Storx.git && cd Storx
2

Install dependencies

Install all project dependencies using your preferred package manager:
npm install
3

Create .env.local

Create a .env.local file in the root of the project and populate it with the following variables. Each service section below explains where to find the values.
.env.local
# Neon PostgreSQL — copy the connection string from your Neon project dashboard
DATABASE_URL=

# Clerk — found in the Clerk dashboard under API Keys
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
CLERK_SECRET_KEY=

# Clerk redirect URLs — these match the Next.js App Router page paths
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/signin
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/signup

# ImageKit — found in the ImageKit dashboard under Developer Options
NEXT_PUBLIC_IMAGEKIT_PUBLIC_KEY=
IMAGEKIT_PRIVATE_KEY=
NEXT_PUBLIC_IMAGEKIT_URL_ENDPOINT=
  • DATABASE_URL — the full Neon connection string (e.g. postgresql://user:pass@host/dbname?sslmode=require)
  • NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY — starts with pk_test_ or pk_live_
  • CLERK_SECRET_KEY — starts with sk_test_ or sk_live_; never expose this in client-side code
  • NEXT_PUBLIC_IMAGEKIT_URL_ENDPOINT — your ImageKit URL endpoint (e.g. https://ik.imagekit.io/your_id)
  • IMAGEKIT_PRIVATE_KEY — the server-side private key from ImageKit; never expose this in client-side code
4

Run database migrations

Apply the Drizzle migrations to your Neon database. This creates the files table with all required columns (id, name, size, type, file_url, thumbnail_url, user_id, parent_id, is_folder, is_starred, is_trash, created_at, updated_at):
npm run db:migrate
A successful run prints:
🚀 Starting migrations...
✅ All migrations completed successfully.
The migration runner reads DATABASE_URL from .env.local and applies SQL files from the ./drizzle folder to the public schema. The migration history is tracked in the __drizzle_migration table.
5

Start the development server

Start the Next.js development server with Turbopack enabled:
npm run dev
Open http://localhost:3000 in your browser. You will land on the Storx home page. Sign up for a new account via /signup to create your first Clerk user and access the dashboard at /dashboard.
For detailed guidance on each environment variable — including how to configure Clerk redirect URLs, ImageKit folder permissions, and Neon connection pooling — see the Self-Hosting page.

Available Scripts

The following scripts are defined in package.json and can be run with npm run <script>:
ScriptCommandDescription
devnext dev --turbopackStart the development server with Turbopack
buildnext buildCreate a production build
startnext startServe the production build locally
lintnext lintRun ESLint across the project
db:pushdrizzle-kit pushPush schema changes directly to the database (no migration file)
db:studiodrizzle-kit studioOpen the Drizzle Studio visual database browser
db:generatedrizzle-kit generateGenerate a new SQL migration file from schema changes
db:migratetsx ./lib/db/migrate.tsApply all pending migrations to the database
formatnpm run format:writeFormat all source files with Prettier

Build docs developers (and LLMs) love