### Copy Environment Configuration File Source: https://github.com/mdrideout/junjo-server/blob/master/README.md This command copies the example environment file (.env.example) to a new file named .env. This new file will be used to configure environment variables such as SESSION_SECRET and ALLOW_ORIGINS for the Junjo Server services. ```bash cp .env.example .env ``` -------------------------------- ### Generate gRPC service code from Protobuf Source: https://github.com/mdrideout/junjo-server/blob/master/backend/README.md The server receives telemetry via gRPC, requiring code generation from .proto files. This command runs the makefile target to generate the gRPC service code, assuming 'protoc' is installed in the development environment. ```bash # Run the makefile to generate the code $ make proto ``` -------------------------------- ### Docker Compose Commands for Development Environment Source: https://github.com/mdrideout/junjo-server/blob/master/README.md Provides essential Docker Compose commands for setting up and tearing down the local development environment. It covers creating a necessary network, launching the frontend and backend services with hot reloading, and cleaning up volumes. Users should ensure the `BUILD_TARGET=development` is set in the `.env` file and be aware of when to use `docker compose down -v`. ```bash # Create the network (if it does not already exist) $ docker network create caddy-proxy-network # Start the frontend and backend $ docker compose up --build # Close and clear volumes $ docker compose down -v ``` -------------------------------- ### Generate Go code from SQL using sqlc Source: https://github.com/mdrideout/junjo-server/blob/master/backend/README.md This project uses sqlc to compile type-safe Go code from SQL schemas. The following command, executed from the backend directory, generates the necessary Go code. ```bash # Generate GO code from SQL (from ./backend) $ sqlc generate ``` -------------------------------- ### Configure ESLint Type-Aware Parser Options Source: https://github.com/mdrideout/junjo-server/blob/master/frontend/README.md This JavaScript snippet demonstrates how to set up "parserOptions" within an ESLint configuration file ("eslint.config.js") to enable type-aware linting. It specifies the paths to "tsconfig.node.json" and "tsconfig.app.json" for project context and uses "import.meta.dirname" for the root directory. ```js export default tseslint.config({ languageOptions: { // other options... parserOptions: { project: ['./tsconfig.node.json', './tsconfig.app.json'], tsconfigRootDir: import.meta.dirname, }, }, }) ``` -------------------------------- ### Deploy Junjo Server with Docker Compose (Hosted Images) Source: https://github.com/mdrideout/junjo-server/blob/master/README.md This Docker Compose configuration deploys the Junjo Server using pre-built Docker images from Docker Hub. It sets up the backend, frontend, Jaeger for OpenTelemetry tracing, and Caddy as a reverse proxy, providing a complete, self-contained production-like environment. ```yaml services: junjo-server-backend: image: mdrideout/junjo-server-backend:latest # Or specify a version like: v1.2.0 container_name: junjo-server-backend restart: unless-stopped volumes: - ./dbdata/sqlite:/dbdata/sqlite - ./dbdata/duckdb:/dbdata/duckdb ports: - "1323:1323" - "50051:50051" networks: - junjo-network env_file: - .env healthcheck: test: ["CMD", "curl", "-f", "http://localhost:1323/ping"] interval: 5s timeout: 3s retries: 25 start_period: 5s junjo-server-frontend: image: mdrideout/junjo-server-frontend:latest # Or specify a version like: v1.2.0 container_name: junjo-server-frontend restart: unless-stopped ports: - "5153:80" # Exposed port to Nginx mapping networks: - junjo-network depends_on: junjo-server-backend: condition: service_healthy junjo-jaeger: image: jaegertracing/jaeger:2.3.0 container_name: junjo-jaeger restart: unless-stopped volumes: - ./jaeger/config.yml:/jaeger/config.yml # You may need to create this file - jaeger_badger_store:/data/jaeger/badger/jaeger - jaeger_badger_store_archive:/data/jaeger/badger/jaeger_archive command: --config /jaeger/config.yml user: root # Currently requires root for writing to the vol (track: https://github.com/jaegertracing/jaeger/issues/6458) networks: - junjo-network caddy: image: caddy:2-alpine container_name: junjo-caddy restart: unless-stopped ports: - "80:80" # For HTTP -> HTTPS redirect - "443:443" # For HTTPS volumes: - ./Caddyfile:/etc/caddy/Caddyfile # You will need to provide your own Caddyfile - caddy_data:/data # Persist Caddy data (certificates) - caddy_config:/config # Persist Caddy config networks: - junjo-network depends_on: - junjo-server-backend - junjo-server-frontend - junjo-jaeger volumes: jaeger_badger_store: jaeger_badger_store_archive: caddy_data: caddy_config: networks: junjo-network: # Allow these services to communicate with each other driver: bridge # Network option if you want to use an existing shared server network # networks: # your-network: # external: true # not coupled to this compose file ``` -------------------------------- ### Integrate eslint-plugin-react in ESLint Configuration Source: https://github.com/mdrideout/junjo-server/blob/master/frontend/README.md This JavaScript code shows how to integrate "eslint-plugin-react" into an ESLint configuration. It involves importing the plugin, setting the React version in "settings.react.version", adding the plugin to the "plugins" object, and enabling its recommended rules, including those for JSX runtime. ```js // eslint.config.js import react from 'eslint-plugin-react' export default tseslint.config({ // Set the react version settings: { react: { version: '18.3' } }, plugins: { // Add the react plugin react, }, rules: { // other rules... // Enable its recommended rules ...react.configs.recommended.rules, ...react.configs['jsx-runtime'].rules, }, }) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.