You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: Improve readme, add real world usage and tech choices sections (#334)
* docs: Improve readme, add real world usage and tech choices sections
* Update docs/real-world-usage.md
Co-authored-by: David Cheung <[email protected]>
* docs: Added learning resources doc, a couple fixes
* A couple more doc tweaks
* Update README.md
Co-authored-by: Anubhav Mishra <[email protected]>
* A few more tweaks to documentation
Co-authored-by: David Cheung <[email protected]>
Co-authored-by: Anubhav Mishra <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+41-27Lines changed: 41 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,54 +2,63 @@
2
2
3
3
## What is Zero
4
4
5
-
Zero is a tool which makes it quick and easy for technical founders & developers to build everything they need to launch and grow high-quality SaaS applications faster and more cost-effectively.
5
+
Zero is an open source tool which makes it quick and easy for startup technical founders and developers to build everything they need to launch and grow high-quality SaaS applications faster and more cost-effectively.
6
+
7
+
Zero sets up everything you need so you can immediately start building your product.
6
8
7
9
## Why is Zero good for startups
8
10
9
11
As a technical founder or the first technical hire at a startup, your sole focus is to build the logic for your application and get it into customers’ hands as quickly and reliably as possible. Yet you immediately face multiple hurdles before even writing the first line of code. You’re forced to make many tech trade-offs, leading to decision fatigue. You waste countless hours building boilerplate SaaS features not adding direct value to your customers. You spend precious time picking up unfamiliar tech, make wrong choices that result in costly refactoring or rebuilding in the future, and are unaware of tools and best practices that would speed up your product iteration.
10
12
11
-
Zero was built by a team of engineers with many years of experience in building and scaling startups. We have faced all the problems you will and want to provide a way for new startups to avoid all those pitfalls. We also want to help you learn about the tech choices we made so your team can become proficient in some of the great tech we have included.
13
+
Zero was built by a team of engineers with many years of experience in building and scaling startups. We have faced all the problems you will and want to provide a way for new startups to avoid all those pitfalls. We also want to help you learn about the tech choices we made so your team can become proficient in some of the great tools we have included. The system you get starts small but allows you to scale well into the future when you need to.
14
+
15
+
Everything built by Zero is yours. After using Zero to generate your infrastructure, backend, and frontend, all the code is checked into your source control repositories and becomes the basis for your new system. We provide constant updates and new modules that you can pull in on an ongoing basis, but you can also feel free to customize as much as you like with no strings attached. If you do happen to make a change to core functionality and feel like contributing it back to the project, we'd love that too!
16
+
17
+
It's easy to get started, the only thing you'll need is an AWS account. Just enter your AWS CLI tokens or choose your existing profile during the setup process and everything is built for you automatically using infrastructure-as-code so you can see exactly what's happening and easily modify it if necessary.
18
+
19
+
[Read about the day-to-day experience of using a system set up using Zero](docs/real-world-usage.md)
12
20
13
-
Everything built by Zero is yours. After running the commands to generate your infrastructure, backend, and frontend, all the code is checked into your source control repositories and becomes the basis for your new system. We provide constant updates and new modules that you can pull in on an ongoing basis, but you can also feel free to customize as much as you like with no strings attached. If you do happen to make a change to core functionality and feel like contributing it back to the project, we'd love that too!
14
21
15
-
## Why is Zero Reliable, Scalable, Performant and Secure
22
+
## Why is Zero Reliable, Scalable, Performant, and Secure
16
23
17
-
Reliability: Your infrastructure will be set up in multiple availability zones making it highly available and fault tolerant. All production workloads will run with multiple instances by default, using AWS ELB and Nginx to load balance traffic. All infrastructure is represented with code using [Hashicorp Terraform][terraform] so your environments are reproducible, auditable, and easy to configure.
24
+
Reliability: Your infrastructure will be set up in multiple availability zones making it highly available and fault tolerant. All production workloads will run with multiple instances by default, using AWS ELB and Nginx to load balance traffic. All infrastructure is represented with code using [HashiCorp Terraform][terraform] so your environments are reproducible, auditable, and easy to configure.
18
25
19
-
Scability: Your services will be running in Kubernetes, with the EKS nodes running in an AWS [Auto Scaling Group][asg]. Both the application workloads and cluster size are ready to scale whenever the need arises. Your frontend assets will be stored in S3 and served from AWS' Cloudfront CDN which operates at global scale.
26
+
Scalability: Your services will be running in Kubernetes, with the EKS nodes running in an AWS [Auto Scaling Group][asg]. Both the application workloads and cluster size are ready to scale whenever the need arises. Your frontend assets will be stored in S3 and served from AWS' Cloudfront CDN which operates at global scale.
20
27
21
-
Security: Properly configured access-control to resources/security groups, using secure vault systems (AWS Secret Manager, Kubernetes secrets), and following best practices provides great security out of the box. Our practices are built on top of multiple security audits and penetration tests. Automatic certificate management using [Let's Encrypt][letsencrypt], database encryption, VPN support, and more means your traffic will always be encrypted. Built-in application features like user authentication help you bullet-proof your application by using existing, tested tools rather than reinventing the wheel when it comes to features like user management and auth.
28
+
Security: Properly configured access-control to resources/security groups, using secret storage systems (AWS Secret Manager, Kubernetes secrets), and following best practices provides great security out of the box. Our practices are built on top of multiple security audits and penetration tests. Automatic certificate management using [Let's Encrypt][letsencrypt], database encryption, VPN support, and more means your traffic will always be encrypted. Built-in application features like user authentication help you bullet-proof your application by using existing, tested tools rather than reinventing the wheel when it comes to features like user management and auth.
22
29
23
30
24
31
## What do you get out of the box?
32
+
[Read about why we made these technology choices and where they are most applicable.](docs/technology-choices.md)
33
+
34
+
[Check out some resources for learning more about these technologies.](docs/learning-resources.md)
- VPCs per environment (staging, production) with pre-configured subnets, security groups, etc.
28
-
- EKS Kubernetes cluster per environment, pre-configured with tools like cert-manager, external-dns, nginx-ingress-controller
39
+
- EKS Kubernetes cluster per environment, pre-configured with helpful tools like cert-manager, external-dns, nginx-ingress-controller
29
40
- RDS database for your application (Postgres or MySQL)
30
41
- S3 buckets and Cloudfront distributions to serve your assets
31
42
- Logging and Metrics collected automatically using either Cloudwatch or Prometheus + Grafana, Elasticsearch + Kibana
32
-
- VPN using [Wireguard][wireguard]
43
+
- VPN using [Wireguard][wireguard] (Optional)
33
44
- User management and Identity / Access Proxy using Ory [Kratos][kratos] and [Oathkeeper][oathkeeper] (Optional)
34
-
- Tooling to make it easy to set up secure access for your team
35
-
- Local/Cloud Hybrid developer environment using Skaffold and Telepresence (In Progress)
45
+
- Tooling to make it easy to set up secure access for your dev team
46
+
- Local/Cloud Hybrid developer environment using Telepresence (Optional)
36
47
37
48
### Backend
38
49
- Golang or Node.js example project automatically set up, Dockerized, and deployed to your new Kubernetes cluster
39
-
- CI pipeline built with [CircleCI][circleci]. Just merge a PR and a deploy will start. Your code will be built and tested, deployed to staging, then prompt you to push to production
50
+
- CI pipeline built with [CircleCI][circleci] or GitHub Actions. Just merge a PR and a deploy will start. Your code will be built and tested, deployed to staging, then prompt you to push to production
40
51
- File upload / download support using signed Cloudfront URLs (Optional)
41
52
- Email support using [SendGrid][sendgrid] or AWS SES (Optional)
42
53
- Notification support for sending and receiving messages in your application (web, mobile, SMS, Email, etc.) (Optional) (In Progress)
43
54
- User management integration with Kratos and Oathkeeper - No need to handle login, signup, authentication yourself (Optional)
44
-
- Feature Flagging integration with [LaunchDarkly][launchdarkly] (Optional) (In Progress)
45
55
46
56
### Frontend
47
57
- React example project automatically set up, deployed and served securely to your customers
48
-
- CI pipeline built with CircleCI. Just merge a PR and a deploy will start. Your code will be built and tested, deployed to staging, then prompt you to push to production
58
+
- CI pipeline built with CircleCI or GitHub Actions. Just merge a PR and a deploy will start. Your code will be built and tested, deployed to staging, then prompt you to push to production
49
59
- File upload / download support using signed Cloudfront URLs (Optional)
50
60
- User management integration with Kratos - Just style the example login / signup flow to look the way you want (Optional)
51
61
- Static site example project using Gatsby to easily make a landing page, also set up with a CI Pipeline using CircleCI (Optional)
52
-
- Feature Flagging integration with LaunchDarkly (Optional) (In Progress)
53
62
54
63
___
55
64
@@ -69,7 +78,7 @@ brew install zero
69
78
70
79
- Install Zero by downloading the binary.
71
80
72
-
Download the latest [Zero binary] for your systems archetecture. Unzip your downloaded package add copy the Zero binary to the desired location and add it to your system PATH.
81
+
Download the latest [Zero binary] for your systems architecture. Unzip your downloaded package and copy the Zero binary to the desired location and add it to your system PATH.
73
82
74
83
Zero currently supports:
75
84
| System | Support| Package Manager |
@@ -88,25 +97,30 @@ In order to use Zero, run the `zero check` command on your system to find out wh
88
97
89
98
You need to [register a new domain](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-register.html) / [host a registered domain](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/MigratingDNS.html) you will use to access your infrastructure on [Amazon Route 53](https://aws.amazon.com/route53/).
90
99
91
-
> We recommended you have two domains - one for staging and another for production. For example, mydomain.com and mydomain-staging.com. This will lead to environments that are more similar, rather than trying to use a subdomain for staging which may cause issues in your app later on.
100
+
> We recommended you have two domains - one for staging and another for production. For example, mydomain.com and mydomain-staging.com. This will lead to environments that are more similar, rather than trying to use a subdomain like staging.mydomain.com for staging which may cause issues in your app later on.
92
101
93
102
___
94
103
95
104
## Using zero to spin up your own stack
96
105
97
-
Using Zero to spin up your infrastructure is easy and straightforward; using a few commands, you can configure and deploy your very own scalable high-performant infrastructure that is production-ready.
106
+
Using Zero to spin up your infrastructure and application is easy and straightforward. Using just a few commands, you can configure and deploy your very own scalable, high-performance, production-ready infrastructure.
98
107
99
108
A few caveats before getting started:
100
109
101
110
- For Zero to provision resources, you will need to be authenticated with AWS [(authenticate with aws-cli)](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html#cli-configure-files-methods).
102
111
103
-
- You can also configure your aws-cli during the zero project initialization.
104
-
- It is recomended practice to [create a GitHub org](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/creating-a-new-organization-from-scratch) where your code is going to live and grant [CircleCi Organization access](https://github.com/settings/connections/applications/78a2ba87f071c28e65bb) to your repositories for CI / CD deployment.
112
+
- It is recommended practice to [create a GitHub org](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/creating-a-new-organization-from-scratch) where your code is going to live. If you choose, after creating your codebases, Zero will automatically create repositories and check in your code for you. You will need to [create a Personal Access Token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) to enable this.
113
+
114
+
- You will need a GitHub Personal Access Token if you want Zero
115
+
<details>
116
+
<summary>If using CircleCI as your build pipeline ...</summary>
105
117
106
-
- During set-up, you need to create a GitHub personal access token and a CircleCi access token; you should store your generated tokens securely.
118
+
- Grant [CircleCi Organization access](https://github.com/settings/connections/applications/78a2ba87f071c28e65bb) to your repositories to allow pulling the code during the build pipeline.
107
119
108
-
- For your CI build to work, you need to opt into the use of third-party orbs you can find this in your CircleCi Org Setting > Security > Allow Uncertified Orbs.
120
+
- You will need to [create a CircleCi access token](https://circleci.com/docs/2.0/managing-api-tokens/) and enter it during the setup process; you should store your generated tokens securely.
109
121
122
+
- For your CI build to work, you need to opt into the use of third-party orbs. You can find this in your CircleCi Org Setting > Security > Allow Uncertified Orbs.
123
+
</details>
110
124
111
125
### zero init
112
126
@@ -116,7 +130,7 @@ The `zero init` command creates a new project and outputs an infrastructure conf
116
130
# To create and customize a new project you run
117
131
$ zero init
118
132
119
-
## Sample project initilization
133
+
## Sample project initialization
120
134
✔ Project Name: myapp-infra
121
135
🎉 Initializing project
122
136
✔ EKS + Go + React + Gatsby
@@ -148,10 +162,10 @@ The token can be created at https://app.circleci.com/settings/user/tokens
148
162
149
163
### zero create
150
164
151
-
The `zero create` command renders the infrastructure modules you've configured into your project folder and pushed your code to GitHub.
165
+
The `zero create` command renders the infrastructure modules you've configured into your project folder and pushes your code to GitHub.
152
166
153
167
```shell
154
-
# Template the selected modules and configuration specified in zero-project.yml and push to repository.
168
+
# Template the selected modules and configuration specified in zero-project.yml and push to the repository.
155
169
$ cd zero-init # change your working dir to YOUR_PROJECT_NAME
156
170
$ zero create
157
171
@@ -215,7 +229,7 @@ zero-deployable-backend:
215
229
- Production API: api.commitzero.com
216
230
```
217
231
218
-
***Your stack is now up and running, follow the links your terminal to visit your application 🎉***
232
+
***Your stack is now up and running, follow the links inyour terminal to visit your application 🎉***
219
233
220
234
221
235
## Zero Default Stack
@@ -274,7 +288,7 @@ The configuration for goreleaser is in [.goreleaser.yml](.goreleaser.yml)
274
288
___
275
289
## FAQ
276
290
277
-
Why is my deployed application not yet accesible?
291
+
Why is my deployed application not yet accessible?
278
292
279
293
- It takes about 20 - 35 mins for your deployed application to be globally available through AWS CloudFront CDN.
3. If using the Telepresence dev experience, run the `start-dev-env.sh` script to allow you to use the hybrid cloud environment as you work, to run and test your code in a realistic environment.
9
+
3. Commit your finished code, make a PR, have it reviewed. Lightweight tests will run against your branch and prevent merging if they fail.
10
+
4. Merge your branch to the main branch. A build will start automatically.
11
+
5. The pipeline will build an artifact, run tests, deploy your change to staging, then wait for your input to deploy to production.
12
+
13
+
### Debugging a problem on production
14
+
1. Check the logs of your service:
15
+
- If using cloudwatch, log into the AWS console and go to the [Logs Insights tool](https://us-west-2.console.aws.amazon.com/cloudwatch/home#logsV2:logs-insights). Choose the log group for your production environment ending in `/application` and hit the "Run query" button.
16
+
- If using kibana, make sure you are on the VPN and open the Kibana URL in your browser. Click the "Discover" tab and try searching for logs based on the name of your service.
17
+
- Alternatively, watch the logs in realtime via the CLI using the command `kubectl logs -f -l app=<your service name>` or `stern <your service name>`
18
+
2. Check the state of your application pods. Look for strange events or errors from the pods:
19
+
```shell
20
+
$ kubectl get pods
21
+
$ kubectl get events
22
+
$ kubectl describe pods
23
+
```
24
+
3. Exec into your application pod. From here you can check connectivity with `ping` or `nc`, or inspect anything else application-specific.
2. If this is for a new service entirely, make sure there is an ingress defined in the `kubernetes/` directory of your repo. If you want to add a new domain pointing to an existing service, just go into the file `kubernetes/overlays/<environment>/ingress.yml` and add a section to `spec:` and `tls:`, specifying your new domain.
41
+
-`spec` is where you can define the hostname, any special path rules, and which service you want traffic to be sent to
42
+
- if your hostname is in the `tls` section, a TLS certificate will automatically be provisioned for it using Let's Encrypt
43
+
3. A number of things will happen once this is deployed to the cluster:
44
+
- Routing rules will be created to let traffic in to the cluster and send it to the service based on the hostname and path
45
+
- An AWS load balancer will be created if one doesn't already exist and it will be pointed to the cluster
46
+
- In the case of a subdomain, a DNS record will be automatically created for you
47
+
- A certificate will be provisioned using Let's Encrypt for the domain you specified
0 commit comments