Skip to content

Commit

Permalink
chore: add compose dev db setup
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelovicentegc committed Jun 18, 2024
1 parent 6bbc0c6 commit a3989b2
Show file tree
Hide file tree
Showing 8 changed files with 459 additions and 413 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
SECRET_KEY=

CDN_NAME=
CDN_API_KEY=
CDN_API_SECRET=
Expand Down
38 changes: 24 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,25 @@

<p align="center">
<img alt="django-react-typescript logo" src="assets/Logo.png" />
<p align="center">Your favorite React-Django boilerplate.</p>
<p align="center">Fully-featured, up-to-date React-Django boilerplate with great.</p>
</p>

---

## About

This is a fully-featured Django-React boilerplate built for great development experience and easy deployment.

## Development

### Database

To start developing on this project, you will need a Postgres database instance running. It doesn 't matter if it's a local instance or a remote one. Just make sure to set up a Postgres database and configure the `.env` file with the correct credentials.

For convenience, if you want to use Docker + Docker Compose to spin up a Postgres instance locally, with pgAdmin using alongisde, use the following command:

```sh
pnpm run dev:db:up
```

### Global

- Commit lint rules
Expand All @@ -28,12 +38,12 @@ This is a fully-featured Django-React boilerplate built for great development ex
| Other features | Status |
| --------------------------- | ----------- |
| SSR ready | In progress |
| Service workers | ✔️ |
| Gzip static file gen | ✔️ |
| Cache control | ✔️ |
| Code split and lazy loading | ✔️ |
| Google Analytics ready | ✔️ |
| PWA ready | ✔️ |
| Service workers | ✔️ |
| Gzip static file gen | ✔️ |
| Cache control | ✔️ |
| Code split and lazy loading | ✔️ |
| Google Analytics ready | ✔️ |
| PWA ready | ✔️ |

### Backend

Expand All @@ -43,8 +53,8 @@ This is a fully-featured Django-React boilerplate built for great development ex

| Other features | Status |
| -------------------- | ------ |
| Token authentication | ✔️ |
| SMTP ready | ✔️ |
| Token authentication | ✔️ |
| SMTP ready | ✔️ |

### Infrastructure

Expand All @@ -55,9 +65,9 @@ This is a fully-featured Django-React boilerplate built for great development ex

| Other features | Status |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ |
| NGINX config file | ✔️ |
| CI/CD to any V.M. (AWS EC2s, GCloud apps, Digital Ocean droplets, Hostgator VPSs, etc) accessible via SSH (the `hml` and `prd` branches will trigger the [deploy workflow](#Virtualized-Deploy-Workflow)) | ✔️ |
| CI/CD to deploy straight on host (without virtualization; not recommended) (the branch `prd-host` will trigger this. See more on the [host deploy workflow](#Host-Deploy-Workflow) method) | ✔️ |
| NGINX config file | ✔️ |
| CI/CD to any V.M. (AWS EC2s, GCloud apps, Digital Ocean droplets, Hostgator VPSs, etc) accessible via SSH (the `hml` and `prd` branches will trigger the [deploy workflow](#Virtualized-Deploy-Workflow)) | ✔️ |
| CI/CD to deploy straight on host (without virtualization; not recommended) (the branch `prd-host` will trigger this. See more on the [host deploy workflow](#Host-Deploy-Workflow) method) | ✔️ |

### Integrations

Expand Down
10 changes: 5 additions & 5 deletions core/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@

# Application definition

INSTALLED_APPS = [
'admin_menu',
INSTALLED_APPS = [
'jazzmin',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
Expand All @@ -81,9 +81,9 @@
# https://github.com/cdrx/django-admin-menu

ADMIN_STYLE = {
'primary-color': '#0C4B33',
'secondary-color': '#44B78B',
'tertiary-color': '#F2F9FC'
'primary-color': '#164B36',
'secondary-color': '#092117',
'tertiary-color': '#51B48E'
}

ADMIN_LOGO = 'backend/logo.png'
Expand Down
30 changes: 30 additions & 0 deletions docker-compose-dev-db.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: "3.8"
services:
postgres:
container_name: container-pg
image: postgres
hostname: localhost
ports:
- "5432:5432"
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: root
POSTGRES_DB: dev_db
volumes:
- postgres-data:/var/lib/postgresql/data
restart: unless-stopped

pgadmin:
container_name: container-pgadmin
image: dpage/pgadmin4
depends_on:
- postgres
ports:
- "5050:80"
environment:
PGADMIN_DEFAULT_EMAIL: admin@admin.com
PGADMIN_DEFAULT_PASSWORD: root
restart: unless-stopped

volumes:
postgres-data:
Loading

0 comments on commit a3989b2

Please sign in to comment.