Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Antony-Figueroa/my-evershop-app/llms.txt

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

System Requirements

Before installing EverShop, ensure your system meets these requirements:

Runtime

Node.js 18.0 or higher
node --version

Database

PostgreSQL 12.0 or higher
psql --version

Package Manager

npm 9.0 or higher
npm --version

Build Tools

TypeScript 5.9+ (included in devDependencies)

Installation Steps

1

Install Node.js

Download and install Node.js from nodejs.org or use a version manager:
# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash

# Install Node.js 18
nvm install 18
nvm use 18
nvm alias default 18
2

Install PostgreSQL

# Update package list
sudo apt update

# Install PostgreSQL
sudo apt install postgresql postgresql-contrib

# Start PostgreSQL service
sudo systemctl start postgresql
sudo systemctl enable postgresql
3

Create Database

Create a new PostgreSQL database for your store:
# Switch to postgres user
sudo -u postgres psql
-- Create database
CREATE DATABASE evershop;

-- Create user (optional)
CREATE USER evershop_user WITH PASSWORD 'your_secure_password';

-- Grant privileges
GRANT ALL PRIVILEGES ON DATABASE evershop TO evershop_user;

-- Exit
\q
4

Clone or Create Project

If starting from scratch:
# Create project directory
mkdir my-evershop-app
cd my-evershop-app

# Initialize npm project
npm init -y
Or clone existing project:
git clone <your-repository-url>
cd my-evershop-app
5

Install Dependencies

Install all required packages:
npm install
This installs the dependencies from package.json:
{
  "dependencies": {
    "@evershop/evershop": "2.1.1"
  },
  "devDependencies": {
    "@parcel/watcher": "2.5.6",
    "@types/config": "3.3.5",
    "@types/express": "5.0.6",
    "@types/node": "25.3.3",
    "@types/pg": "8.18.0",
    "@types/react": "19.2.14",
    "execa": "9.6.1",
    "typescript": "5.9.3"
  }
}
6

Configure Environment

Create a .env file in the project root:
# Database Configuration
DB_HOST=localhost
DB_PORT=5432
DB_NAME=evershop
DB_USER=evershop_user
DB_PASSWORD=your_secure_password

# Server Configuration
NODE_ENV=development
PORT=3000

# Session Secret (generate a random string)
SESSION_SECRET=your_random_session_secret_here

# Admin Credentials (for initial setup)
ADMIN_EMAIL=admin@example.com
ADMIN_PASSWORD=admin123
Security: Never commit .env to version control. It’s already in .gitignore:
# .gitignore
.env
.env.local
.env.*.local
7

Run Initial Setup

Initialize the database and install EverShop:
npm run setup
This command (evershop install) will:
  • Create all database tables
  • Set up initial data and schemas
  • Configure default settings
  • Create admin user
  • Initialize extensions
8

Start Development Server

Launch the application:
npm run dev
The server will start at http://localhost:3000
Development mode includes:
  • Hot module replacement
  • Source maps for debugging
  • Verbose error messages
  • Auto-compilation of TypeScript

Configuration Files

Package Configuration

Your package.json defines the project structure:
{
  "name": "my-evershop-app",
  "version": "0.1.0",
  "type": "module",
  "private": true,
  "scripts": {
    "setup": "evershop install",
    "start": "evershop start",
    "build": "evershop build",
    "dev": "evershop dev"
  }
}
Runs evershop install to initialize the database and system. Use this once during initial installation.
Runs evershop dev to start the development server with hot reload. Use this during development.
Runs evershop build to compile TypeScript and bundle assets for production.
Runs evershop start to start the production server. Run build first.

Store Configuration

The config/default.json file contains base configuration:
{
  "shop": {
    "language": "es",
    "currency": "USD"
  },
  "system": {
    "extensions": [
      {
        "name": "offlinePayments",
        "resolve": "extensions/offlinePayments",
        "enabled": true
      },
      {
        "name": "productCatalog",
        "resolve": "extensions/productCatalog",
        "enabled": true
      },
      {
        "name": "productReviews",
        "resolve": "extensions/productReviews",
        "enabled": true
      }
    ],
    "theme": "anasuplements"
  }
}
Configure store-wide settings:
{
  "shop": {
    "language": "es",      // Store language (es, en, etc.)
    "currency": "USD",     // Default currency
    "timezone": "UTC",     // Store timezone
    "weightUnit": "kg"     // Weight unit (kg, lb)
  }
}

Environment-Specific Configuration

{
  "system": {
    "port": 3000,
    "logLevel": "debug"
  },
  "database": {
    "logging": true
  }
}

Extension Setup

Each extension has its own configuration:

Extension Structure

extensions/productCatalog/
├── src/
   ├── graphql/
   └── types/ProductExtension/
       └── ProductExtension.graphql
   └── pages/
       └── frontStore/productView/
           └── SupplementInfo.tsx
├── package.json
└── tsconfig.json

Extension Package Configuration

