This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python manage.py migrate | |
gunicorn kubernetes_django.wsgi:application --bind 0.0.0.0:8000 --log-level info --timeout 180 --workers 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: django-react-k8s-pod | |
labels: | |
pod: django-react-k8s | |
spec: | |
containers: | |
- name: django |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import os | |
from pathlib import Path | |
def get_docker_image(tag, env): | |
return f'gcr.io/<PROJECT_ID>/django_react_k8s:{tag}' | |
def get_bucket(env): | |
return f'<BUCKET_PREFIX>-{env}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const BundleTracker = require("webpack-bundle-tracker"); | |
const paths = require("react-scripts/config/paths"); | |
const WriteFilePlugin = require("write-file-webpack-plugin"); | |
const { | |
override, | |
addWebpackPlugin, | |
} = require("customize-cra"); | |
function appOverride(config) { | |
const bucket = `https://storage.googleapis.com/${process.env.REACT_GCLOUD_BUCKET}/`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// feed.js | |
export const APP_NAME = 'APP_NAME'; | |
// Action Constants | |
const GET_REQUEST = `${APP_NAME}/GET_REQUEST`; | |
const GET_SUCCESS = `${APP_NAME}/GET_SUCCESS`; | |
const GET_ERROR = `${APP_NAME}/GET_ERROR`; | |
const URL = '/api/v1/endpoint/'; | |
// Action Creators | |
export const getRequest = () => ({ type: GET_REQUEST }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*********** module/container.js ***********/ | |
import React from 'react'; | |
import { createStructuredSelector } from 'reselect'; | |
import { connect } from 'react-redux'; | |
// App | |
import ReduxApi from 'containers/redux/api'; | |
const user = new ReduxApi('user', '/api/v1/user/'); | |
const feed = new ReduxAPI('feed', '/api/v1/feed/'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*********** redux/index.js ***********/ | |
import { all } from 'redux-saga/effects'; | |
import ReduxAPI from './api'; | |
// creating objects using the ReduxAPI base class | |
const user = new ReduxAPI('user', '/api/v1/user/'); | |
const feed = new ReduxAPI('feed', '/api/v1/feed/'); | |
const comment = new ReduxAPI('comment', '/api/v1/comment/'); | |
// exporting the reducers as a default object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ReduxApi { | |
constructor(appName, relativePath) { | |
this.APP_NAME = appName; | |
this.URL = `{relativePath}` | |
this.GET_REQUEST = `${this.APP_NAME}/GET_REQUEST`; | |
this.GET_SUCCESS = `${this.APP_NAME}/GET_SUCCESS`; | |
this.GET_ERROR = `${this.APP_NAME}/GET_ERROR`; | |
// NEEDS TO BE BOUND TO CURRENT CONTEXT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*********** redux/api.js ***********/ | |
class ReduxApi { | |
constructor(appName, relativePath) { | |
this.APP_NAME = appName; | |
this.URL = `{relativePath}` | |
this.GET_REQUEST = `${this.APP_NAME}/GET_REQUEST`; | |
this.GET_SUCCESS = `${this.APP_NAME}/GET_SUCCESS`; | |
this.GET_ERROR = `${this.APP_NAME}/GET_ERROR`; |