Commit 238ac8b5 authored by David Haynes's avatar David Haynes 🙆

Complete workflow for React / Django development

- watch the app build
- docker handles the rest

Closes #185
parent 5133b6ed
Pipeline #2831 passed with stage
in 56 seconds
...@@ -26,12 +26,28 @@ operations on Go links as well as RegisteredUser account management. ...@@ -26,12 +26,28 @@ operations on Go links as well as RegisteredUser account management.
There's a workflow involved with getting started contributing but once you do There's a workflow involved with getting started contributing but once you do
it once or twice it'll seem a lot less daunting. it once or twice it'll seem a lot less daunting.
1. Docker 1. React / Webpack
So we use docker.
2. Actually coding ```sh
yarn
yarn dev
```
You pick an issue 2. Docker
3. Deployment of changes In another terminal tab:
```sh
docker-compose up
```
3. Actually coding
All JS changes will require a refresh (Webpack rebuilds the app in the background).
All Python changes will require a refresh.
4. Deployment of changes
See me.
\ No newline at end of file
...@@ -3,7 +3,7 @@ import ReactDOM from "react-dom"; ...@@ -3,7 +3,7 @@ import ReactDOM from "react-dom";
ReactDOM.render( ReactDOM.render(
<div> <div>
<p>Hello Go 3!</p> <p>Hello Go 3 with React!</p>
</div>, </div>,
document.getElementById("root") document.getElementById("root")
); );
...@@ -25,7 +25,7 @@ admin.autodiscover() ...@@ -25,7 +25,7 @@ admin.autodiscover()
urlpatterns = [ urlpatterns = [
# Root API URL # Root API URL
path("api", include(router.urls)), path("api/", include(router.urls)),
# Authentication URLs # Authentication URLs
path('auth/login/', cas_views.login, name='cas_login'), path('auth/login/', cas_views.login, name='cas_login'),
......
...@@ -188,7 +188,7 @@ CAS_LOGOUT_COMPLETELY = True ...@@ -188,7 +188,7 @@ CAS_LOGOUT_COMPLETELY = True
CAS_PROVIDE_URL_TO_LOGOUT = True CAS_PROVIDE_URL_TO_LOGOUT = True
CAS_RESPONSE_CALLBACKS = ( CAS_RESPONSE_CALLBACKS = (
'go.cas_callbacks.create_user', 'go_back.cas_callbacks.create_user',
) )
CAS_SERVER_URL = "https://login.gmu.edu" CAS_SERVER_URL = "https://login.gmu.edu"
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"license": "Apache-2.0", "license": "Apache-2.0",
"private": false, "private": false,
"scripts": { "scripts": {
"dev": "webpack --mode development ./go/go_ahead/src/index.jsx --output ./go/static/main.js", "dev": "webpack --mode development ./go/go_ahead/src/index.jsx --output ./go/static/main.js --watch",
"build": "webpack --mode production ./project/frontend/src/index.js --output ./go/static/main.js" "build": "webpack --mode production ./project/frontend/src/index.js --output ./go/static/main.js"
}, },
"babel": { "babel": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment