Proxima Backend
Proxima is a Remainder Application, like many others, which primarily uses Discord to deliver the remainders to the user.
It provides an API interface to be embedded in other services, using Bearer Token Authentication.
This is the source code for the backend application.
This backend handles all the data managment and provides the API interface for the clients to be used.
This backend application is intended to be run as a docker container, see below.
For more details, see: Proxima -> Backend
Main Technologies used
- PHP 8.4+
- composer
- Laravel 11+
- Sanctum
- Livevire
- Filament 3+
- Scribe
- and many more...
What is needed to run the backend
- A working docker instance with compose.
Runninig with docker
Follow these easy steps to setup and run the backend application:
Note
The program inside the container is running under a non-privileged user with
UID:1000andGID:1000.The database file/folder must be writable for that user!
In the example we just make it writable to everyone (please use proper access control instead!)
Or jou can build your own image with different
UID/GIDvalues.
1. Create the directory structure (bash):
mkdir -p volumes/backend/{database,env}
2. Update directory permissions to allow write access to the restricted docker user
chmod o+w volumes/backend/database
3. (OPTIONAL) If you already have a working database file, you can copy it to the app:
cp PATH/TO/DATABASE/<database.sqlite> volumes/backend/database/
chmod o+w volumes/backend/database/database.sqlite
4. Create the .env.config file from src/.env.example file.
wget -O volumes/backend/env/.env.config https://proxima.goliath.hu/proxima/backend/raw/branch/main/src/.env.example
-OR-
curl -f -o volumes/backend/env/.env.config https://proxima.goliath.hu/proxima/backend/raw/branch/main/src/.env.example
5. Customize the .env.config file.
Note
: The program creates its own
.envfile based on the.env.configfile.
If you modify your.env.configfile, simply restart the container and the new settings will take effect immediately.
nano volumes/backend/env/.env.config
-
Replace or fill in the following values (after the "=" sign)
- APP_NAME - The application's name
defualt: "Backend" - APP_TIMEZONE - The application's timezone
default: "UTC" - APP_URL - The application's url
default: "localhost:9000" - ADMIN_EMAIL - The admin email for the backend
default: "admin@example.com" - ADMIN_PASSWORD - The admin password for the backend
default: "PlEaSe_ChAnGe_Me"
- APP_NAME - The application's name
6.1 Run with docker
docker run \
-it \
--rm \
--name "proxima-backend" \
-v "./volumes/backend/env/.env.config:/app/Backend/.env.config" \
-v "./volumes/backend/database/:/app/Backend/database/sqlite/" \
-p "9000:9000" \
git.magrathea.hu/proxima/backend:latest
6.2 Running with docker compose
6.2.1 Create docker compose file docker-compose.yaml:
---
services:
backend:
image: proxima.goliath.hu/proxima/backend:latest
container_name: backend
ports:
- "9000:9000"
volumes:
- "./volumes/backend/env/.env.config:/app/Backend/.env.config"
- "./volumes/backend/database/:/app/Backend/database/sqlite/"
restart: unless-stopped
6.2.2 Start up service
docker compose up -d
6.3 You can watch the logs of the application
docker compose logs -f