Setting Up a Workspace
Step 1: Organize Your Monorepo Structure
Your monorepo should be organized with clear separation between projects:
my-fullstack-app/
├── .git/ # Single Git repository
├── README.md # Project documentation
├── .gitignore # Shared gitignore
├── frontend/ # React Vite project
│ ├── src/
│ ├── public/
│ ├── package.json
│ └── vite.config.js
└── backend/ # FastAPI project
├── main.py
├── requirements.txt
└── app/
Step 2: Create the Workspace
Method 1: Using the File Menu
- Open VSCode
- Go to
File→Add Folder to Workspace... - Select your
frontendfolder - Repeat:
File→Add Folder to Workspace... - Select your
backendfolder - (Optional) Add the monorepo root:
File→Add Folder to Workspace...and select the parentmy-fullstack-appfolder - Save the workspace:
File→Save Workspace As... - Save it in your monorepo root as
project.code-workspace
Method 2: Create the Workspace File Manually
Create a file called project.code-workspace in your monorepo root with this content:
{
"folders": [
{
"name": "Monorepo Root",
"path": "."
},
{
"name": "Frontend (React)",
"path": "./frontend"
},
{
"name": "Backend (FastAPI)",
"path": "./backend"
}
]
}
Including the monorepo root gives you easy access to:
- README.md and project documentation
.gitignoreand other configuration files- Package scripts that might operate on the entire project
- Any shared configuration or utilities
Opening Your Workspace
Once you’ve created your workspace file, you can:
- Double-click the
.code-workspacefile to open it - Use
File→Open Workspace from File...in VSCode - Recent workspaces will appear in
File→Open Recent - Team members can clone the repo and immediately open the workspace file