Server Configuration
Application environment modeExample:
production or developmentControls CORS settings, static file serving, and other environment-specific behaviors.Server port numberExample:
3000The port on which the backend server will listen. Defaults to 3000 if not specified.Database Configuration
MongoDB connection stringExample:
mongodb+srv://username:password@cluster.mongodb.net/donpalitojr?retryWrites=true&w=majorityFull MongoDB connection URL. For production, use MongoDB Atlas. The connection is established in backend/src/config/db.js.Authentication (Clerk)
Don Palito Jr uses Clerk for authentication. You need to create a Clerk account and application at clerk.com.Clerk publishable API keyExample:
pk_test_... or pk_live_...Public key used by frontend applications to initialize Clerk.Clerk secret API keyExample:
sk_test_... or sk_live_...Secret key used by backend to verify authentication tokens. Keep this secure.Clerk webhook signing secretExample:
whsec_...Used to verify webhook requests from Clerk for user sync operations. Found in your Clerk dashboard under Webhooks.The backend listens for Clerk webhooks at
/api/webhooks/clerk to sync user data with MongoDB. Configure this endpoint in your Clerk dashboard.Background Jobs (Inngest)
Inngest handles background job processing for user synchronization and email sending.Inngest signing key for secure event processingExample:
signkey-prod-...Get this from your Inngest dashboard at inngest.com. The Inngest endpoint is exposed at /api/inngest.File Storage (Cloudinary)
Cloudinary is used for product image uploads and management.Your Cloudinary cloud nameExample:
dxyz123abcFound in your Cloudinary dashboard.Cloudinary API keyExample:
123456789012345API credentials from Cloudinary dashboard.Cloudinary API secretExample:
abcdefghijklmnopqrstuvwxyzSecret key for Cloudinary API authentication. Keep this secure.Cloudinary Configuration Code
Cloudinary Configuration Code
The Cloudinary SDK is configured in
backend/src/config/cloudinary.js:Email Service
Email sending is handled through Nodemailer with Gmail SMTP.Gmail address for sending emailsExample:
yourbusiness@gmail.comThe Gmail account used to send welcome emails and order notifications.Gmail app passwordExample:
abcd efgh ijkl mnopUse an App Password, not your regular Gmail password. Generate one at Google Account Security.Payment Processing (Stripe)
Stripe handles all payment transactions.Stripe secret keyExample:
sk_test_... or sk_live_...Backend secret key for processing payments. Use test keys for development and live keys for production.Stripe publishable keyExample:
pk_test_... or pk_live_...Public key used by frontend to initialize Stripe checkout.Stripe webhook signing secretExample:
whsec_...Used to verify webhook events from Stripe. Configure webhook endpoint at /api/payment/webhook in your Stripe dashboard.The payment webhook at
/api/payment/webhook uses raw body parsing as required by Stripe. See backend/src/server.js:61-71 for the implementation.Application Branding
These variables customize the application’s appearance and business information.Application display nameExample:
Don Palito JrUsed in emails and throughout the application.URL to your company logoExample:
https://res.cloudinary.com/yourcloud/image/upload/logo.pngUsed in email templates and branding.Legal company nameExample:
Don Palito Jr S.A.S.Used in invoices and receipts.Tax identification numberExample:
900123456-7Company tax ID used in invoices.Company physical addressExample:
Calle 123 #45-67Used in invoices and order documentation.Company cityExample:
Bogotá, ColombiaCity where the business is located.Company contact phone numberExample:
+57 300 123 4567Customer service phone number.Client Configuration
Frontend application URLExample:
https://www.donpalitojr.com or http://localhost:5173Used for CORS configuration in production. In production mode, only this origin is allowed. In development, multiple localhost ports are permitted.CORS Configuration
CORS Configuration
The server configures CORS differently based on environment:See
backend/src/server.js:26-57 for full implementation.Example .env File
Create a.env file in the backend/ directory:
Environment Variable Loading
Environment variables are loaded usingdotenv in backend/src/config/env.js: