Skip to content

Commit 37f6ae7

Browse files
committed
resolve merge conflicts
2 parents e48f11d + 2efa98a commit 37f6ae7

10 files changed

Lines changed: 510 additions & 372 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ src/assets/data
66
dist
77
tests/config.txt
88
configBackup.json
9+
.env

AGENTS.md

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ The rank column and some aggregate stats are rendered with invisible/white text.
5050
```bash
5151
git clone <repo-url> && cd Opensource-Contribution-Leaderboard
5252
cp src/server/config-example.json src/server/config.json
53-
# Edit config.json with your GitHub token + org + contributors
53+
cp src/server/.env.example src/server/.env
54+
# Edit .env with your GitHub token, org, admin password, etc.
55+
# Edit config.json with your contributors list
5456
npm run add
5557
npm run build
5658
cd dist/server
@@ -72,26 +74,36 @@ npm run serve # backend API server
7274
```
7375

7476
Frontend: http://localhost:8080
75-
Backend port: whatever `serverPort` is set to in config.json (default 62050)
77+
Backend port: whatever `SERVER_PORT` is set to in .env (default 62050)
7678

7779
## Config Reference
7880

81+
Static/environment settings live in `.env` (copy from `src/server/.env.example`):
82+
83+
```bash
84+
AUTH_TOKEN=ghp_YOUR_GITHUB_TOKEN # required — GitHub personal access token
85+
ORGANIZATION=YourOrg # required — GitHub org name
86+
ORGANIZATION_HOMEPAGE=https://yourorg.com/
87+
ORGANIZATION_GITHUB_URL=https://github.com/YourOrg
88+
ADMIN_PASSWORD=change-this # required — admin panel password
89+
SERVER_PORT=62050 # backend API port
90+
```
91+
92+
Dynamic/runtime values stay in `config.json` (modifiable via admin panel):
93+
7994
```json
8095
{
81-
"organization": "YourOrg",
82-
"organizationHomepage": "https://yourorg.com/",
83-
"organizationGithubUrl": "https://github.com/YourOrg",
84-
"authToken": "ghp_YOUR_GITHUB_TOKEN",
85-
"adminPassword": "change-this",
8696
"delay": "10",
87-
"serverPort": "62050",
88-
"contributors": ["user1", "user2"]
97+
"startDate": "2025-06-01",
98+
"contributors": ["user1", "user2"],
99+
"includedRepositories": ["Repo1", "Repo2"]
89100
}
90101
```
91102

92-
- `authToken` — required. GitHub personal access token with repo read access.
93103
- `delay` — seconds between API calls per contributor (respect rate limits).
94-
- `contributors` — array of GitHub usernames to track. Add users here even before their first contribution.
104+
- `startDate` — filter contributions from this date onwards.
105+
- `contributors` — array of GitHub usernames to track.
106+
- `includedRepositories` — repos to include in contribution tracking.
95107

96108
## Rules for Agents
97109

GEMINI.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,34 @@ npm start # webpack-dev-server on :8080
4242
npm run serve # backend on :62050 (in a second terminal)
4343
```
4444

45-
## Config File (src/server/config.json)
45+
## Config
46+
47+
Static/environment settings live in `.env` (copy from `src/server/.env.example`):
48+
49+
```bash
50+
AUTH_TOKEN=ghp_... # GitHub personal access token
51+
ORGANIZATION=YourOrg # GitHub org name
52+
ORGANIZATION_HOMEPAGE=https://yourorg.com/
53+
ORGANIZATION_GITHUB_URL=https://github.com/YourOrg
54+
ADMIN_PASSWORD=change-this # admin panel password
55+
SERVER_PORT=62050 # backend API port
56+
```
57+
58+
Dynamic/runtime values stay in `config.json` (modifiable via admin panel):
4659

4760
```json
4861
{
49-
"organization": "YourOrg",
50-
"organizationHomepage": "https://yourorg.com/",
51-
"organizationGithubUrl": "https://github.com/YourOrg",
52-
"authToken": "ghp_...",
53-
"adminPassword": "change-this",
5462
"delay": "10",
55-
"serverPort": "62050",
56-
"contributors": ["username1", "username2"]
63+
"startDate": "2025-06-01",
64+
"contributors": ["username1", "username2"],
65+
"includedRepositories": ["Repo1", "Repo2"]
5766
}
5867
```
5968

60-
- `authToken` — GitHub personal access token (needed for API rate limits)
6169
- `delay` — seconds between each contributor's API poll
70+
- `startDate` — filter contributions from this date onwards
6271
- `contributors` — GitHub usernames to track
72+
- `includedRepositories` — repos to include in tracking
6373

6474
## Design Decisions You Must Respect
6575

README.md

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,28 @@ cd Opensource-Contribution-Leaderboard
2323

2424
# 2. Create your config
2525
cp src/server/config-example.json src/server/config.json
26+
cp src/server/.env.example src/server/.env
2627
```
2728

