The project updates the chart implementation (@visactor/vchart) and introduces MongoDB for data caching to reduce GitHub API calls and improve performance. Added a dark theme.
gitdata.xuanhun520.com, provides missing data statistics and visualization capabilities for GitHub repositories, such as star history chart functionality.
👆 THIS is a live chart created with the following HTML code: 👇
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://gitdata.xuanhun520.com/api/starimg?repos=visactor/vchart&type=Date&theme=dark" />
<source media="(prefers-color-scheme: light)" srcset="https://gitdata.xuanhun520.com/api/starimg?repos=visactor/vchart&type=Date" />
<img style="width: 800px; height: 533px;" alt="Star History Chart" src="https://gitdata.xuanhun520.com/api/starimg?repos=visactor/vchart&type=Date" />
</picture>- Based on VChart.
- Support viewing detailed data
- One-click generation of high-quality chart images;
- Support multiple chart view modes,
based on date or timeline; - Embed real-time charts into
GitHub readme or other websites(like the example we embedded at the top); - And various useful functions:
- Toggle repository visibility;
- Shortcut to input repository name;
- Quick share to
social networks; - Support input multiple repositories;
- ...more features waiting for you to discover!
Star-history is built using a modern tech stack: Vue + Vite + TailwindCSS + @Visactor/VChart.
pnpm i-
Main website is the homepage of gitdata, containing most useful features and blogs about
VisActor open source.pnpm dev
The website will be served at http://localhost:3000.
-
API Server is an
experimental feature. It's mainly used to generate chartSVGorPNGimage files that can be embedded intoGitHub readme.- MongoDB Community Server (for caching repository data)
Note: After changing the password, remember to update the connection string in your
.envfile or environment variables.Set Environment Variables:
MongoDB configuration can be modified according to your actual situation.
# Set MongoDB connection string export MONGODB_URI="mongodb://[username]:[password]@localhost:27017/gitdata" export MONGODB_DB_NAME="gitdata" export MONGODB_COLLECTION_NAME="repo_cache"
Or create a
.envfile in theserverdirectory:MONGODB_URI=mongodb://xuanhun:xuanhun@localhost:27017/gitdata MONGODB_DB_NAME=gitdata MONGODB_COLLECTION_NAME=repo_cache
cd server pnpm i && pnpm dev
The API server will be running on http://localhost:8080 (or https://localhost:8080 if HTTPS is enabled).
The backend service requires your own GitHub token, placed in the
token.envfile.To enable HTTPS for the frontend:
-
Generate SSL certificates (for development):
./scripts/generate-ssl-cert.sh
This will create self-signed certificates in the
certs/directory. -
For Frontend (Vite):
The Vite dev server will automatically use HTTPS if certificates are found in
certs/directory, or you can specify custom paths:export SSL_CERT_PATH=/path/to/cert.crt export SSL_KEY_PATH=/path/to/key.key pnpm dev
- Add more editing and annotation features
- View and edit VChart code, export to VChart official editor
- Generate star history animated videos (GIF)
- More GitHub data statistics and analysis features
