Daniel-Garmig 1051921a20 Small Changes:
- Config Vars - Added config variable "CompanyLogoSize" to set the logo size in the frontend.
- API - Prices - Fixed returned string for invalid date periods.
2025-10-13 14:39:01 +02:00
2024-09-12 19:15:14 +02:00
2025-06-05 21:07:14 +02:00
2024-04-17 23:33:50 +02:00
2025-06-05 21:07:14 +02:00
2025-06-05 21:07:18 +02:00
2025-06-05 21:07:14 +02:00
2025-10-13 14:39:01 +02:00
2025-06-05 21:07:14 +02:00
2024-04-17 23:20:02 +02:00
2025-05-30 20:25:43 +02:00
2024-04-17 23:20:02 +02:00
2025-06-05 21:07:18 +02:00
2025-06-05 21:07:18 +02:00
2025-05-30 20:25:43 +02:00
2024-09-12 20:06:22 +02:00
2024-09-09 09:39:57 +02:00
2025-06-05 21:07:14 +02:00

SomniaRooms

A Hotel Room booking system.

Powered by:

  • PHP Symfony.
  • Easyadmin.

Get started:

Dev commands

Build containers:

docker compose build --no-cache

Start Containers:

docker compose up --pull always -d --wait
docker compose --env-file .\.env.local up -d --wait

Stop containers

docker compose down --remove-orphans

To use xdebug in VSCode you may need to configure some environment vars. A .env file (.env.local) can be used as:

XDEBUG_MODE=develop,debug
XDEBUG_DISCOVER_CLIENT_HOST=1
XDEBUG_IDEKEY=docker
XDEBUG_LOG=/dev/stdout

Production commands:

When deploying to a production environment a production build should be used. Then, deployment can be done as containers or using docker-compose.

Build Prod image

To build a production image:

docker build -t somniarooms:prod --target frankenphp_prod .

Deploy prod image

You may use a env file to configure the SomniaRoom container (.env.prod.local):

SERVER_NAME=localhost
DATABASE_URL=postgresql://app:!ChangeMe!@somniadb:5432/somniarooms?serverVersion=16&charset=utf8
APP_SECRET=MYSECRET
MERCURE_PUBLISHER_JWT_KEY=MYCADDY_MERCURE_JWT_SECRET
MERCURE_SUBSCRIBER_JWT_KEY=MYCADDY_MERCURE_JWT_SECRET
FRANKENPHP_CONFIG="" #-> Avoid using FrankenPHP workers, as don't play well with Easyadmin.

You need a database for using SomniaRooms. To run one on a container you can use this that match this example config:

docker run -d --name somniarooms-db --hostname somniadb -p 5432:5432 --env=POSTGRES_DB=somniarooms --env=POSTGRES_PASSWORD=!ChangeMe! --env=POSTGRES_USER=app --env=PGDATA=/var/lib/postgresql/data --volume=somniarooms_db:/var/lib/postgresql/data --network somniarooms-network postgres:16-alpine

Then SomniaRooms can be deployed on a container (change --env-file value to the created file):

docker run -d -it -p 80:80 -p 443:443 --name somniarooms --env-file ./env.prod.local somniarooms:prod

When deploying to prod is recomended to mount some directories as a docker volume or hostpath. This makes sure data is preserved after deleting the container.

  • Image directory (/app/public/images)
  • Logs (/somnia_logs)

If you are deploying your DB as a container, check the database docs and make sure database data won't be lost when updating or deleting the container. This example configuration store postgress data on a unnamed docket volume.

docker run -d -it -p 80:80 -p 443:443 --name somniarooms --env-file ./.env.prod.local --volume=somniarooms_images:/app/public/images:rw --network somniarooms-network somniarooms:prod

If you want your app and DB to comunicate using it's hostname (like on this example) you should create a docker network.

docker network create somniarooms-network

Check deploy docs for complete examples on how to deploy SomniaRooms (backend+frontend) using Docker and Docker-compose.

Examples shown on deploy docs may be out-of-date. Make sure all readme recommendations are applied before use on production.

Running the app!

Go to the app address (https://localhost) and it will show Symfony welcome page (or a error when running on prod).

Go to addres https://localhost/setup to inicialize app users and data.

During setup you must configure the admin account. If you check "Add example data" you will be redirected to example data setup. Example data can be added anytime at https://localhost/debug/exampleData. There is needed to use a Superadmin account.

Then, you the admin panel is at https://localhost/admin

Logs.

By default logs are saved to /app/var/log on an unamed container volume. For development, /app/var/log directory is mounted to ./var/log on the local filesystem.

This config can be overriden setting a different mount for /app/var/log when creating the containers.

S
Description
Hotel Room booking system
Readme AGPL-3.0
1.1 MiB
Languages
PHP 92.4%
Twig 5%
Dockerfile 1.1%
Shell 1%
CSS 0.4%
Other 0.1%