{"id":15645262,"url":"https://github.com/briancaffey/django-postgres-vue-gitlab-ecs","last_synced_at":"2025-10-14T02:30:23.999Z","repository":{"id":50275579,"uuid":"200932794","full_name":"briancaffey/django-postgres-vue-gitlab-ecs","owner":"briancaffey","description":"An example project that demonstrates local development, CI/CD and production setup for a full stack web application using Django, Django REST Framework, Django Channels, Postgres, VueJS, Redis, Celery, GitLab CI, CloudFormation and AWS ECS.","archived":true,"fork":false,"pushed_at":"2021-05-10T06:22:23.000Z","size":6004,"stargazers_count":66,"open_issues_count":16,"forks_count":29,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2024-10-10T12:16:36.978Z","etag":null,"topics":["celery","celerybeat","cicd","cloudformation","cypress-tests","darkmode","django","docker","docker-compose","ecs","gitlab-ci","internationalization","minikube","nginx","postgres","postgresql","pytest","quasar-framework","redis","vue"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/briancaffey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-06T22:29:50.000Z","updated_at":"2024-08-20T17:14:01.000Z","dependencies_parsed_at":"2022-08-25T11:21:27.681Z","dependency_job_id":null,"html_url":"https://github.com/briancaffey/django-postgres-vue-gitlab-ecs","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briancaffey%2Fdjango-postgres-vue-gitlab-ecs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briancaffey%2Fdjango-postgres-vue-gitlab-ecs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briancaffey%2Fdjango-postgres-vue-gitlab-ecs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briancaffey%2Fdjango-postgres-vue-gitlab-ecs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/briancaffey","download_url":"https://codeload.github.com/briancaffey/django-postgres-vue-gitlab-ecs/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236433282,"owners_count":19148091,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["celery","celerybeat","cicd","cloudformation","cypress-tests","darkmode","django","docker","docker-compose","ecs","gitlab-ci","internationalization","minikube","nginx","postgres","postgresql","pytest","quasar-framework","redis","vue"],"created_at":"2024-10-03T12:05:28.928Z","updated_at":"2025-10-14T02:30:18.422Z","avatar_url":"https://github.com/briancaffey.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Project Documentation\n\nDocumentation for this project can be found here:\n\n[https://verbose-equals-true.gitlab.io/django-postgres-vue-gitlab-ecs/](https://verbose-equals-true.gitlab.io/django-postgres-vue-gitlab-ecs/)\n\n## Project Architecture Overview\n\nHere 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:\n\n![png](/architecture.png)\n\n(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)\n\n### Legend\n\n1 - GitLab is used to host the source code, test the source code and deploy the application to AWS.\n\n2 - Unit testing (see `.gitlab-ci.yml`)\n\n2a - Pytest\n\n2b - Jest\n\n2c - Cypress\n\n3 - Deployment phase (see `/gitlab-ci/aws/cdk.yml`)\n\n3a - Quasar PWA assets are built if there are changes in the `quasar` directory\n\n3b - AWS Cloud Development Kit (CDK) defines all infrastructure in AWS (4a - 12)\n\n3c - AWS CLI is used to run Fargate tasks through manual GitLab CI jobs\n\n4 - CDK Assets (ECR and S3 buckets that CDK uses internally to manage build assets and artifacts)\n\n4a - Elastic Container Repository is used to manage the Django docker image used in various parts of the application\n\n4b - S3 bucket used to store files associated with CDK and CloudFormation\n\n5 - Route53 is used to route traffic to the CloudFront distribution\n\n6 - CloudFront distribution that serves as the \"front desk\" of the application. It routes requests to to the correct CloudFront Origin\n\n7 - CloudFront Origin Configurations\n\n7a - S3 bucket for Quasar PWA assets\n\n7b - Application Load Balancer for Django application (`/api/`, `/admin/`, `/flower/`, `/ws/`, `/graphql/`)\n\n7c - S3 bucket for Django assets (static files, public media and private media)\n\n8 - Web server and websocket servers\n\n8a - Fargate service running uvicorn process (REST, GraphQL, Django Channels)\n\n8b - Autoscaling Group for Fargate Service that serves Django API\n\n9 - Celery and celery worker autoscaling\n\n9a - Fargate service that is autoscaled between 0 and `N` Fargate tasks for a given celery queue\n\n9b - 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\n\n9c - Lambda event the makes a request to `/api/celery-metrics/`\n\n9d - CloudWatch alarm that is used to scale the Fargate service for a celery queue\n\n9e - Autoscaling group for celery Fargate service\n\n10 - 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)\n\n11 - ElastiCache for Redis, used for Caching, Celery Broker, Channels Layer, etc.\n\n12 - Aurora Postgres Serverless\n\n## Local Development\n\nFirst, 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).\n\n```sh\ndocker-compose up\n```\n\nOpen `http://localhost` in your browser.\n\nYou can specify environment variables for docker-compose by adding an `.env` file to the root of the project based on `.env.template`.\n\n### Social Authentication Keys\n\nTo use social sign on in local development, you will need to create an application with the given provider such as GitHub, Google, Facebook, etc.\n\n#### GitHub\n\nGo to [https://github.com/settings/applications/new](https://github.com/settings/applications/new), and add the following:\n\n- Application Name: A name for the development application, such as `My App Dev`\n- Homepage URL: `http://localhost`\n- Application description: (optional)\n- Authorization callback URL `http://localhost/auth/github/callback` (this route is defined in `quasar/src/router/routes.js`)\n\nIn 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.\n\n## VuePress Documentation\n\nThis project uses VuePress for documentation. To view the documentation site locally, run the following command:\n\n```bash\ndocker-compose -f compose/docs.yml up --build\n```\n\nThis will make the docs available at `http://localhost:8082/docs/`. Hot-reloading through websockets is supported, so changes will show up as they are saved in your code editor.\n\n### Access Django Shell in Jupyter Notebook\n\nWith all containers running, run the following commands:\n\n```\ndocker exec -it backend bash\n# cd notebooks/\n# ../manage.py shell_plus --notebook\n```\n\nor use this single command:\n\n```\ndocker exec -it backend bash -c 'cd notebooks \u0026\u0026 ../manage.py shell_plus --notebook'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbriancaffey%2Fdjango-postgres-vue-gitlab-ecs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbriancaffey%2Fdjango-postgres-vue-gitlab-ecs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbriancaffey%2Fdjango-postgres-vue-gitlab-ecs/lists"}