Skip to content

Getting started

Backend installation

The backend is a Symfony application using Doctrine ORM, EasyAdmin, LexikJWTAuthenticationBundle, Gesdinet JWT Refresh Token Bundle, Stripe, Pusher, and Webpack Encore.

For buyer-friendly production setup, use the browser installer at /install. The command-line steps below are still useful for developers and advanced deployments.

Server requirements

Recommended production requirements:

  • PHP 8.4 or newer.
  • Composer.
  • MySQL 8 or MariaDB 10.6 or newer.
  • Node.js and npm for building frontend assets.
  • A web server such as Nginx or Apache.
  • HTTPS certificate for production.
  • Writable var/, upload, and JWT key directories.

Symfony CLI is useful for local development, but it is not required for production.

Install dependencies

From the backend project root:

composer install
npm ci
npm run build

To run the backend in Docker instead, see Docker deployment. To set up a client's production instance step by step, see New client instance.

For local development, you can use:

npm run dev

or:

npm run watch

Environment configuration

Create a local environment file:

cp .env .env.local

Then configure the required values:

APP_ENV=dev
APP_SECRET=change_me
DATABASE_URL="mysql://user:password@127.0.0.1:3306/onlyparcels?serverVersion=8.0.32&charset=utf8mb4"

JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
JWT_PASSPHRASE=change_me

Never commit production secrets to source control. Backend Stripe credentials and mail credentials are not configured in environment files; add them from the admin panel after the admin user is created.

Generate JWT keys

The login API needs JWT keys. Generate them before testing API login:

php bin/console lexik:jwt:generate-keypair --skip-if-exists

If the JWT passphrase in .env.local does not match the generated private key, login can fail with:

An error occurred while trying to encode the JWT token.

Regenerate the key pair or update JWT_PASSPHRASE so the values match.

Create database tables

On a new, empty database, create the schema and the reference data (currencies, parcel sizes and weights, pickup time windows, settings) in one step. The browser installer does the same.

php bin/console app:database:install

The migrations only describe changes to an existing database, so they can't build one from scratch. Use them to update an installed instance:

php bin/console doctrine:migrations:migrate

Vendor types, cities and further countries are created in the admin panel. The platform's own country is added when the installer saves the platform settings.

Create an admin user

Create the first admin user with:

php bin/console app:admin:create-user admin@example.com strong-password

After this, visit:

/admin/login

Start local development server

If Symfony CLI is installed:

symfony serve

If the command is not found, install Symfony CLI or use PHP's built-in server for a quick local check:

php -S 127.0.0.1:8000 -t public

The Symfony CLI is recommended because it handles local certificates and Symfony server integration more comfortably.

Production web root

For production hosting, point the web server document root to:

public/

Do not expose the project root, .env files, config/, src/, or var/ directly through the web server.

Found a mistake? Tell us.