Skip to content
Snippets Groups Projects
Commit 971b1a8d authored by Tuan Hoang Dinh Anh's avatar Tuan Hoang Dinh Anh
Browse files

init commit

parents
No related branches found
No related tags found
No related merge requests found
# Env name
ENV=dev
# Main port of frontend
CLIENT_PORT=3000
# Main port of backend
KONG_PROXY_PORT=9800
# Frontend URL
CLIENT_BASE_URL=http://localhost:3000
# Port number
MONGO_EXPOSE_PORT=27019
KONG_ADMIN_PORT=9851
# URL of the Mongo DB
MONGODB_URL=mongodb://playground-db:27017/playground-be
UPLOAD_PORT=9810
# Volume path to store uploaded files
UPLOAD_PATH=/opt/data/playground/upload
# Upload domain
UPLOAD_DOMAIN=http://your_backend_domain/v2/file/
# JWT secret key
JWT_SECRET=your_very_secure_secret_key
JWT_ACCESS_EXPIRATION_MINUTES=1440
JWT_REFRESH_EXPIRATION_DAYS=30
JWT_RESET_PASSWORD_EXPIRATION_MINUTES=10
JWT_VERIFY_EMAIL_EXPIRATION_MINUTES=10
# Cookie settings
JWT_COOKIE_NAME=playground-token
JWT_COOKIE_DOMAIN=.
CACHE_BASE_URL=https://cache.digitalauto.tech
LOG_BASE_URL=https://logs.digitalauto.tech
BREVO_API_KEY=your_brevo_api_key
BREVO_BASE_URL=https://api.brevo.com/v3
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
# Certivity
CERTIVITY_CLIENT_ID=your_certivity_client_id
CERTIVITY_CLIENT_SECRET=your_certivity_client_secret
\ No newline at end of file
.env
\ No newline at end of file
# Setting Up Your Own Playground Instance
## Overview
The **playground.digital.auto** is an open, web-based prototyping environment designed for developing **Software-Defined Vehicle (SDV)** solutions.
The playground consists of two primary components:
- **Frontend**: [GitLab autowrx frontend](https://gitlab.eclipse.org/eclipse/autowrx/autowrx)
- **Backend**: [GitLab autowrx backend-core](https://gitlab.eclipse.org/eclipse/autowrx/backend-core)
All services run entirely within Docker containers.
![Architecture](https://bewebstudio.digitalauto.tech/data/projects/nTcRsgxcDWgr/instance_setup/Architecture.jpg)
## Installation
### Using Docker
1. Clone the repository:
```bash
git clone <url>
```
2. Navigate to the project folder:
```bash
cd playground
```
3. Set up environment variables:
- Create `.env` file from `.env.example` template:
```bash
cp .env.example .env
```
- Open `.env` and update the required environment variables as needed.
4. Start the services with Docker Compose
```bash
docker compose up -d
```
services:
playground-fe:
container_name: playground-fe
image: boschvn/playground-fe
ports:
- "${CLIENT_PORT:-3000}:80"
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf
restart: always
kong:
platform: linux/amd64
image: kong:3.7.1-ubuntu
container_name: playground-kong
environment:
KONG_ADMIN_ACCESS_LOG: /dev/stdout
KONG_ADMIN_ERROR_LOG: /dev/stderr
KONG_PROXY_ACCESS_LOG: /dev/stdout
KONG_PROXY_ERROR_LOG: /dev/stderr
KONG_DATABASE: "off"
KONG_DECLARATIVE_CONFIG: /kong/declarative/kong.yml
ports:
- "${KONG_PROXY_PORT}:8000"
restart: ${RESTART_POLICY:-always}
networks:
- node-network
volumes:
- "./:/kong/declarative/"
depends_on:
- playground-be
playground-be:
platform: linux/amd64
container_name: playground-be
image: boschvn/playground-be:fdc937c
env_file:
- .env
depends_on:
- playground-db
- upload
networks:
- node-network
restart: ${RESTART_POLICY:-always}
command: yarn start
playground-db:
container_name: playground-db
image: mongo:4.4.6-bionic
volumes:
- dbdata:/data/db
networks:
- node-network
restart: ${RESTART_POLICY:-always}
upload:
platform: linux/amd64
container_name: playground-upload
image: boschvn/upload:1b88570
env_file:
- .env
volumes:
- '${UPLOAD_PATH}:/usr/src/upload/data'
networks:
- node-network
restart: ${RESTART_POLICY:-always}
command: npm run prod
volumes:
dbdata:
networks:
node-network:
driver: bridge
kong.yml 0 → 100644
_format_version: "3.0"
_transform: true
services:
- host: playground-be
name: main
port: 8080
protocol: http
routes:
- name: main_route
methods:
- GET
- PUT
- POST
- PATCH
- DELETE
- OPTIONS
- HEAD
- CONNECT
- TRACE
read_timeout: 180000
plugins:
- name: rate-limiting
enabled: true
protocols:
- grpc
- grpcs
- http
- https
config:
fault_tolerant: true
hide_client_headers: false
minute: 120
limit_by: header
header_name: x-forwarded-for
policy: local
sync_rate: -1
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment