Modern monolith web app template. Template designed for docker and vscode (remote-containers).
Name | Pic |
---|---|
Django | ![]() |
PostgreSQL | ![]() |
Graphene Python | ![]() |
GraphQL | ![]() |
React | ![]() |
Relay | ![]() |
React Styled-Components | ![]() |
Docker | ![]() |
Nginx | ![]() |
First, you need to install vscode extension - Remote Containers.
To generate configs:
./helper.sh config
Name | Description |
---|---|
SECRET_KEY |
Django secret key. For generate new once, you can use service https://djecrety.ir/ |
DEBUG |
Flag to tell django work on debug mode or not. |
DB_NAME |
PostgreSQL db name. |
DB_USER |
PostgreSQL db user. |
DB_PASSWORD |
PostgeSQL db password. |
REACT_APP_BACKEND_URL |
Endpoint for backend (In file client/.env ) |
Also, look at .env.example
in kernel
and client
.
To copy schema.json from kernel to client (Use -d
flag to generate it from kernel):
./helper.sh gql
Build react app
./helper.sh build
For developing backend with django, open django project in vscode and reopen it in container.
code kernel
For migrate:
./manage.sh migrate
For create new django app:
./manage.sh app
It will create new django app with this structure:
app/
├── admin
│ └── __init__.py
├── apps.py
├── __init__.py
├── models
│ └── __init__.py
├── schema
│ ├── __init__.py
│ └── schema.py
└── services
└── __init__.py
Dump graphql schema:
./manage.sh gql
To run server:
./manage.sh run
Create superuser:
./manage.sh su
To debug django code use cmd+F5
Open http://localhost:8000 you will see this and this is normall. There is no builded webclient.
Open http://localhost:8000/admin to see admin dashboard. Open http://localhost:8000/api to see graphql api sandbox.
For developing frontend react app, open react project and reopen it in container.
code client
Install all libs:
yarn
Run relay compiler:
yarn relay
Run develop server:
yarn run
To run deploy script:
./deploy.sh
On local machine app will running on http://0.0.0.0/