Note: This is very much a work in progress. Work needs to be done to transform this prototype into an usable production application.
These instructions are aimed at getting the whole system running for development purposes. The frontend and server folders contain details on running those specific services without Docker.
You'll need to Install Docker and have it running
We need server and database credentials to be created in the server folder:
cat <<-'EOF' > server/postgres.env
POSTGRES_USER=cpho_user-admin
POSTGRES_PASSWORD=123
POSTGRES_DB=cpho_dev
EOFWe'll need some matching credentials for the server. To generate a secret key, you can use tools such as RandomKeygen to generate a strong key.
cat <<-'EOF' > server/server.env
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
DB_NAME=cpho_dev
DB_USER=cpho_user-admin
DB_PASSWORD=123
DB_HOST=postgres
DB_PORT=5432
SECRET_KEY= # ADD GENERATED KEY HERE #
# PGADMIN CONTAINER
PGADMIN_DEFAULT_EMAIL=admin@example.com
PGADMIN_DEFAULT_PASSWORD=123
PGADMIN_LISTEN_PORT=5433
PGADMIN_CONFIG_SERVER_MODE=False
PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED=False
PGADMIN_CONFIG_UPGRADE_CHECK_ENABLED=False
EOFRun docker compose up -d in the root directory of the project.
Docker should have created 4 containers:
cpho-envoy: the lightweight reverse proxycpho-postgres: PostgreSQL databasecpho-server: Django Servercpho-frontend: React Frontend
Now, you can do the following:
- Navigate to
localhost:3000to view the frontend - Navigate to
localhost:3000/graphqlto view the GraphQL interface
When you're done working, you can run docker compose down to stop the containers