Skip to content

Commit 81ede44

Browse files
committed
Initial commit
0 parents  commit 81ede44

File tree

12 files changed

+585
-0
lines changed

12 files changed

+585
-0
lines changed

.devcontainer/devcontainer.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
3+
{
4+
"name": "Open Collective",
5+
"dockerComposeFile": [
6+
"../api/docker-compose/database.yml",
7+
// Uncomment the following lines if you need these services
8+
// "../api/docker-compose/search.yml",
9+
// "../api/docker-compose/mail.yml",
10+
// "../api/docker-compose/uploads.yml",
11+
"../opencollective.node.docker-compose.yml"
12+
],
13+
"service": "dev",
14+
"containerEnv": {
15+
"PG_HOST": "postgres"
16+
},
17+
// Features to add to the dev container. More info: https://containers.dev/features.
18+
"features": {
19+
"ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {
20+
"version": "16"
21+
}
22+
},
23+
24+
// Expose frontend, API, Postgres, and Mailpit ports to the host machine.
25+
"forwardPorts": [3000,3060,5432,1080],
26+
27+
// Use 'workspaceFolder' to specify the working directory for your container.
28+
"workspaceFolder": "/workspace"
29+
30+
// Use 'postCreateCommand' to run commands after the container is created.
31+
// "postCreateCommand": "yarn install",
32+
}

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for more information:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
# https://containers.dev/guide/dependabot
6+
7+
version: 2
8+
updates:
9+
- package-ecosystem: "devcontainers"
10+
directory: "/"
11+
schedule:
12+
interval: weekly
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
name: Validate Workspace Configuration
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
validate-repositories-consistency:
12+
name: Validate Repositories Consistency
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Extract repositories from init.sh
20+
id: extract-repos
21+
run: |
22+
# Extract repository names from the repositories array in init.sh
23+
# The array format is: "url" "name" pairs, we need the names (odd indices)
24+
REPOS=$(grep -A 20 'declare -a repositories=(' init.sh | \
25+
grep -E '^\s*"[^"]*"\s*"[^"]*"' | \
26+
sed -E 's/.*"[^"]*"\s*"([^"]*)".*/\1/' | \
27+
sort)
28+
29+
echo "repositories<<EOF" >> $GITHUB_OUTPUT
30+
echo "$REPOS" >> $GITHUB_OUTPUT
31+
echo "EOF" >> $GITHUB_OUTPUT
32+
33+
echo "Found repositories:"
34+
echo "$REPOS"
35+
36+
- name: Extract folders from workspace file
37+
id: extract-folders
38+
run: |
39+
# Extract folder paths from the workspace file and convert to just the folder names
40+
FOLDERS=$(grep -E '^\s*"path":\s*"apps/[^"]*"' opencollective-workspace.code-workspace | \
41+
sed -E 's/.*"path":\s*"apps\/([^"]*)".*/\1/' | \
42+
sort)
43+
44+
echo "folders<<EOF" >> $GITHUB_OUTPUT
45+
echo "$FOLDERS" >> $GITHUB_OUTPUT
46+
echo "EOF" >> $GITHUB_OUTPUT
47+
48+
echo "Found folders:"
49+
echo "$FOLDERS"
50+
51+
- name: Compare repositories and folders
52+
run: |
53+
# Create temporary files for comparison
54+
echo "${{ steps.extract-repos.outputs.repositories }}" > /tmp/repos.txt
55+
echo "${{ steps.extract-folders.outputs.folders }}" > /tmp/folders.txt
56+
57+
echo "=== Repositories from init.sh ==="
58+
cat /tmp/repos.txt
59+
60+
echo ""
61+
echo "=== Folders from workspace ==="
62+
cat /tmp/folders.txt
63+
64+
echo ""
65+
echo "=== Checking for missing repositories in workspace ==="
66+
MISSING_IN_WORKSPACE=$(comm -23 /tmp/repos.txt /tmp/folders.txt)
67+
if [ -n "$MISSING_IN_WORKSPACE" ]; then
68+
echo "❌ Repositories missing from workspace:"
69+
echo "$MISSING_IN_WORKSPACE"
70+
exit 1
71+
else
72+
echo "✅ All repositories from init.sh are present in workspace"
73+
fi
74+
75+
echo ""
76+
echo "=== Checking for extra folders in workspace ==="
77+
EXTRA_IN_WORKSPACE=$(comm -13 /tmp/repos.txt /tmp/folders.txt)
78+
if [ -n "$EXTRA_IN_WORKSPACE" ]; then
79+
echo "⚠️ Extra folders in workspace (not in init.sh):"
80+
echo "$EXTRA_IN_WORKSPACE"
81+
echo "This might be intentional, but please verify."
82+
else
83+
echo "✅ No extra folders found in workspace"
84+
fi
85+
86+
echo ""
87+
echo "=== Summary ==="
88+
echo "✅ Repository consistency check passed!"
89+
90+
test-init-script:
91+
name: Test Init Script
92+
runs-on: ubuntu-latest
93+
94+
steps:
95+
- name: Checkout code
96+
uses: actions/checkout@v4
97+
98+
- name: Test init.sh script
99+
run: ./init.sh --shallow
100+
101+
- name: Verify apps directory structure
102+
run: |
103+
echo "=== Apps directory contents ==="
104+
ls -la apps/
105+
106+
echo ""
107+
echo "=== Expected repositories ==="
108+
# List the expected repository names from init.sh
109+
grep -A 20 'declare -a repositories=(' init.sh | \
110+
grep -E '^\s*"[^"]*"\s*"[^"]*"' | \
111+
sed -E 's/.*"[^"]*"\s*"([^"]*)".*/\1/' | \
112+
while read repo; do
113+
if [ -d "apps/$repo" ]; then
114+
echo "✅ apps/$repo exists"
115+
else
116+
echo "❌ apps/$repo missing"
117+
exit 1
118+
fi
119+
done
120+
121+
echo ""
122+
echo "✅ All expected repositories were created!"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
apps/*
2+
!apps/.gitkeep

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Open Collective
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Open Collective Monorepo
2+
3+
[![Discord](https://discordapp.com/api/guilds/1241017531318276158/widget.png)](https://discord.opencollective.com)
4+
5+
A centralized workspace for all Open Collective projects, providing a unified development environment with shared configurations, devcontainers, and tools.
6+
7+
This workspace serves as:
8+
9+
- **Central Development Hub**: Clone and setup all Open Collective projects at once
10+
- **DevContainer Configuration**: Quick development environment setup with Docker
11+
- **Shared IDE Configuration**: VS Code workspace settings and extensions
12+
- **Common Tools & Configs**: Shared configs, scripts, and development utilities
13+
14+
## Quick Start
15+
16+
### Prerequisites
17+
18+
- Git
19+
- Docker/Podman (for devcontainers)
20+
- If not using devcontainers: check individual project's README for specific setup instructions
21+
22+
**Clone this workspace and initialize all projects**:
23+
24+
```bash
25+
git clone https://github.com/opencollective/opencollective-monorepo.git opencollective
26+
cd opencollective
27+
./init.sh
28+
```
29+
30+
This will clone all projects into the `apps` directory.
31+
32+
### Running the projects
33+
34+
#### Option 1: Using DevContainer (Recommended)
35+
36+
##### With VS Code Dev Containers
37+
38+
1. Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
39+
2. Open one of the `.code-workspace` files in the `apps` directory. We recommend using `opencollective-workspace-simple.code-workspace` (a version with only the frontend and the API) in most cases.
40+
3. Press `Ctrl+Shift+P` (or `Cmd+Shift+P` on Mac) and select "Dev Containers: Reopen in Container"
41+
42+
VS Code will start with the required services (postgres, mailpit, etc.) running and a shell setup with all the necessary tooling. You will still need to install dependencies and start individual projects. To start the frontend and the API, simply open two terminals and run `npm install` followed by `npm run dev`. You can then access the frontend at [http://localhost:3000](http://localhost:3000) and the API at [http://localhost:3060](http://localhost:3060).
43+
44+
#### Option 2: Manual Setup
45+
46+
Just navigate to the projects directories (you'll probably want to start with apps/api and apps/frontend) and follow the instructions in their respective README files.
47+
48+
### Getting Help
49+
50+
- **Discord**: Join our [Discord community](https://discord.opencollective.com)
51+
- **Issues & Discussions**: [GitHub](https://github.com/opencollective/opencollective)

apps/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)