28-
Edit `src/server/config.json`:
29+
Edit `src/server/.env` with your static settings:
30+
31+
```bash
32+
AUTH_TOKEN=ghp_YOUR_GITHUB_TOKEN
33+
ORGANIZATION=YourOrg
34+
ORGANIZATION_HOMEPAGE=https://yourorg.com/
35+
ORGANIZATION_GITHUB_URL=https://github.com/YourOrg
36+
ADMIN_PASSWORD=pick-something-better
37+
SERVER_PORT=62050
38+
```
39+
40+
Edit `src/server/config.json` with dynamic/runtime values:
2941

3042
```json
3143
{
32-
"organization": "YourOrg",
33-
"organizationHomepage": "https://yourorg.com/",
34-
"organizationGithubUrl": "https://github.com/YourOrg",
35-
"authToken": "ghp_YOUR_GITHUB_TOKEN",
36-
"adminPassword": "pick-something-better",
3744
"delay": "10",
38-
"serverPort": "62050",
39-
"contributors": ["contributor1", "contributor2", "contributor3"]
45+
"startDate": "2025-06-01",
46+
"contributors": ["contributor1", "contributor2"],
47+
"includedRepositories": ["Repo1", "Repo2"]
4048
}
4149
```
4250

@@ -56,14 +64,25 @@ Open **http://localhost:8080** — you're done.
5664

5765
## Config Reference
5866

67+
Static settings live in `.env`:
68+
69+
| Env Variable | What it is |
70+
|---|---|
71+
| `AUTH_TOKEN` | GitHub personal access token (repo read access) |
72+
| `ORGANIZATION` | Your GitHub org name |
73+
| `ORGANIZATION_HOMEPAGE` | Org homepage URL |
74+
| `ORGANIZATION_GITHUB_URL` | Org GitHub URL |
75+
| `ADMIN_PASSWORD` | Password for the admin panel |
76+
| `SERVER_PORT` | Internal backend port (default 62050) |
77+
78+
Dynamic settings live in `config.json` (modifiable via admin panel):
79+
5980
| Key | What it is |
6081
|---|---|
61-
| `organization` | Your GitHub org name |
62-
| `authToken` | GitHub personal access token (repo read access) |
63-
| `adminPassword` | Password for the admin panel |
6482
| `delay` | Seconds between API calls per contributor (respect rate limits) |
65-
| `serverPort` | Internal backend port (default 62050) |
83+
| `startDate` | Filter contributions from this date onwards |
6684
| `contributors` | Array of GitHub usernames to track |
85+
| `includedRepositories` | Repos to include in contribution tracking |
6786

6887
## Local Development
6988

src/server/.env.example

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Leaderboard .env configuration
2+
# Copy this file to .env and fill in your values.
3+
# Static/environment-specific settings live here.
4+
# Dynamic values (contributors, delay, startDate, includedRepositories)
5+
# remain in config.json since they are modified at runtime via the admin panel.
6+
7+
# GitHub personal access token (repo read access) — REQUIRED
8+
AUTH_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxx
9+
10+
# GitHub organization name — REQUIRED
11+
ORGANIZATION=RocketChat
12+
13+
# Organization homepage URL
14+
ORGANIZATION_HOMEPAGE=https://rocket.chat/
15+
16+
# Organization GitHub URL
17+
ORGANIZATION_GITHUB_URL=https://github.com/RocketChat
18+
19+
# Admin panel password — REQUIRED
20+
ADMIN_PASSWORD=change-this
21+
22+
# Server port for the backend API
23+
SERVER_PORT=62050
24+
25+
# Path overrides (relative to src/server/)
26+
# CONFIG_PATH=./config.json
27+
# ADMINDATA_PATH=./admindata.json
28+
# DATA_PATH=../assets/data/data.json
29+
# LOG_PATH=../assets/data/log.json
30+
# DATA_BASE_PATH=../assets/data
31+
# CONFIG_BACKUP_PATH=../../configBackup.json

0 commit comments

Comments
 (0)