This is a boilerplate for building serverless microservices using the Serverless Framework.
Boilerplate was created as a public version of main repository. Repository will be forked to private repository and used as a base for a commercial project.
- Monorepo: all services are in the same repository
- TypeScript
- Serverless Framework
- Serverless Offline
- Cloud MongoDB
- Events Service - Event entity CRUD, using Cloud MongoDB and API_KEY authorization
- Parser Prototype Service - an example of
core/adapters/event.adapter.ts
usage
Private services are added to .gitignore by mask *-private-service
and not included into public repository.
core
- shared codecore/models
- shared modelscore/adapters
- shared adaptersservices
- servicesservices/<service-name>/src
- service source codeservices/<service-name>/src/handlers
- service handlersservices/<service-name>/src/utils
- service utilsservices/<service-name>/serverless.yml
- service configuration
The following SSM parameters are passed to environment variables in the serverless.yml files:
/event-service/${opt:stage, self:provider.stage}/mongo-uri
- MongoDB connection string/event-service/${opt:stage, self:provider.stage}/api-key
- API key for the Events Service/event-service/${opt:stage, self:provider.stage}/api-url
- API URL for the Events Service
- API Gateway
- Add event bus, e.g. SNS
- Emit event creation event
- Next.js frontend or static site generator
- Add CI/CD