{
  "name": "sample-evershop-extension",
  "version": "1.0.0",
  "main": "index.js",
  "type": "module",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "tsc": "tsc"
  }
}

Extension TypeScript Configuration

{
  "compilerOptions": {
    "module": "NodeNext",
    "target": "ES2018",
    "lib": ["dom", "dom.iterable", "esnext"],
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "skipLibCheck": true,
    "declaration": true,
    "sourceMap": true,
    "allowJs": true,
    "checkJs": false,
    "jsx": "react",
    "outDir": "./dist",
    "resolveJsonModule": true,
    "allowSyntheticDefaultImports": true,
    "allowArbitraryExtensions": true,
    "strictNullChecks": true,
    "isolatedModules": false,
    "baseUrl": ".",
    "rootDir": "./src"
  },
  "include": ["src"]
}

Theme Setup

Current Theme: anasuplements

The active theme provides the visual layer:
themes/anasuplements/
├── src/
   └── pages/
       ├── all/              # Global components
   ├── Header.tsx
   └── Footer.tsx
       ├── homepage/         # Homepage components
   ├── Hero.tsx
   ├── Features.tsx
   └── FeaturedProducts.tsx
       └── account/          # Account pages
           ├── Dashboard.tsx
           ├── Login.tsx
           └── Register.tsx
├── package.json
└── tsconfig.json

Theme Configuration

Themes use the same TypeScript configuration as extensions. Each theme component exports:
// Required exports for page components
export default function MyComponent({ props }) {
  return <div>Content</div>;
}

export const layout = {
  areaId: 'content',       // Where to render
  sortOrder: 10            // Rendering order
};

export const query = `    // GraphQL query (optional)
  query {
    data {
      field
    }
  }
`;
Theme components should only contain presentation logic. Business logic belongs in extensions.

Production Deployment

Build for Production

1

Update Production Configuration

Edit config/production.json:
{
  "system": {
    "port": 80,
    "logLevel": "error"
  },
  "shop": {
    "url": "https://yourstore.com"
  }
}
2

Set Environment Variables

Update .env for production:
NODE_ENV=production
DB_HOST=your_production_host
DB_NAME=your_production_db
SESSION_SECRET=your_strong_random_secret
3

Build the Application

Compile all TypeScript and bundle assets:
npm run build
This compiles:
  • All extensions to .evershop/build/extensions/
  • All themes to .evershop/build/themes/
  • Creates optimized production bundles
4

Start Production Server

npm run start
Or use a process manager like PM2:
npm install -g pm2
pm2 start "npm run start" --name evershop
pm2 save
pm2 startup

Production Checklist

  • Strong SESSION_SECRET in .env
  • PostgreSQL users with limited privileges
  • HTTPS enabled (use reverse proxy like Nginx)
  • Firewall configured (only ports 80/443 open)
  • Regular security updates
  • Database connection pooling configured
  • Static assets served via CDN
  • Gzip compression enabled
  • Database indexes optimized
  • Caching strategy implemented
  • Error logging configured
  • Performance monitoring (APM)
  • Database backups automated
  • Uptime monitoring
  • Log rotation configured
  • Load balancer for multiple instances
  • Database read replicas
  • Redis for session storage
  • Message queue for async tasks
  • Auto-scaling configured

Troubleshooting

Problem: Cannot connect to PostgreSQLSolutions:
# Check PostgreSQL is running
sudo systemctl status postgresql

# Verify credentials
psql -h localhost -U evershop_user -d evershop

# Check .env file
cat .env | grep DB_

# Test connection
pg_isready -h localhost -p 5432
Problem: Port 3000 is already occupiedSolutions:
  1. Change port in config/default.json:
{
  "system": {
    "port": 3001
  }
}
  1. Or kill the process using port 3000:
# Find process
lsof -i :3000

# Kill process
kill -9 <PID>
Problem: Extension fails to compileSolutions:
# Navigate to extension
cd extensions/yourExtension

# Check TypeScript config
cat tsconfig.json

# Compile manually to see errors
npx tsc

# Clear build cache
rm -rf dist/
rm -rf ../../.evershop/build/
Problem: Custom extension doesn’t appearSolutions:
  1. Verify registration in config/default.json
  2. Check extension is enabled: "enabled": true
  3. Verify directory structure matches config
  4. Restart development server
  5. Check server logs for errors
Problem: GraphQL types not resolvingSolutions:
# Check .graphql file syntax
cat extensions/yourExt/src/graphql/types/YourType/YourType.graphql

# Verify resolvers exist
cat extensions/yourExt/src/graphql/types/YourType/YourType.resolvers.js

# Rebuild
npm run build

Next Steps

Development Guide

Learn how to build extensions and create custom functionality

Theme Customization

Customize the visual appearance of your store

API Reference

Explore the complete API documentation

GraphQL Schema

Learn about GraphQL types and queries
Additional ResourcesCheck the context/ directory in your project for detailed technical documentation in Spanish, including:
  • Architecture overview
  • Code standards
  • Testing guide
  • Deployment procedures

Build docs developers (and LLMs) love