storyschematics

package module
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2025 License: AGPL-3.0 Imports: 0 Imported by: 0

README

Story-Schematics service

X (formerly Twitter) Follow Discord


GitHub go.mod Go version GitHub repo file or directory count GitHub code size in bytes

GitHub Actions Workflow Status Go Report Card codecov

Coverage graph


This is a quickstart document to test the project locally.

You can find the API documentation on the repository GitHub page.

Want to contribute? Check the contribution guidelines.

Use in a project

You can import this application as a docker image. Below is an example using podman compose.

services:
  json-keys-postgres:
    image: docker.io/library/postgres:17
    networks:
      - api
    environment:
      POSTGRES_PASSWORD: postgres
      POSTGRES_USER: postgres
      POSTGRES_DB: json-keys
      POSTGRES_HOST_AUTH_METHOD: scram-sha-256
      POSTGRES_INITDB_ARGS: --auth=scram-sha-256
    volumes:
      - json-keys-postgres-data:/var/lib/postgresql/data/

  story-schematics-postgres:
    image: docker.io/library/postgres:17
    networks:
      - api
    environment:
      POSTGRES_PASSWORD: postgres
      POSTGRES_USER: postgres
      POSTGRES_DB: story-schematics
      POSTGRES_HOST_AUTH_METHOD: scram-sha-256
      POSTGRES_INITDB_ARGS: --auth=scram-sha-256
    volumes:
      - story-schematics-postgres-data:/var/lib/postgresql/data/

  json-keys-service:
    image: ghcr.io/a-novel/service-json-keys/standalone:v0
    depends_on:
      - json-keys-postgres
    ports:
      # Expose the service on port 4001 on the local machine.
      - "4021:8080"
    environment:
      PORT: 8080
      ENV: local
      APP_NAME: json-keys-service
      DSN: postgres://postgres:postgres@json-keys-postgres:5432/json-keys?sslmode=disable
      # Dummy key used only for local environment. Consider using a secure, private key in production.
      MASTER_KEY: fec0681a2f57242211c559ca347721766f8a3acd8ed2e63b36b3768051c702ca
      # Used for tracing purposes, can be omitted.
      # SENTRY_DSN: [your_sentry_dsn]
      # SERVER_NAME: json-keys-service-prod
      # RELEASE: v0.1.2
      # Set the following if you want to debug the service locally.
      # DEBUG: true
    networks:
      - api

  story-schematics-service:
    image: ghcr.io/a-novel/service-story-schematics/api:v0
    depends_on:
      - story-schematics-postgres
      - json-keys-service
    ports:
      # Expose the service on port 4001 on the local machine.
      - "4001:8080"
    environment:
      PORT: 8080
      ENV: local
      APP_NAME: story-schematics-service
      DSN: postgres://postgres:postgres@story-schematics-postgres:5432/story-schematics?sslmode=disable
      # In sandbox mode, mails are logged in the server logs rather than being sent. Alternatively, you need to provide
      # a valid SMTP server configuration.
      SMTP_SANDBOX: true
      # SMTP_PASSWORD: your_smtp_password
      # SMTP_SENDER: noreply@agoradesecrivains.com
      # SMTP_DOMAIN: smtp-relay.gmail.com
      # SMTP_ADDRESS: smtp-relay.gmail.com:587
      AUTH_PLATFORM_URL_UPDATE_EMAIL: http://localhost:4001/update-email
      AUTH_PLATFORM_URL_UPDATE_PASSWORD: http://localhost:4001/update-password
      AUTH_PLATFORM_URL_REGISTER: http://localhost:4001/register
      # Used for tracing purposes, can be omitted.
      # SENTRY_DSN: [your_sentry_dsn]
      # SERVER_NAME: story-schematics-service-prod
      # RELEASE: v0.1.2
      # Set the following if you want to debug the service locally.
      # DEBUG: true
    networks:
      - api

networks:
  api: {}

volumes:
  story-schematics-postgres-data:
  json-keys-postgres-data:

Available tags includes:

  • latest: latest versioned image
  • vx: versioned images, pointing to a specific version. Partial versions are supported. When provided, the latest subversion is used.
    examples: v0, v0.1, v0.1.2
  • branch: get the latest version pushed to a branch. Any valid branch name can be used.
    examples: master, fix/something

Run locally

Pre-requisites

  • Golang

  • Node.js

  • Python

    • Install pipx to install command-line tools.
  • Podman

    • Install podman-compose

      # Pipx
      pipx install podman-compose
      
      # Brew
      brew install podman-compose
      
  • Make

    # Debian / Ubuntu
    sudo apt-get install build-essential
    
    # macOS
    brew install make
    

    For Windows, you can use Make for Windows

Setup environment

Create a .envrc file from the template:

cp .envrc.template .envrc

Then fill the missing secret variables. Once your file is ready:

source .envrc

You may use tools such as direnv, otherwise you'll need to source the env file on each new terminal session.

Install the external dependencies:

make install

Run infrastructure

make run-infra
# To turn down:
# make run-infra-down

You may skip this step if you already have the global infrastructure running.

Et Voilà!

make run-api

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
api command
internal
api
api/codegen
Code generated by ogen, DO NOT EDIT.
Code generated by ogen, DO NOT EDIT.
dao
lib

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL