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.
Root Directory Layout
Here’s the complete structure of an EverShop application:Important: Never modify files in
.evershop/ or node_modules/. These directories are auto-generated.Extension Structure
Extensions contain all business logic for your application. Here’s the detailed structure:Example: Sample Extension
Extension Directory Breakdown
Extension Directory Breakdown
REST API endpoints with route configurationStructure:
api/[endpointName]/route.json- Defines HTTP methods, path, and access control[middleware]handler.ts- Request handlers with middleware chain
React page components for admin or frontStoreStructure:
pages/[area]/[pageName]/ComponentName.tsx- Exports default component,
layout, and optionallyquery
GraphQL type definitions and resolversStructure:
graphql/types/[TypeName]/TypeName.graphql- Schema definitionTypeName.resolvers.js- Query/mutation resolvers
Event handlers that respond to system eventsStructure:
subscribers/[event_name]/handler.tsScheduled background jobsStructure:
crons/jobName.ts- Registered in
bootstrap.ts
Extension initialization file that runs on startup
- Register cron jobs
- Set up database connections
- Configure services
Real Example: API Endpoint
Here’s how the sample extension defines a REST API:The
[bodyParser] prefix means this middleware runs after the bodyParser middleware in the chain.Theme Structure
Themes handle visual presentation only. They should NOT contain business logic.Example: Anasuplements Theme
Theme Page Areas
Theme Page Areas
Components that appear on every pageExamples:
- Header navigation
- Footer
- Cookie consent banners
Components for account-related pagesExamples:
- Login forms
- Registration
- Dashboard
Components for the homepage onlyExamples:
- Hero sections
- Featured products
- Promotional banners
Real Example: Header Component
themes/anasuplements/src/pages/all/Header.tsx
The theme uses custom colors (
#2D5A3D for primary green) defined in the design system.File Naming Conventions
API Endpoints
- Middleware prefix
[name]determines execution order - Alphabetical sorting:
[authenticate]runs before[bodyParser] - The final handler typically has the endpoint name
Page Components
- Use PascalCase for component files
- Area determines where component renders:
all,frontStore,admin,account - Must export default function and
layoutobject
GraphQL Types
Subscribers
Cron Jobs
TypeScript Configuration
Both extensions and themes use TypeScript:extensions/sample/tsconfig.json
Extensions and themes are compiled separately during the build process.
Package Structure
Root Package
package.json
Extension Package
extensions/sample/package.json
Theme Package
themes/anasuplements/package.json
Static Assets
Place public files in thepublic/ directory:
Files in
public/ are served at the root URL. For example, public/favicon.ico is accessible at /favicon.ico.Translations
Store internationalization files intranslations/:
Build Output
During build, EverShop generates:Working with Structure
Next Steps
Configuration System
Learn how config files control extensions and themes
Create Extension
Build your first custom extension