makridenko / full-stack-starter-pack

Template for modern monolith app. Django + GraphQL + React.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Full Stack Starter Pack

Licence

License: MIT

Description

Modern monolith web app template. Template designed for docker and vscode (remote-containers).

Stack

Name Pic
Django
PostgreSQL
Graphene Python
GraphQL
React
Relay
React Styled-Components
Docker
Nginx

Using this template

First, you need to install vscode extension - Remote Containers.

Common

To generate configs:

./helper.sh config

Environment variables

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

Backend

For developing backend with django, open django project in vscode and reopen it in container.

code kernel

Reopen in Container

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.

localhost:8000

Open http://localhost:8000/admin to see admin dashboard. Open http://localhost:8000/api to see graphql api sandbox.


Frontend

For developing frontend react app, open react project and reopen it in container.

code client

Reopen in Container

Install all libs:

yarn

Run relay compiler:

yarn relay

Run develop server:

yarn run

Deploy

To run deploy script:

./deploy.sh

On local machine app will running on http://0.0.0.0/

About

Template for modern monolith app. Django + GraphQL + React.

License:MIT License


Languages

Language:Python 40.1%Language:JavaScript 34.1%Language:Shell 15.5%Language:Dockerfile 5.1%Language:HTML 5.1%