zplex-api is a Spring Boot–based backend service that powers the Zplex platform.
It provides authentication, user management, and integrations with external services like PostgreSQL, Redis, and
Google Drive.
- Secure authentication with JWT
- Admin user bootstrap
- PostgreSQL persistence
- Redis caching
- Configurable via environment variables
- Java 21+
- Maven 3.9+
- PostgreSQL
- Redis
The application is configured through environment variables and Spring Boot properties.
Below are the required parameters:
| Variable | Description | Example |
|---|---|---|
ADMIN_PASSWORD |
Password for the default admin account. | admin123 |
SECRET_KEY |
256-bit secret key for signing JWT tokens. | supersecretkey123... |
| Variable | Description | Example |
|---|---|---|
ZPLEX_DATABASE_URL |
Database URL without jdbc: prefix. |
postgresql://localhost:5432/zplex |
ZPLEX_DATABASE_USERNAME |
Database username. | zplex_user |
ZPLEX_DATABASE_PASSWORD |
Database password. | mypassword |
Spring Boot Properties (auto-configured in application.properties):
spring.datasource.url=jdbc:${ZPLEX_DATABASE_URL}?sslmode=require
spring.datasource.username=${ZPLEX_DATABASE_USERNAME}
spring.datasource.password=${ZPLEX_DATABASE_PASSWORD}
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialectRefer to zplex-stream
| Variable | Description | Example |
|---|---|---|
ZPLEX_STREAM_HOST |
Public URL of your deployed zplex-stream. | https://zplex-stream.**.workers.dev |
| Variable | Description | Example |
|---|---|---|
REDIS_HOST |
Redis hostname. | redis |
REDIS_PORT |
Redis port. | 6379 |
REDIS_USERNAME |
Redis username. | default |
REDIS_PASSWORD |
Redis password. | mypassword |
git clone https://github.com/<your-username>/zplex-api.git
cd zplex-apiCreate a .env file (or export vars manually):
ADMIN_PASSWORD=sirzechs
SECRET_KEY=supersecretkey256bit
ZPLEX_DATABASE_URL=postgresql://localhost:5432/zplex
ZPLEX_DATABASE_USERNAME=zplex_user
ZPLEX_DATABASE_PASSWORD=mypassword
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_USERNAME=default
REDIS_PASSWORD=mypassword
ZPLEX_STREAM_HOST=https://zplex-stream.**.workers.dev./mvnw clean package
java -jar api/target/zplex-api-1.0.0.jar --server.port=62942Run directly with Maven:
./mvnw spring-boot:run -pl api