Skip to main content

Conduit

A fullstack Conduit application powered by:


Table of Contents

Project Structure

conduit/						
├─ docker-compose.yml
├─ Conduit_Container_Checkliste.pdf
├─ .dockerignore
├─ .gitignore
├─ .gitmodules
├─ conduit-backend/
│ ├─ .env
│ ├─ Dockerfile
│ ├─ start.sh
│ └─ ...
└─ conduit-frontend/
├─ Dockerfile
├─ src/
│ ├─ environments/
│ │ └─ environment.development.ts
│ └─ ...
└─ ...

Quickstart

  1. Clone the fullstack project with submodules:
git clone --recurse-submodules https://github.com/GeorgStrassberger/conduit.git
cd conduit
  1. Update frontend submodule:
cd conduit-frontend
git checkout docker
git pull origin docker
  1. Update backend submodule:
cd ../conduit-backend
git checkout docker
git pull origin docker
  1. Backend .env Setup

    Inside conduit-backend/:

    cp .env.example .env
    nano .env

    Edit your environment variables:

    # DJANGO SUPERUSER
    DJANGO_SUPERUSER_EMAIL=admin@example.com # <- change
    DJANGO_SUPERUSER_NAME=admin # <- change
    DJANGO_SUPERUSER_PASSWORD=adminpass # <- change

    # SECURITY
    SECRET_KEY=your-django-secret-key # <- change
    DEBUG=True
    ALLOWED_HOSTS=localhost,127.0.0.1 # <- change

    # CORS
    ALLOWED_ORIGIN=http://127.0.0.1:8082 # <- change

    Save & Exit: CTRL + O, then CTRL + X

  2. Frontend Environment Setup

    Inside conduit-frontend/src/environments/:

    cd ../conduit-frontend/src/environments/
    cp environment.development.ts environment.ts
    nano environment.ts

    Edit as needed:

    export const environment = {
    production: true, // set to TRUE
    apiUrl: "http://localhost:7000/api", // your host-ipv4
    };

    Save & Exit: CTRL + O, then CTRL + X

Start the App

Go back to root directory conduit:

cd ../../..

Build containers:

docker compose build

Run services:

docker compose up -d

Verify that containers are running:

docker ps

You should see output like this:

CONTAINER ID   IMAGE                  COMMAND                  STATUS         PORTS
abcd1234 conduit-backend "gunicorn ..." Up 10 seconds 0.0.0.0:7000->7000/tcp
efgh5678 conduit-frontend "nginx -g ..." Up 10 seconds 0.0.0.0:8082->80/tcp

Usage

Replace localhost with your host IP if needed.

Author


██████╗ ███████╗ ███████╗ █████████╗
██╔════╝ ██╔════╝ ██╔═════╝ ╚══██╔═══╝
██║ ███╗ █████╗ ╚█████╗ ██║
██║ ██║ ██╔══╝ ╚═══██╗ ██║
██║ ██║ ██║ ██╗ ██║
╚██████╔╝ ███████╗ ███████║ ██║
╚═════╝ ╚══════╝ ╚══════╝ ╚═╝