
An opinionated productive web framework that helps scaling business easier, i.e. focus on monolith first, only move to microservices with GRPC later on when your team is ready.
Click to see an application called "appist" made with "appy" in action
<img width="48%" alt="Debug Mode" src="https://github.com/appable-run/appy/raw/v0.1.2/github/assets/debug.gif">
<img width="48%" alt="Release Mode" src="https://github.com/appable-run/appy/raw/v0.1.2/github/assets/release.gif">
appy is made as a package for your application to import without the need to install any additional binaryappy glues the great packages to provide best productivity in developing Go web applicationappy comes with 2 build types:appy follows 12factor via APPY_ENV environment variable:developmentAPPY_ENV=staging is set, the config file is configs/.env.stagingconfigs/.env.<APPY_ENV> to support multiple environments deploymentcmdmailerpackrecordviewworker
cmdClick to see details
```bash My first awesome web application in Go.
Usage: myapp [command]
Available Commands:
build Compile the static assets into go files and build the release build binary (only available in debug build)
config:dec Decrypt a config value using the secret in configs/<APPY_ENV>.key or APPY_MASTER_KEY (only available in debug build)
config:enc Encrypt a config value using the secret in configs/<APPY_ENV>.key or APPY_MASTER_KEY (only available in debug build)
db:create Create all databases for the current environment
db:drop Drop all databases for the current environment
db:migrate Migrate the database(default: all, use --database to specify the target database) for the current environment
db:migrate:status List all the database migration status(default: all, use --database to specify the target database) for the current environment
db:rollback Rollback the database(default: primary, use --database to specify the target database) to previous version for the current environment
db:schema:dump Dump all the databases schema for the current environment (only available in debug build)
db:schema:load Load all the databases schema for the current environment
db:seed Seed all databases for the current environment
dc:down Tear down the docker compose cluster
dc:restart Restart services that are defined in docker-compose.yml
dc:up Create and start containers that are defined in docker-compose.yml
gen:migration Generate database migration file(default: primary, use --database to specify the target database) for the current environment (only available in debug build)
help Help about any command
middleware List all the global middleware
routes List all the server-side routes
secret Generate a cryptographically secure secret key for encrypting cookie, CSRF token and config
secret:rotate Rotate the secret that is used to encrypt/decrypt the configs (only available in debug build)
serve Run the HTTP/HTTPS web server without webpack-dev-server
setup Run dc:up/db:create/db:schema:load/db:seed to setup the datastore with seed data
ssl:setup Generate and install the locally trusted SSL certs using mkcert
ssl:teardown Uninstall the locally trusted SSL certs using mkcert
start Run the HTTP/HTTPS web server with webpack-dev-server in development watch mode (only available in debug build)
teardown Tear down the docker compose cluster
work Run the worker to process background jobs
Flags: -h, --help help for myapp -v, --version version for myapp
Use "myapp [command] --help" for more information about a command. ```
mailerReady-to-use SMTP email sending
I18n support
HTML templates binary embed support
Developer friendly email preview UI
Click to see details
<img height="450px" alt="Preview UI" src="https://github.com/appable-run/appy/raw/v0.1.2/github/assets/mailer_preview_ui.png" />
packClick to see details
API Only
Remove Set-Cookie response header if the X-API-ONLY: 1 request header is sent.
CSRF
Protect cookies from Cross-Site Request Forgery by including/validating a token in the cookie across requests.
GZIP Compress
Compress the responses before returning it to the clients.
Health Check
Provide the HTTP GET endpoint for health check purpose.
I18n
Provide I18n support which the translations are stored in <PROJECT_NAME>/pkg/locales/*.yml.
Logger
Provide logger support.
Mailer
Provide mailer support which the views templates are stored in <PROJECT_NAME>/pkg/views/mailers/**/*.{html,txt}.
Prerender
Prerender and return the SPA page rendered by Chrome if the HTTP request is coming from the search engines.
Real IP
Retrieves the client's real IP address via X-FORWARDED-FOR or X-REAL-IP HTTP request header.
Recovery
Recover the HTTP request from panic and return 500 error page.
Request ID
Generate UUID v4 string for every HTTP request.
Request Logger
Log the HTTP request information.
Secure
Provide the standard HTTP security guards.
Session
Provide session management using cookie/redis.
SPA
Provide SPA hosting with specific path.
View Engine
Provide server-side HTML template rendering.
Fully integrated with gqlgen with watch mode
Ready-to-use test context builder for unit test
recordClick to see details
bash
db:create Create all databases for the current environment
db:drop Drop all databases for the current environment
db:migrate Migrate the database(default: all, use --database to specify the target database) for the current environment
db:migrate:status List all the database migration status(default: all, use --database to specify the target database) for the current environment
db:rollback Rollback the database(default: primary, use --database to specify the target database) to previous version for the current environment
db:schema:dump Dump all the databases schema for the current environment (only available in debug build)
db:schema:load Load all the databases schema for the current environment
db:seed Seed all databases for the current environment
Extended sql.DB with sqlx
Fully featured ORM
Click to see details
Validations with I18n support
Performant ORM
Click to see details
bash
go test -run=NONE -bench . -benchmem -benchtime 10s -failfast ./record
goos: darwin
goarch: amd64
pkg: github.com/appist/appy/record
BenchmarkInsertRaw-4 1239 10103533 ns/op 88 B/op 5 allocs/op
BenchmarkInsertDB-4 898 11351591 ns/op 1548 B/op 19 allocs/op
BenchmarkInsertORM-4 826 13826999 ns/op 15338 B/op 283 allocs/op
BenchmarkInsertMultiRaw-4 529 21830643 ns/op 107896 B/op 415 allocs/op
BenchmarkInsertMultiDB-4 481 20931749 ns/op 166302 B/op 441 allocs/op
BenchmarkInsertMultiORM-4 471 23261618 ns/op 791677 B/op 3872 allocs/op
BenchmarkUpdateRaw-4 903 13807008 ns/op 1064 B/op 21 allocs/op
BenchmarkUpdateDB-4 1008 13577352 ns/op 3677 B/op 52 allocs/op
BenchmarkUpdateORM-4 788 13923442 ns/op 8920 B/op 233 allocs/op
BenchmarkReadRaw-4 2162 4723198 ns/op 1810 B/op 47 allocs/op
BenchmarkReadDB-4 2263 5300805 ns/op 3257 B/op 69 allocs/op
BenchmarkReadORM-4 2259 5184327 ns/op 6911 B/op 230 allocs/op
BenchmarkReadSliceRaw-4 2210 5871991 ns/op 23088 B/op 1331 allocs/op
BenchmarkReadSliceDB-4 2197 5752959 ns/op 25070 B/op 1353 allocs/op
BenchmarkReadSliceORM-4 1864 6249231 ns/op 246630 B/op 1526 allocs/op
PASS
ok github.com/appist/appy/record 344.692s
viewPerformant and fully featured template engine
I18n support
HTML templates binary embed support
workerClick to see details
Strict/Weighted priority queues
Ready-to-use handler mock for unit test
$ mkdir <PROJECT_NAME> && cd $_ && go mod init $_ && git init
Note: The must be an alphanumeric string.
main.go with the snippet below.package main
import (
"github.com/appist/appy/cmd"
)
func main() {
err := cmd.Scaffold()
if err != nil {
panic(err)
}
}
$ go run .
$ go run . setup
$ go run . start
Please make sure to read the Contributing Guide before making a pull request.
Thank you to all the people who already contributed to appy!
Copyright (c) 2019-p