Project Board: https://github.com/users/evantahler/projects/1/views/1
This project aims to be a "modern" rewrite of the "full" ActionHero stack. It is a template for a new project, and is not yet feature complete. It is a work in progress.
I still believe in many of the ideas of Actionhero, which itself was an attempt to take the "best" ideas from Rails and and Node.js and shove them together.
ah-sequelize-plugin
, which adds Sequelize to the mix; optionally using SQLite locally)ah-next-plugin
, which adds Next.js to the mix)To install dependencies:
bun install
brew install caddy
To run:
# one-time env setup
cp .env.example .env
createdb bun
# run the proxy, frontened, and backend
bun dev # this will hot-reload the server when server files change
To test:
# one time db setup
createdb bun-test
# run the tests
bun test
# run a single test file
cd backend
bun test __tests__/actions/user.test.ts
# run all all the stuff that CI does
bun test # from the root
To lint:
# To test
bun lint
# To Fix
bun pretty
# pre-compile the front-end and backend
bun prepare
# in .env, set NODE_ENV=production and set next.dev=false
bun start
This project uses Drizzle as the ORM. Migrations are derived from the schemas. To create a migration from changes in scheams/*.ts
run bun run migrations.ts
. Then, restart the server - pending migrations are auto-applied.
Unlike Actionhero, we've removed the distinction between Actions, CLI commands, and Tasks. They are all the same thing now! You can run any action from the CLI, and any action can be scheduled as a task. Each action gains a type
property to define its purpose. The same input validation and responses are used for each, just like how Actions work for both web and websocket requests.
Run an action from the CLI:
# I like using -q (hide logging output) and then piping the response through jq
./actionhero.ts "user:create" --name evan --email "[email protected]" --password password -q | jq
# use the --help flag to learn more
Multiple Applications + Proxy
Actions, Tasks, and CLI Commands
Process
Logger
Config
logger.level.test
trumps logger.level
when NDOE_ENV=test.)Middleware
Routes
routes.ts
)CLI
Testing
fetch
included, it's easy.ORM
React and Frontend