A template for a basic monorepo application using Django (PostgreSQL) and Vue. It includes code quality features like pre-commit
, black
, isort
, eslint
, and prettier
.
- Creates a default Django project.
- Creates a default, TypeScript enabled Vue project using Vite.
Currently:
- Python v.3.10
- Django v5.0.6
- Vue v3.4.21
Clone this repository and rename the root folder (optional).
> git clone https://github.com/jjsiman/fullstack-docker-template.git [ROOT_FOLDER_NAME]
pre-commit
needs to be installed outside of Docker due to the monorepo and Git. This is an area of the developer experience that could be improved.
- Ensure Python is installed on your machine
- Activate the virtual environment. Shown here on Windows:
> python -m venv venv
> /venv/Scripts/activate
- Install monorepo dependencies
> pip install -r requirements.txt
- Install
pre-commit
hooks
> pre-commit install
Assuming Docker is already installed.
- Before running anything, change all instances of
REPLACEME
with your app name. Do not forget about/backend/REPLACEME
. There is no need to configure anything for the frontend. - Build and start the containers
> docker compose --profile fullstack up -d
Once the container is created, you'll need to start Django.
- SSH into the
backend
container
> docker compose exec backend /bin/bash
- Activate the virtual environment
> source activate
- Set up the initial database
> python manage.py migrate
- Start the server. The
0.0.0.0:8000
is required to communicate with Docker.
> python manage.py runserver 0.0.0.0:8000
Once the container is created, Vite is pretty much ready to go.
- Start the server
> npm run dev