### Start React UI Development Server
Source: https://traggo.net/dev/setup
Start the React UI development server. Commands must be executed from within the 'ui' directory. The UI will be available on localhost:3000.
```bash
$ yarn start
```
--------------------------------
### Install Project Dependencies
Source: https://traggo.net/dev/setup
Install all necessary Go and Yarn dependencies for the project. This command handles both backend and frontend dependencies.
```bash
# make install
```
--------------------------------
### Run Traggo Server with Docker
Source: https://traggo.net/install
Start the traggo/server Docker container. Mount a volume for data persistence and map the default port. Ensure to configure the admin password before starting.
```bash
$ docker run -p 80:3030 -v /opt/traggo/data:/opt/traggo/data traggo/server:latest
```
--------------------------------
### Start traggo Server
Source: https://traggo.net/dev/setup
Start the traggo server. By default, it runs in development mode and listens on localhost:3030.
```bash
$ go run main.go
```
--------------------------------
### Traggo Server Configuration Properties
Source: https://traggo.net/config
These are example configuration properties for traggo/server. Uncomment and set them to customize server behavior. Ensure values like log level and database dialect are valid.
```ini
# the port the http server should use
# TRAGGO_PORT=3030
# default username and password
# TRAGGO_DEFAULT_USER_NAME=admin
# TRAGGO_DEFAULT_USER_PASS=admin
# bcrypt password strength (higher = more secure but also slower)
# TRAGGO_PASS_STRENGTH=10
# how verbose traggo/server should log (must be one of: debug, info, warn, error, fatal, panic)
# TRAGGO_LOG_LEVEL=info
# the database dialect (must be one of: sqlite3)
# TRAGGO_DATABASE_DIALECT=sqlite3
# the database connection string, differs depending on the dialect
# sqlite3: path/to/database.db
# TRAGGO_DATABASE_CONNECTION=data/traggo.db
```
--------------------------------
### Configure Traggo Server with Docker Compose
Source: https://traggo.net/install
Define Traggo server service in a docker-compose.yml file. This example sets the admin username, password, and maps a local directory for data storage.
```yaml
version: "3.7"
services:
traggo:
image: traggo/server:latest
ports:
- 3030:3030
environment:
TRAGGO_DEFAULT_USER_NAME: "admin"
TRAGGO_DEFAULT_USER_PASS: "mynewpassword"
volumes:
- ./traggodata:/opt/traggo/data
```
--------------------------------
### Download Development Tools
Source: https://traggo.net/dev/setup
Download essential tools for code formatting and linting. This command should be run once to set up your environment.
```bash
$ make download-tools
```
--------------------------------
### Format Code
Source: https://traggo.net/dev/setup
Format all server and UI code according to project standards. Run this command to ensure consistent code style.
```bash
$ make format
```
--------------------------------
### Build traggo/server Locally
Source: https://traggo.net/dev/build
Use this command to build the traggo/server binary directly on your local machine without using Docker. Ensure your development environment is set up.
```bash
$ make build-bin-local
```
--------------------------------
### Build traggo/server with Docker
Source: https://traggo.net/dev/build
Recommended method for building traggo/server. This ensures all required tools, including cross-compilers for various platforms, are available within the traggo/build Docker images.
```bash
# builds all supported platforms
$ make build-bin
```
```bash
# builds a specific platform
# available suffixes
# * linux-amd64
# * linux-386
# * linux-arm-7
# * linux-arm64
# * linux-ppc64le
# * linux-s390x
# * windows-amd64
# * windows-386
# Build bin
$ make build-bin-SUFFIX
# Build docker image (requires bin build before)
$ make build-docker-SUFFIX
```
--------------------------------
### Make Traggo Server Binary Executable
Source: https://traggo.net/install
Grant execute permissions to the traggo-server binary on Linux systems.
```bash
$ chmod +x traggo-server-0.0.9-linux-amd64
```
--------------------------------
### Enable Go Modules
Source: https://traggo.net/dev/setup
Explicitly enable Go modules if you are working within a GOPATH directory. This ensures correct dependency management.
```bash
$ export GO111MODULE=on
```
--------------------------------
### Download Traggo Server Binary
Source: https://traggo.net/install
Download the traggo-server binary for Linux amd64 using wget. Ensure you download the correct version for your platform from the releases page.
```bash
$ wget https://github.com/traggo/server/releases/download/v0.0.9/traggo-server-0.0.9-linux-amd64.zip
```
--------------------------------
### Execute Traggo Server Binary
Source: https://traggo.net/install
Run the traggo-server executable on a 64-bit Linux server. The server defaults to port 3030. Consider changing the default admin password.
```bash
$ sudo ./traggo-0.0.9-linux-amd64
```
--------------------------------
### Unzip Traggo Server Binary
Source: https://traggo.net/install
Extract the downloaded traggo-server zip archive to access the executable binary.
```bash
$ unzip traggo-server-0.0.9-linux-amd64.zip
```
--------------------------------
### Generate Code from GraphQL Schema
Source: https://traggo.net/dev/setup
Execute code generation for server models and resolvers based on the schema.graphql file. This command must be run after any changes to the schema.
```bash
$ make generate
```
--------------------------------
### Clone traggo/server Repository
Source: https://traggo.net/dev/setup
Clone the server source code from GitHub. This command also navigates into the cloned directory.
```bash
$ git clone https://github.com/traggo/server.git && cd server
```
--------------------------------
### Run Linters
Source: https://traggo.net/dev/setup
Execute all configured linters to check for code quality and potential issues. This command helps maintain code health.
```bash
$ make lint
```
--------------------------------
### Caddy 2: Proxy to Domain Root
Source: https://traggo.net/reverse-proxy
Configure Caddy 2 to proxy requests from the domain root to Traggo. This is a simple and concise configuration.
```caddy
http://domain.tld {
reverse_proxy localhost:3030
}
```
--------------------------------
### Caddy 2: Proxy to Domain Sub Path
Source: https://traggo.net/reverse-proxy
Configure Caddy 2 to proxy requests from a sub path (e.g., /traggo/) to Traggo. It uses 'route' to strip the prefix and 'redir' for the trailing slash.
```caddy
http://domain.tld {
route /traggo/* {
uri strip_prefix /traggo
reverse_proxy localhost:3030
}
redir /traggo /traggo/
}
```
--------------------------------
### Apache: Proxy to Domain Root
Source: https://traggo.net/reverse-proxy
Configure Apache's VirtualHost to proxy requests from the domain root to Traggo. Ensure 'mod_proxy' and 'mod_proxy_http' are enabled.
```apache
# If you're on localhost:
# ServerName localhost
ServerName domain.tld
Keepalive On
ProxyPass "/" http://localhost:3030/ retry=0 timeout=5
ProxyPassReverse / http://localhost:3030/
```
--------------------------------
### Apache: Proxy to Domain Sub Path
Source: https://traggo.net/reverse-proxy
Configure Apache's VirtualHost to proxy requests from a sub path (e.g., /traggo/) to Traggo. A trailing slash on the ProxyPass directive is required.
```apache
# If you're on localhost:
# ServerName localhost
ServerName domain.tld
Keepalive On
ProxyPass "/traggo/" http://localhost:3030/ retry=0 timeout=5
# ^- !!trailing slash is required!!
ProxyPassReverse "/traggo/" http://localhost:3030/
```
--------------------------------
### Nginx: Proxy to Domain Root
Source: https://traggo.net/reverse-proxy
Configure Nginx to proxy requests from the domain root to Traggo. Ensure Traggo is running on the specified port.
```nginx
upstream traggo {
# Set the port to the one you are using in traggo
server localhost:3030;
}
server {
listen 80;
# If you're on localhost:
# server_name localhost;
server_name localhost;
location / {
proxy_pass http://traggo;
}
}
```
--------------------------------
### Nginx: Proxy to Domain Sub Path
Source: https://traggo.net/reverse-proxy
Configure Nginx to proxy requests from a sub path (e.g., /traggo/) to Traggo. The rewrite directive is used to strip the prefix before forwarding.
```nginx
upstream traggo {
# Set the port to the one you are using in traggo
server localhost:3030;
}
server {
listen 80;
# If you're on localhost:
# server_name localhost;
server_name domain.tld;
location /traggo/ {
proxy_pass http://traggo;
rewrite ^/traggo(/.*) $1 break;
}
}
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.