Skip to content
This repository was archived by the owner on Mar 27, 2023. It is now read-only.

Commit 5f3ce16

Browse files
committed
upated architecture diagram, updated documentation with new diagram
1 parent c86cf9a commit 5f3ce16

File tree

4 files changed

+149
-9
lines changed

4 files changed

+149
-9
lines changed

README.md

Lines changed: 80 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,92 @@ Documentation for this project can be found here:
44

55
[https://verbose-equals-true.gitlab.io/django-postgres-vue-gitlab-ecs/](https://verbose-equals-true.gitlab.io/django-postgres-vue-gitlab-ecs/)
66

7+
8+
## Project Architecture Overview
9+
10+
Here is an overview of the project architecture, including the CI/CD pipeline and the AWS infrastructure that will be automatically provisioned through the AWS Cloud Development Kit:
11+
12+
![png](/architecture.png)
13+
14+
(This diagram was created with [draw.io](https://draw.io). Here's the link to the a read-only version of the diagram on draw.io: [https://drive.google.com/file/d/1gU61zjoW80fCusUcswU1zhEE5VFB1Z5U/view?usp=sharing](https://drive.google.com/file/d/1gU61zjoW80fCusUcswU1zhEE5VFB1Z5U/view?usp=sharing)
15+
16+
### Legend
17+
18+
1 - GitLab is used to host the source code, test the source code and deploy the application to AWS.
19+
20+
2 - Unit testing (see `.gitlab-ci.yml`)
21+
22+
2a - Pytest
23+
24+
2b - Jest
25+
26+
2c - Cypress
27+
28+
3 - Deployment phase (see `/gitlab-ci/aws/cdk.yml`)
29+
30+
3a - Quasar PWA assets are built if there are changes in the `quasar` directory
31+
32+
3b - AWS Cloud Development Kit (CDK) defines all infrastructure in AWS (4a - 12)
33+
34+
3c - AWS CLI is used to run Fargate tasks through manual GitLab CI jobs
35+
36+
4 - CDK Assets (ECR and S3 buckets that CDK uses internally to manage build assets and artifacts)
37+
38+
4a - Elastic Container Repository is used to manage the Django docker image used in various parts of the application
39+
40+
4b - S3 bucket used to store files associated with CDK and CloudFormation
41+
42+
5 - Route53 is used to route traffic to the CloudFront distribution
43+
44+
6 - CloudFront distribution that serves as the "front desk" of the application. It routes requests to to the correct CloudFront Origin
45+
46+
7 - CloudFront Origin Configurations
47+
48+
7a - S3 bucket for Quasar PWA assets
49+
50+
7b - Application Load Balancer for Django application (`/api/`, `/admin/`, `/flower/`, `/ws/`, `/graphql/`)
51+
52+
7c - S3 bucket for Django assets (static files, public media and private media)
53+
54+
8 - Web server and websocket servers
55+
56+
8a - Fargate service running uvicorn process (REST, GraphQL, Django Channels)
57+
58+
8b - Autoscaling Group for Fargate Service that serves Django API
59+
60+
9 - Celery and celery worker autoscaling
61+
62+
9a - Fargate service that is autoscaled between 0 and `N` Fargate tasks for a given celery queue
63+
64+
9b - Scheduled Event that triggers a Lambda to make a request to Django backend which collects celery queue metrics and published metrics to CloudWatch using boto3
65+
66+
9c - Lambda event the makes a request to `/api/celery-metrics/`
67+
68+
9d - CloudWatch alarm that is used to scale the Fargate service for a celery queue
69+
70+
9e - Autoscaling group for celery Fargate service
71+
72+
10 - Fargate tasks that run Django management commands such as `migrate` and `collectstatic`. These are triggered from manual GitLab CI jobs using the AWS CLI (3c)
73+
74+
11 - ElastiCache for Redis, used for Caching, Celery Broker, Channels Layer, etc.
75+
76+
12 - Aurora Postgres Serverless
77+
778
## Local Development
879

980
First, copy `.env.template` to a new file in the project's root directory called `.env`. This file will be read by `docker-compose` in the next step. Adjust any of the values in this file if needed, or add new variables for any secret information you need to pass to docker-compose (or to docker containers).
1081

82+
```sh
83+
docker-compose up
84+
```
85+
86+
Open `http://localhost` in your browser.
87+
88+
You can specify environment variables for docker-compose by adding an `.env` file to the root of the project based on `.env.template`.
89+
1190
### Social Authentication Keys
1291

13-
To use social sign on in development, you will need to create an application with the given provider.
92+
To use social sign on in local development, you will need to create an application with the given provider such as GitHub, Google, Facebook, etc.
1493

1594
#### GitHub
1695

@@ -23,14 +102,6 @@ Go to [https://github.com/settings/applications/new](https://github.com/settings
23102

24103
In the `.env` file, add the `Client ID` of your GitHub OAuth App as the `GITHUB_KEY` variable, and add the `Client Secret` as the `GITHUB_SECRET` variable.
25104

26-
```sh
27-
docker-compose up
28-
```
29-
30-
Open `http://localhost` in your browser.
31-
32-
You can specify environment variables for docker-compose by adding an `.env` file to the root of the project based on `.env.template`.
33-
34105
## VuePress Documentation
35106

36107
This project uses VuePress for documentation. To view the documentation site locally, run the following command:

architecture.png

1.08 MB
Loading
Loading

documentation/docs/start/overview/README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,75 @@ Here are some of the best practices that this project aims to use:
3333
- KISS & DRY
3434
- Initial AWS console interaction is strictly limited to what can _only_ be done through the AWS console, otherwise AWS CDK and AWS CLI (preferably in CI/CD pipelines) are the primary means of interacting with AWS resources and the AWS Console is treated as a "read-only" convenience.
3535

36+
## Architecture Overview
37+
38+
<img :src="$withBase('/architecture.png')" alt="foo">
39+
40+
This diagram was created with [draw.io](https://draw.io). Here's the link to the a read-only version of the diagram on draw.io: [https://drive.google.com/file/d/1gU61zjoW80fCusUcswU1zhEE5VFB1Z5U/view?usp=sharing](https://drive.google.com/file/d/1gU61zjoW80fCusUcswU1zhEE5VFB1Z5U/view?usp=sharing)
41+
42+
### Legend
43+
44+
1 - GitLab is used to host the source code, test the source code and deploy the application to AWS.
45+
46+
2 - Unit testing (see `.gitlab-ci.yml`)
47+
48+
2a - Pytest
49+
50+
2b - Jest
51+
52+
2c - Cypress
53+
54+
3 - Deployment phase (see `/gitlab-ci/aws/cdk.yml`)
55+
56+
3a - Quasar PWA assets are built if there are changes in the `quasar` directory
57+
58+
3b - AWS Cloud Development Kit (CDK) defines all infrastructure in AWS (4a - 12)
59+
60+
3c - AWS CLI is used to run Fargate tasks through manual GitLab CI jobs
61+
62+
4 - CDK Assets (ECR and S3 buckets that CDK uses internally to manage build assets and artifacts)
63+
64+
4a - Elastic Container Repository is used to manage the Django docker image used in various parts of the application
65+
66+
4b - S3 bucket used to store files associated with CDK and CloudFormation
67+
68+
5 - Route53 is used to route traffic to the CloudFront distribution
69+
70+
6 - CloudFront distribution that serves as the "front desk" of the application. It routes requests to to the correct CloudFront Origin
71+
72+
7 - CloudFront Origin Configurations
73+
74+
7a - S3 bucket for Quasar PWA assets
75+
76+
7b - Application Load Balancer for Django application (`/api/`, `/admin/`, `/flower/`, `/ws/`, `/graphql/`)
77+
78+
7c - S3 bucket for Django assets (static files, public media and private media)
79+
80+
8 - Web server and websocket servers
81+
82+
8a - Fargate service running uvicorn process (REST, GraphQL, Django Channels)
83+
84+
8b - Autoscaling Group for Fargate Service that serves Django API
85+
86+
9 - Celery and celery worker autoscaling
87+
88+
9a - Fargate service that is autoscaled between 0 and `N` Fargate tasks for a given celery queue
89+
90+
9b - Scheduled Event that triggers a Lambda to make a request to Django backend which collects celery queue metrics and published metrics to CloudWatch using boto3
91+
92+
9c - Lambda event the makes a request to `/api/celery-metrics/`
93+
94+
9d - CloudWatch alarm that is used to scale the Fargate service for a celery queue
95+
96+
9e - Autoscaling group for celery Fargate service
97+
98+
10 - Fargate tasks that run Django management commands such as `migrate` and `collectstatic`. These are triggered from manual GitLab CI jobs using the AWS CLI (3c)
99+
100+
11 - ElastiCache for Redis, used for Caching, Celery Broker, Channels Layer, etc.
101+
102+
12 - Aurora Postgres Serverless
103+
104+
36105
## Topics
37106

38107
Here's a list of some of the major topics covered:

0 commit comments

Comments
 (0)