https://github.com/encoredev/encore Skip to content Sign up Sign up * Why GitHub? Features - + Mobile - + Actions - + Codespaces - + Packages - + Security - + Code review - + Project management - + Integrations - + GitHub Sponsors - + Customer stories- * Team * Enterprise * Explore + Explore GitHub - Learn and contribute + Topics - + Collections - + Trending - + Learning Lab - + Open source guides - Connect with others + The ReadME Project - + Events - + Community forum - + GitHub Education - + GitHub Stars program - * Marketplace * Pricing Plans - + Compare plans - + Contact Sales - + Education - [ ] [search-key] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this organization All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up Sign up {{ message }} encoredev / encore * Notifications * Star 889 * Fork 13 The Go backend framework with superpowers encore.dev MPL-2.0 License 889 stars 13 forks Star Notifications * Code * Issues 3 * Pull requests 1 * Discussions * Actions * Security * Insights More * Code * Issues * Pull requests * Discussions * Actions * Security * Insights main Switch branches/tags [ ] Branches Tags Nothing to show {{ refName }} default View all branches Nothing to show {{ refName }} default View all tags 1 branch 1 tag Go to file Code Clone HTTPS GitHub CLI [https://github.com/e] Use Git or checkout with SVN using the web URL. [gh repo clone encore] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching Xcode If nothing happens, download Xcode and try again. Go back Launching Visual Studio If nothing happens, download the GitHub extension for Visual Studio and try again. Go back Latest commit @eandre eandre README: tweak title ... 1df6e06 Apr 14, 2021 README: tweak title 1df6e06 Git stats * 50 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github/workflows Move to encore-go v0.9.6 Mar 26, 2021 cli cli/daemon/run: fix panic when racing with proc start Apr 13, 2021 compiler compiler/runtime/storage/sqldb: bump MaxConns Apr 10, 2021 parser parser: fix mistaking method call for API call Apr 14, 2021 pkg Add HTTP tracing Mar 25, 2021 proto Add HTTP tracing Mar 26, 2021 .gitignore Add windows build Mar 8, 2021 CODE_OF_CONDUCT.md Add code of conduct Mar 26, 2021 DEVELOPING.md README: add additional examples Apr 12, 2021 LICENSE Add LICENSE Mar 26, 2021 README.md README: tweak title Apr 14, 2021 go.mod Initial commit Mar 7, 2021 go.sum Initial commit Mar 7, 2021 View code Encore - Go framework for building distributed systems Quick Start Install Create your app Deploy Setup Demo Superpowers Using Encore Creating a service with an API Calling an API endpoint SQL Databases Database Demo API Documentation Distributed Tracing Developing Encore and building from source Questions & Feedback README.md Encore - Go framework for building distributed systems [68747470733a2f2f656e636f7] https://encore.dev Encore is a Go backend framework for rapidly creating APIs and distributed systems. It uses static analysis and code generation to reduce the boilerplate you have to write, resulting in an extremely productive developer experience. The key features of Encore are: * No boilerplate: Encore drastically reduces the boilerplate needed to set up a production ready backend application. Define backend services, API endpoints, and call APIs with a single line of Go code. * Distributed Tracing: Encore uses a combination of static analysis and code generation to automatically instrument your application for excellent observability. Automatically captures information about API calls, goroutines, HTTP requests, database queries, and more. Automatically works for local development as well as in production. * Infrastructure Provisioning: Encore understands how your application works, and uses that understanding to provision and manage your cloud infrastructure. Automatically works with all the major cloud providers, as well as for local development. * Simple Secrets: Encore makes it easy to store and securely use secrets and API keys. Never worry about how to store and get access to secret values again. * API Documentation: Encore parses your source code to understand the request/response schemas for all your APIs. Encore can automatically generate high-quality, interactive API Documentation for you. It can also automatically generate type-safe, documented clients for your frontends. Read the complete documentation at encore.dev/docs. Quick Start Install # macOS brew install encoredev/tap/encore # Linux curl -L https://encore.dev/install.sh | bash # Windows iwr https://encore.dev/install.ps1 | iex Create your app encore app create my-app cd my-app encore run Deploy git push encore Setup Demo Setup demo Superpowers Encore comes with tons of superpowers that radically simplify backend development compared to traditional frameworks: * A state of the art developer experience with unmatched productivity * Define services, APIs, and make API calls with a single line of Go code * Autocomplete and get compile-time checks for API calls * Generates beautiful API docs and API clients automatically * Instruments your app with Distributed Tracing, logs, and metrics - automatically * Runs serverlessly on Encore's cloud, or deploys to your own favorite cloud * Sets up dedicated Preview Environments for your pull requests * Supports flexible authentication * Manages your databases and migrates them automatically * Provides an extremely simple yet secure secrets management * And lots more... Using Encore Encore makes it super easy to create backend services and APIs. Creating a service with an API In Encore, a backend service is just a regular Go package with one or more APIs defined. The Go package name becomes the service name (which must be unique within your app). package greet import ( "context" "fmt" ) type Params struct { Name string } type Response struct { Message string } //encore:api public func Person(ctx context.Context, params *Params) (*Response, error) { msg := fmt.Sprintf("Hello, %s!", params.Name) return &Response{Message: msg}, nil } This creates a backend service named greet, with a single API endpoint named Person. Calling it is easy: $ encore run # run the app in a separate terminal $ curl http://localhost:4060/greet.Person -d '{"Name": "Jane"}' # Outputs: {"Message": "Hello, Jane!"} Learn more in the Encore docs. Calling an API endpoint Calling an API endpoint from another endpoint is easy. Just import the service (with a regular Go import), and then call the function as if it were a regular Go function: import "my.app/greet" func MyAPI(ctx context.Context) error { resp, err := greet.Person(ctx, &greet.Params{Name: "John"}) if err != nil { return err } fmt.Println("The greeting message is:", resp.Message) return nil } Encore uses its static analysis and code generation to turn this into a proper API call. Learn more in the Encore docs. SQL Databases Encore automatically provisions, connects to, and performs schema migrations of SQL databases for you. All you have to do is define the SQL migrations: -- greet/migrations/1_create_table.up.sql CREATE TABLE person ( name TEXT PRIMARY KEY, count INT NOT NULL ); Then import encore.dev/storage/sqldb and just start querying: // genGreeting generates a personalized greeting for the given name. func genGreeting(ctx context.Context, name string) (string, error) { var count int // Insert the row, and increment count if the row is already in the db. err := sqldb.QueryRow(ctx, ` INSERT INTO "person" (name, count) VALUES ($1, 1) ON CONFLICT (name) DO UPDATE SET count = person.count + 1 RETURNING count `, name).Scan(&count) if err != nil { return "", err } switch count { case 1: return fmt.Sprintf("Nice to meet you, %s!", name), nil case 2: return fmt.Sprintf("Hi again, %s!", name), nil default: return fmt.Sprintf("Good to see you, %s! We've met %d times before.", name, count-1), nil } } Database Demo Setting up a database Learn more in the Encore docs. API Documentation Encore automatically generates API documentation for your app. You can access it by viewing the local development dashboard by opening the API URL in your browser when your app is running (normally localhost:4060). API Documentation Distributed Tracing Encore automatically instruments your app with Distributed Tracing. For local development you can access it by viewing the local development dashboard by opening the API URL in your browser when your app is running (normally localhost:4060). Any API calls to your app automatically produces traces. Automatic Tracing Developing Encore and building from source See DEVELOPING.md. Questions & Feedback If you have questions, need help, or have any feedback: email us hello@encore.dev or join our Slack channel. About The Go backend framework with superpowers encore.dev Topics go api microservices framework backend encore Resources Readme License MPL-2.0 License Releases 1 tags Packages 0 No packages published Contributors 2 * @eandre eandre Andre Eriksson * @marcuskohlberg marcuskohlberg Marcus Kohlberg Languages * Go 74.6% * TypeScript 21.8% * CSS 3.1% * Batchfile 0.4% * Shell 0.1% * HTML 0.0% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.