Skip to content

getdokan/dokan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Dokan Multivendor Marketplace

dokan

Welcome to the Dokan Multivendor Marketplace repository on GitHub!

Dokan is the ultimate frontend multivendor marketplace plugin for WordPress, powered by WooCommerce, helping you build your own multivendor marketplace similar to Amazon, Shopify, eBay, and Magento.

Here you can find the source code, open issues, and contribute to the development of the Dokan plugin.

We recommend all developers to follow the Dokan blog to stay up to date about everything happening in the project. You can also follow @DokanTweets on X for the latest development updates.

πŸš€ Getting Started

To get up and running with Dokan development, you will need to make sure that you have installed all of the prerequisites.

πŸ“‹ Prerequisites

  • Node.js (>= 20.x): We recommend using NVM (Node Version Manager) to ensure you're using the correct version of Node.
  • npm: Used to manage project dependencies and run various scripts involved in building and testing the project.
  • PHP 7.4+: Dokan currently features a minimum PHP version of 7.4. It is also needed to run Composer and various project build scripts.
  • Composer: We use Composer to manage all of the dependencies for PHP packages and plugins.
  • WordPress: A working WordPress installation with WooCommerce activated.
  • WooCommerce: Dokan is built on top of WooCommerce and requires it to function.

Once you've installed all of the prerequisites, the following will prepare all of the build outputs necessary for development:

# Navigate to the Dokan plugin directory
cd wp-content/plugins/dokan-lite

# Install the PHP dependencies
composer install && composer du -o

# Install the npm dependencies
npm install

# OR build for production
npm run build

# Build the assets in development mode with watch
npm run start

πŸ“ Repository Architecture

Dokan follows a structured organization to make development and contribution easier:

dokan-lite/
β”œβ”€β”€ πŸ“‚ assets/             # Contains all the frontend and admin assets.
β”‚   β”œβ”€β”€ css/               # CSS stylesheets.
β”‚   β”œβ”€β”€ js/                # JavaScript files.
β”‚   β”œβ”€β”€ images/            # Image assets.
β”‚   β”œβ”€β”€ src/               # Source files for the style, script and other frontend codes.
β”‚   └── ...                # Rest of the files.
β”œβ”€β”€ πŸ“‚ includes/           # Core PHP files that power the plugin functionality.
β”‚   β”œβ”€β”€ Admin/             # Admin-specific code.
β”‚   β”œβ”€β”€ functions.php      # Global functions.
β”‚   └── ...                # Rest of the core functionality files.
β”œβ”€β”€ πŸ“‚ templates/          # Frontend template files.
β”‚   β”œβ”€β”€ dashboard/         # Vendor dashboard templates.
β”‚   β”œβ”€β”€ global/            # Vendor global templates.
β”‚   β”œβ”€β”€ emails/            # Email templates.
β”‚   β”œβ”€β”€ settings/          # Vendor settings templates.
β”‚   └── ...                # Rest of the templates.
β”œβ”€β”€ πŸ“‚ tests/              # Test suites.
β”‚   β”œβ”€β”€ php/               # PHPUnit tests.
β”‚   └── pw/                # Playwrite tests.
β”œβ”€β”€ πŸ“‚ src/                # Source files for react, vue frontend codes.
β”‚   β”œβ”€β”€ admin/             # Admin frontend codes.
β”‚   β”œβ”€β”€ components/        # Global components for reactive frontend.
β”‚   β”œβ”€β”€ hooks/             # Hooks for reactive frontend.
β”‚   └── utilities/         # Utilitiy functions for reactive frontend.
β”œβ”€β”€ πŸ“‚ lib/                # Third-party libraries and dependencies.
β”œβ”€β”€ πŸ“‚ docs/               # Documentation files.
└── πŸ“‚ languages/          # Translation files.

πŸ“š Developer Documentation

Dokan provides comprehensive documentation to help developers understand the codebase, architecture, and extend or customize the plugin effectively.

The documentation is available in the docs directory:

  • Admin Setup Guide: Dokan admin configuration, setup pages, fields, and administrative documentation.
  • Vendor Analytics: Dokan analytics reports, vendor comprehensive analytics info for vendor insights.
  • API: Dokan REST API standard documentation.
  • Feature Override: Frontend template customization guide and override documentation.
  • Slots: Frontend slot system documentation.
  • TDD: Dokan TDD practices, testing frameworks documentation for Dokan development.
  • Container: Dokan container documentation.
  • Coupon: Dokan coupon workflow, implementation flowchart & system documentation.

Scripts

NPM Scripts

Dokan includes several npm scripts to help with development:

Command Purpose
npm run start Development build with watch mode.
npm run start:hot Development with hot module replacement.
npm run build Production build.
npm run makepot Generates the POT file for translations.
npm run format Formats code according to WordPress coding standards.
npm run lint:css Lints CSS files.
npm run lint:js Lints JavaScript files.
npm run release Prepares a full release package.

Composer Scripts

Dokan also provides Composer scripts for PHP development:

Command Purpose
composer phpcs Runs PHP CodeSniffer to check coding standards.
composer phpcs:report Generates a PHP CodeSniffer report file.
composer phpcbf Automatically fixes coding standard violations where possible.
composer test Runs PHPUnit tests.
composer test-f Runs specific PHPUnit tests (requires filter parameter).

πŸ§ͺ Testing

Dokan follows Test Driven Development (TDD) practices to ensure code quality and reliability. The repository includes comprehensive documentation and resources for testing in the docs/tdd directory:

To run tests, you can use the Composer scripts mentioned above or run PHPUnit directly:

# Run all tests
./vendor/bin/phpunit

# Run tests with a specific filter
./vendor/bin/phpunit --filter=test_name

πŸ›‘ Reporting Security Issues

To disclose a security issue to our team, please submit a report via our contact form.

πŸ’¬ Support

This repository is not suitable for support. Please don't use our issue tracker for support requests, but for core Dokan issues only. Support can take place through the appropriate channels:

πŸ“ž Community

For peer to peer support and discussions:

🀝 Contributing to Dokan

Community contributions are always welcomed and help us remain the Number 1 Multivendor Marketplace plugin for WordPress. As an open source project, we rely on community contributions to continue to improve Dokan. Feel free to answer questions on GitHub and within the various Dokan communities.

There are many ways to contribute to Dokan:

Contribution Guidelines

Please read our Contribution Guidelines to learn the best practices for contributing to Dokan.

πŸ› Bug Report

If you found a bug in the source code and can reproduce it consistently after troubleshooting it, you can help us by submitting a Bug Report.

Even better, you can submit a Pull Request with a fix, and we will happily review it.

When submitting pull requests, please ensure you follow our commit message and contribution guidelines.

Additionally, include the Needs: Dev Review and Needs: Testing labels for progress tracking.

✨ Feature Request

Do you have a brilliant idea, enhancement, or feature you would love to see in Dokan? We're all ears!

Suggest new ideas, features, or enhancements by submitting a Feature Request. You can also support existing ideas by voting for your favorite requests.

🌐 Translate

The Dokan User Interface was designed with a global audience in mind. It supports a wide range of languages and is also RTL compatible.

Want to make a difference?

We would appreciate your contribution by adding a new language or helping translate existing ones at translate.wordpress.org.