Configuration

Reference

Configuration

ChatCart has two kinds of settings: environment variables in .env.local for the server, and admin settings for everything that belongs to a store. All .env* files except .env.example are ignored by git.

Core

Variable Required Description
MONGODB_URI Yes The MongoDB connection string, local or Atlas. Example: mongodb://127.0.0.1:27017/chatcart.
JWT_SECRET Yes Signs admin and customer logins. At least 16 characters; 32 or more is recommended.
APP_URL Recommended Your public address, such as https://shop.example.com. Used for the full links in the sitemap and robots file.
UPLOAD_DIR No The folder where uploaded images are saved and served from. Default: public/uploads. On a server, use a folder outside the app.
NEXTAUTH_SECRET No Another name for JWT_SECRET. If both are set, JWT_SECRET is used.
NEXT_PUBLIC_DEMO_MODE No For a public online demo only. Leave it empty in your own install.
The app never connects to the database during npm run build. If the database is missing or cannot be reached while the app runs, pages show a friendly message instead of crashing.

Admin account (used by the scripts only)

npm run seed and npm run create-admin read these. The app itself does not.

Variable Description
ADMIN_NAME The owner's display name. When empty: Admin (create-admin) or Demo Owner (seed).
ADMIN_EMAIL The owner's email. When empty, create-admin asks for it, and the seed uses [email protected].
ADMIN_PASSWORD The owner's password. When empty, create-admin asks for it, and the seed uses the public demo password ChangeMe123!. create-admin refuses the demo passwords.
SEED_WHATSAPP_NUMBER Gives both demo stores this WhatsApp number instead of the placeholders, so test orders reach your phone.

Image uploads

Images you upload in the admin (products, categories, blog covers, banners, logo, favicon) are saved on the server and served at /uploads/<file> by the app itself, so they work after npm run build with no rebuild. JPEG, PNG, WebP, GIF and AVIF are accepted, up to 5 MB each. Each file is checked by its content, not its name. SVG is refused because it can carry scripts.

Serverless hosts such as Vercel and Netlify delete files between deployments. There, host your images elsewhere and use their HTTPS links (the product CSV import accepts any HTTPS image URL), or deploy to a VPS with a fixed UPLOAD_DIR.

Store settings in the admin

Display currencies: shoppers can switch the currency they see, using the rates you enter. Orders are always placed in the store currency. A new store starts with English and USD.

Theming: the brand color and corner radius are applied as CSS variables (--primary, --brand, --ring, --radius) on every request. Anything beyond these two settings is in app/globals.css.