Effect Examples and Templates

repository·main·Indexed 43 days ago

https://github.com/effect-ts/examples

A collection of official Effect examples and project templates to help developers bootstrap applications. Includes the create-effect-app CLI for initializing projects using templates (basic, monorepo, cli) or official examples like the http-server, with support for Nix flakes, ESLint, and GitHub Actions.

Tokens
9.5K
Snippets
33
Records
43
Agent score
55%

What's inside Effect

  1. Overview of the Effect Monorepo Template - Domain Package

    main
    The domain package is a specialized template within the Effect monorepo structure. It is designed to house the core business logic, domain models, and pure functional logic of an application, isolated from infrastructure concerns like HTTP servers or database implementations. In a typical Effect-based monorepo, this package serves as the single source of truth for domain-driven design (DDD) patterns.
  2. Explore Effect examples

    main

    This repository provides concrete examples to help you understand how to use Effect in real-world scenarios. You can browse them in the repository or clone them directly to your local machine using the create-effect-app CLI tool.

    Available examples:

    • http-server: An HTTP server built with Effect, including authentication and authorization logic.
  3. Use create-effect-app in non-interactive mode

    main

    For automated environments or quick setups, you can use flags to specify templates, examples, and additional project configurations without prompts.

    # Create from a template
    create-effect-app -t basic [project-name]
    
    # Create from an official example
    create-effect-app -e http-server [project-name]
  4. Bootstrap an Effect project with create-effect-app

    main
    The fastest way to start a new project with Effect is using the create-effect-app CLI tool. This tool allows you to bootstrap a project using either official Effect examples or pre-configured project templates. This ensures your environment is pre-configured according to the Effect core team's recommendations.
  5. Use the CLI template for command-line applications

    main

    The cli template is optimized for building command-line applications using Effect CLI. It includes all features of the basic template, but uses a different build pipeline:

    • Bundling: Uses tsup to support bundling the application into a single file.
  6. Use the Monorepo template for multiple packages

    main

    The monorepo template is intended for projects consisting of multiple packages or applications. It includes all features of the basic template, plus:

    • Interdependencies: Pre-configured TypeScript path aliases and project references to manage dependencies between packages within the monorepo.