This is an unofficial starter turborepo for serverless + typescript.
Don't be fooled by it's name, it's simply a contraction of turborepo
and serverless
.
This turborepo uses pnpm as a packages manager. It includes the following packages/apps:
eslint-config-custom
:eslint
configurations (includeseslint-config-prettier
)tsconfig
:tsconfig.json
s used throughout the monorepo
Each package is 100% TypeScript.
api1
: serverless service to say hello.api2
: serverless service to say ciao.
Run pnpm dev
to run in offline mode (from the service or the root level).
This turborepo has some additional tools already setup for you:
- TypeScript for static type checking
- ESLint for code linting
- Prettier for code formatting
- Github Actions for CI.
- vitest for testing.
To build all apps and packages, run the following command:
cd my-turborepo
pnpm run build
To develop all apps and packages, run the following command:
cd my-turborepo
pnpm run dev
This template uses vitest as a testing framework.
cd my-turborepo
pnpm test # to run the tests, with coverage
pnpm test:watch # to run tests in watch mode
Make sure to have AWS_PROFILE
set up to the aws profile you want to deploy with. Otherwise the command will fail.
Run aws configure list-profiles
to see your profiles available.
This template simulates two environments (staging and production):
cd my-turborepo
AWS_PROFILE=<aws_profile> pnpm deploy:staging
AWS_PROFILE=<aws_profile> pnpm deploy:production
Feel free to open a PR, file an issue. I'll happily look into it.
See Remote Caching (Beta) for more info.
- clone this repo, or use it as template.
- install pnpm for package management.
- install the dependencies:
pnpm i
. - build and run the services:
pnpm build && pnpm dev
. - send first request:
curl -X POST http://localhost:3000/dev/hello -H "Content-Type: application/json" -d '{"name": "World"}'
{ "message": "Hello World !" }
curl -X POST http://localhost:4000/dev/ciao -H "Content-Type: application/json" -d '{"name": "world"}'
{ "message": "Ciao World !" }
These are a list of features in the pipeline:
- documentation and guidelines on how to add a new api or service.
- automatic changelog generation and release of packages with
changesets
. - auto-linting and formatting on save for faster development.
- automatic deployment when merging to main.
- website for documentation.