Skip to content

Commit 6edc7a5

Browse files
committed
feat: initial commit
1 parent 679a901 commit 6edc7a5

File tree

139 files changed

+11041
-9
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+11041
-9
lines changed

README.md

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,43 @@
1-
## My Project
1+
![AWS Serverless Developer Experience Workshop Reference Architecture](/docs/workshop_logo.png)
22

3-
TODO: Fill this README out!
3+
# AWS Serverless Developer Experience workshop reference architecture (Python)
44

5-
Be sure to:
5+
This repository contains the reference architecture for the AWS Serverless Developer Experience workshop.
66

7-
* Change the title in this README
8-
* Edit your repository description on GitHub
7+
The AWS Serverless Developer Experience workshop provides you with an immersive experience of a serverless developer. The goal is to provide you with an hands-on experience building a serverless solution using the [AWS Serverless Application Model (AWS SAM)](https://aws.amazon.com/serverless/sam/) and AWS SAM CLI.
98

10-
## Security
9+
Along the way, we want to demonstrate principles of event-driven distributed architecture, orchestration, and serverless observability, and how to apply them in code.
1110

12-
See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
11+
We'll also explore open-source tools, core features of AWS Lambda Powertools, and serverless CI/CD deployments. You can choose choose to run this workshop in a runtime of your choice — Python, TypeScript, Java, and .NET — and work with your own developer setup or use AWS Cloud9 to build the services.
1312

14-
## License
13+
This workshop will take approximately 4 hours to complete. We are assuming that you have some practical development skills in one of the supported runtimes, and are familiar with some of the services that we will use in this solution which include: [Amazon API Gateway](https://aws.amazon.com/apigateway/), [AWS Lambda](https://aws.amazon.com/lambda/), [Amazon EventBridge](https://aws.amazon.com/eventbridge/), [AWS Step Functions](https://aws.amazon.com/step-functions/) and [Amazon DynamoDB](https://aws.amazon.com/dynamodb/).
1514

16-
This library is licensed under the MIT-0 License. See the LICENSE file.
15+
## About the Architecture
1716

17+
![AWS Serverless Developer Experience Workshop Reference Architecture](/docs/architecture.png)
18+
19+
Our use case is based on a real estate company called **Unicorn Properties**.
20+
21+
As a real estate agency, **Unicorn Properties** needs to manage the publishing of new property listings and sale contracts linked to individual properties, and provide a way for their customers to view approved property listings.
22+
23+
To support their needs, Unicorn Properties have adopted a serverless, event-driven approach to designing their architecture. This architecture is centred around two primary domains: boundaries–Contracts (managed by the Contracts Service) and Properties (which are managed by the Properties Web and Properties Services).
24+
25+
The **Contracts Service** is a simplified service that manages the contractual relationship between a seller of a property and Unicorn Properties. Contracts are drawn up that define the property for sale, the terms and conditions that Unicorn Properties sets, and how much it will cost the seller to engage the services of the agency.
26+
27+
The **Properties Web** service manages the details of a property listing to be published on the Unicorn Properties website. Every property listing has an address, a sale price, a description of the property, and some photos that members of the public can look at to get them interested in purchasing the property. **Only properties that have been approved for publication can be made visible to the public**.
28+
29+
The **Properties Service** approves a listing. This service implements a workflow that checks for the existence of a contract, makes sure that the content and the images are safe to publish, and finally checks that the contract has been approved. We don’t want to publish a property until we have an approved contract!
30+
31+
32+
## Credits
33+
34+
Throughout this workshop we wanted to introduce you to some Open Source tools that can help you build serverless applications. This is not an exhaustive list, just a small selection of what we will be using in the workshop.
35+
36+
Many thanks to all the AWS teams and community builders who have contributed to this list:
37+
38+
| Tools | Description | Download / Installation Instructions |
39+
| --------------------- | ----------- | --------------------------------------- |
40+
| cfn-lint | Validate AWS CloudFormation yaml/json templates against the AWS CloudFormation Resource Specification and additional checks. | https://github.com/aws-cloudformation/cfn-lint |
41+
| cfn-lint-serverless | Compilation of rules to validate infrastructure-as-code templates against recommended practices for serverless applications. | https://github.com/awslabs/serverless-rules |
42+
| @mhlabs/iam-policies-cli| CLI for generating AWS IAM policy documents or SAM policy templates based on the JSON definition used in the AWS Policy Generator. | https://github.com/mhlabs/iam-policies-cli |
43+
| @mhlabs/evb-cli | Pattern generator and debugging tool for Amazon EventBridge | https://github.com/mhlabs/evb-cli |

contracts_service/.DS_Store

6 KB
Binary file not shown.

contracts_service/tests/.DS_Store

6 KB
Binary file not shown.

contracts_service/tests/.coverage

52 KB
Binary file not shown.
52 KB
Binary file not shown.

docs/architecture.png

174 KB
Loading

docs/workshop_logo.png

328 KB
Loading

unicorn_contracts/.coveragerc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[run]
2+
omit = tests/*

unicorn_contracts/.gitignore

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
### Linux ###
2+
**/*~
3+
**/.fuse_hidden*
4+
**/.directory
5+
**/.Trash-*
6+
**/.nfs*
7+
8+
### OSX ###
9+
**/*.DS_Store
10+
**/.AppleDouble
11+
**/.LSOverride
12+
**/.DocumentRevisions-V100
13+
**/.fseventsd
14+
**/.Spotlight-V100
15+
**/.TemporaryItems
16+
**/.Trashes
17+
**/.VolumeIcon.icns
18+
**/.com.apple.timemachine.donotpresent
19+
20+
### JetBrains IDEs ###
21+
**/*.iws
22+
**/.idea/
23+
**/.idea_modules/
24+
25+
### Python ###
26+
**/__pycache__/
27+
**/*.py[cod]
28+
**/*$py.class
29+
**/.Python
30+
**/build/
31+
**/develop-eggs/
32+
**/dist/
33+
**/downloads/
34+
**/eggs/
35+
**/.eggs/
36+
**/parts/
37+
**/sdist/
38+
**/wheels/
39+
**/*.egg
40+
**/*.egg-info/
41+
**/.installed.cfg
42+
**/pip-log.txt
43+
**/pip-delete-this-directory.txt
44+
45+
### Unit test / coverage reports ###
46+
**/.cache
47+
**/.coverage
48+
**/.hypothesis/
49+
**/.pytest_cache/
50+
**/.tox/
51+
**/*.cover
52+
**/coverage.xml
53+
**/htmlcov/
54+
**/nosetests.xml
55+
56+
### pyenv ###
57+
**/.python-version
58+
59+
### Environments ###
60+
**/.env
61+
**/.venv
62+
**/env/
63+
**/venv/
64+
**/ENV/
65+
**/env.bak/
66+
**/venv.bak/
67+
68+
### VisualStudioCode ###
69+
**/.vscode/
70+
**/.history
71+
72+
### Windows ###
73+
# Windows thumbnail cache files
74+
**/Thumbs.db
75+
**/ehthumbs.db
76+
**/ehthumbs_vista.db
77+
**/Desktop.ini
78+
**/$RECYCLE.BIN/
79+
**/*.lnk
80+
81+
### requirements.txt ###
82+
# We ignore Python's requirements.txt as we use Poetry instead
83+
**/requirements.txt
84+
**/.aws-sam

unicorn_contracts/Makefile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
stackName := uni-prop-local-contract
2+
3+
build:
4+
cfn-lint template.yaml -a cfn_lint_serverless.rules
5+
poetry export --without-hashes --format=requirements.txt --output=src/requirements.txt
6+
sam build -c
7+
8+
deps:
9+
poetry install
10+
11+
deploy: build
12+
sam deploy --no-confirm-changeset
13+
14+
sync:
15+
sam sync --stack-name $(stackName) --watch
16+
17+
test: unit-test
18+
19+
unit-test: deps
20+
poetry run pytest tests/unit/
21+
22+
integration-test: deps
23+
AWS_SAM_STACK_NAME=$(stackName) poetry run pytest tests/integration/
24+
25+
logs:
26+
sam logs --stack-name $(stackName) -t
27+
28+
clean:
29+
find . -type d -name __pycache__ -exec rm -rf {} \; 2>/dev/null || true
30+
find . -type f -name requirements.txt -exec rm -f {} \; 2>/dev/null || true
31+
rm -rf .pytest_cache/ .aws-sam/ htmlcov/ .coverage || true
32+
33+
delete:
34+
sam delete --stack-name $(stackName) --no-prompts
35+

unicorn_contracts/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Unicorn Properties: Contracts Service
2+
3+
## Overview
4+
5+
TODO: add overview
6+
7+
TODO: add architecture image
8+
9+
## Testing with Postman
10+
11+
TODO: add instructions
12+
13+
## Testing with TODO: curl or httpie
14+

unicorn_contracts/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)