https://github.com/moduscreateorg/serverless-allthethings
This project and repository is a demonstration of the power of serverless
https://github.com/moduscreateorg/serverless-allthethings
Last synced: 9 months ago
JSON representation
This project and repository is a demonstration of the power of serverless
- Host: GitHub
- URL: https://github.com/moduscreateorg/serverless-allthethings
- Owner: ModusCreateOrg
- License: mit
- Created: 2019-07-05T13:20:05.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-08T14:00:16.000Z (over 2 years ago)
- Last Synced: 2025-01-26T18:27:53.992Z (11 months ago)
- Language: JavaScript
- Homepage: https://moduscreate.com/blog/serverless-allthethings-1/
- Size: 2.52 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 29
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Serverless AllTheThings
[](./LICENSE)
[](https://moduscreate.com)
Serverless software architecture – the golden goose to many and just a fad to others. This controversial architecture hasn’t been around for long and like many software engineers I stumbled upon it when Amazon Web Services (AWS) announced Lambda about 5 years ago… and it was love at first sight.
This project and repository is a demonstration of the power of serverless and is meant to accompany the [Modus Create serverless blog series](https://moduscreate.com/blog/serverless-allthethings-1/ "Modus Create Serverless Blog Series").
- [Installation](#installation)
- [Getting Started](#getting-started)
- [Build the Docker image](#build-the-docker-image)
- [Run a command on the Docker image](#run-a-command-on-the-docker-image)
- [Install dependencies](#install-dependencies)
- [Start](#start)
- [Lint](#lint)
- [Test](#test)
- [Interactive](#interactive)
- [Modus Create](#modus-create)
- [Licensing](#licensing)
## Installation
1. Install [git](https://git-scm.com "Git")
- Recommended installation notes:
- Linux: install via a native package management tool, e.g. [apt](https://help.ubuntu.com/lts/serverguide/apt.html.en "Advanced Packaging Tool")
- MacOS: install via [Xcode](https://developer.apple.com/xcode/ "Xcode") command line tools (`$ xcode-select --install`) or install [Xcode](https://developer.apple.com/xcode/ "Xcode") (via the [Mac App Store](https://developer.apple.com/app-store/mac/ "Mac App Store"))
- Windows: install via a [Bash](https://www.gnu.org/software/bash/ "Bash")-like environment, e.g. [Git for Windows](https://gitforwindows.org "Git for Windows")
- Confirm installation via the following command: `$ git --version`
2. Install [Docker](https://docs.docker.com/install/ "Docker Installation Guide")
3. [Create a global .gitignore](https://help.github.com/articles/ignoring-files/#create-a-global-gitignore "How to create a global .gitignore")
- Note: It is bad practice to include operating system and IDE lines in a project's .gitignore _unless they are required by the project_. This project does not require a specific operating system nor IDE so ensure your global .gitignore includes lines for all files relevant to your [operating system(s) and IDE(s)](https://github.com/github/gitignore "GitHub example .gitignore files")
4. Clone the repository
```bash
git clone git@github.com:ModusCreateOrg/serverless-allthethings.git
```
5. Change your current directory to the local clone of the repository
```bash
cd serverless-allthethings
```
6. Build the Docker image (see below)
7. Install dependencies (see below)
8. Deploy Support CloudFormation Stack (see below)
9. (If forked: ) Integrate [Travis](https://travis-ci.com/ "Travis") with repository to build automagically Branch CloudFormation Stack
- You must add the following environment variables to the [Travis](https://travis-ci.com/ "Travis") build configuration:
- AWS_DEFAULT_REGION
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
10. If you're testing with Lighthouse, do it on the fallback route: `/pwa`
## Getting Started
### Build the Docker image
- Build the [Docker](https://www.docker.com/ "Docker") image
```bash
docker build -t serverless-allthethings .
```
### Run a command on the Docker image
- Run commands via the [Docker](https://www.docker.com/ "Docker") image
```bash
docker run --mount src="$(pwd)",target=/opt/serverless-allthethings,type=bind serverless-allthethings COMMAND
```
#### Install dependencies
- Install [npm](https://www.npmjs.com "Npm") dependencies
```bash
docker run --mount src="$(pwd)",target=/opt/serverless-allthethings,type=bind serverless-allthethings bash ./bin/install.sh
```
#### Start
- Start the development server. You can access the website at: `http://localhost`
```bash
docker run --mount src="$(pwd)",target=/opt/serverless-allthethings,type=bind -p 80:80 -e APPSYNC_GRAPHQL_API_REGION="us-east-1" serverless-allthethings
```
#### Lint
- Lint files using [ESLint](https://eslint.org "ESLint"), [stylelint](https://stylelint.io "Stylelint") and [Prettier](https://prettier.io "Prettier")
- Note: It is strongly recommended to incorporate [ESLint](https://eslint.org "ESLint"), [stylelint](https://stylelint.io "Stylelint"), [Prettier](https://prettier.io "Prettier") and [EditorConfig](https://editorconfig.org "EditorConfig") into your IDE's syntax checking, highlighting and `on save` event
- Check for errors via:
```bash
docker run --mount src="$(pwd)",target=/opt/serverless-allthethings,type=bind serverless-allthethings npm run lint
```
- Automagically fix any automagically-fixable errors via:
```bash
docker run --mount src="$(pwd)",target=/opt/serverless-allthethings,type=bind serverless-allthethings npm run lint-fix
```
- Check if any configuration rules conflict with [Prettier](https://prettier.io "Prettier") via:
```bash
docker run --mount src="$(pwd)",target=/opt/serverless-allthethings,type=bind serverless-allthethings npm run lint-check-rules
```
#### Test
- Test files via unit and snapshot test using [Jest](https://jestjs.io/ "Jest")
```bash
docker run --mount src="$(pwd)",target=/opt/serverless-allthethings,type=bind serverless-allthethings npm run test:unit
```
#### Interactive
- Run [Docker](https://www.docker.com/ "Docker") in interactive mode
```bash
docker run --mount src="$(pwd)",target=/opt/serverless-allthethings,type=bind -it serverless-allthethings /bin/bash
```
## Modus Create
[Modus Create](https://moduscreate.com) is a digital product consultancy. We use a distributed team of the best talent in the world to offer a full suite of digital product design-build services; ranging from consumer facing apps, to digital migration, to agile development training, and business transformation.
This project is part of [Modus Labs](https://labs.moduscreate.com/?utm_source=labs&utm_medium=github&utm_campaign=serverless-allthethings).
## Licensing
This project is [MIT licensed](./LICENSE).