Skip to content

Commit 0d0ab2c

Browse files
committed
the data updates
1 parent 649718e commit 0d0ab2c

55 files changed

Lines changed: 3809 additions & 806 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ DATABASE_URL=postgresql://username:password@localhost:5432/dbname
1010
REDIS_URL=redis://localhost:6379/0
1111

1212
# GitHub API Configuration
13-
GITHUB_ACCESS_TOKEN=your_github_personal_access_token_here
13+
GITHUB_TOKEN=your_primary_token_here
14+
GITHUB_TOKENS=token1,token2,token3 # Comma-separated list for rotation
1415
GITHUB_CLIENT_ID=your_github_oauth_client_id
1516
GITHUB_CLIENT_SECRET=your_github_oauth_client_secret
1617

README.md

Lines changed: 79 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -1,153 +1,94 @@
1-
# GitHub Management Project
2-
3-
A comprehensive Django-based application for managing GitHub repositories, users, and automating GitHub-related tasks. This project provides a robust backend with GraphQL API, task scheduling with Celery, and secure deployment configurations.
4-
5-
## 🚀 Features
6-
7-
- **GitHub Integration**: Interact with GitHub's API to manage repositories and user data
8-
- **Task Automation**: Schedule and manage background tasks with Celery
9-
- **GraphQL API**: Flexible and efficient data querying with Graphene-Django
10-
- **User Authentication**: Secure authentication system with JWT support
11-
- **Background Processing**: Asynchronous task processing with Redis and Celery
12-
- **REST API**: Traditional REST endpoints for compatibility
13-
- **Deployment Ready**: Includes deployment scripts for production environments
14-
15-
---
16-
# Example of the screenshoot
17-
18-
<img width="2562" height="1662" alt="image" src="https://github.com/user-attachments/assets/cfa10b06-9bdb-4a84-bfb0-4528a077e514" />
19-
20-
## 🛠️ Tech Stack
21-
22-
- **Backend**: Django 5.1.6
23-
- **Database**: PostgreSQL
24-
- **Task Queue**: Celery with Redis as broker
25-
- **Authentication**: JWT (JSON Web Tokens)
26-
- **API**: GraphQL (Graphene-Django) & REST
27-
- **Frontend**: (To be implemented or specify if exists)
28-
- **Deployment**: Gunicorn, Nginx, Let's Encrypt
29-
30-
## 📦 Prerequisites
31-
32-
- Python 3.8+
33-
- PostgreSQL
34-
- Redis
35-
- GitHub OAuth App credentials
36-
- Virtual environment (recommended)
37-
38-
## 🚀 Getting Started
39-
40-
### Environment Setup
41-
42-
1. Clone the repository:
43-
```bash
44-
git clone <repository-url>
45-
cd RB
46-
```
47-
48-
2. Create and activate a virtual environment:
49-
```bash
50-
python -m venv venv
51-
source venv/bin/activate # On Windows: venv\Scripts\activate
52-
```
53-
54-
3. Install dependencies:
55-
```bash
56-
pip install -r requirements.txt
57-
```
58-
59-
4. Create a `.env` file in the project root with the following variables:
60-
```env
61-
DEBUG=True
62-
SECRET_KEY=your-secret-key-here
63-
DATABASE_URL=postgres://user:password@localhost:5432/dbname
64-
REDIS_URL=redis://localhost:6379/0
65-
GITHUB_ACCESS_TOKEN=your-github-token
66-
```
67-
68-
### Database Setup
69-
70-
1. Create a PostgreSQL database
71-
2. Run migrations:
72-
```bash
73-
python manage.py migrate
74-
```
75-
76-
### Running the Application
77-
78-
1. Start the development server:
79-
```bash
80-
python manage.py runserver
81-
```
82-
83-
2. Start Celery worker (in a new terminal):
84-
```bash
85-
celery -A github_management_project worker -l info
86-
```
87-
88-
3. Start Celery beat for scheduled tasks (in another terminal):
89-
```bash
90-
celery -A github_management_project beat -l info
91-
```
92-
93-
## 🔐 Environment Variables
94-
95-
| Variable | Description | Required |
96-
|----------|-------------|----------|
97-
| `DEBUG` | Enable debug mode | Yes |
98-
| `SECRET_KEY` | Django secret key | Yes |
99-
| `DATABASE_URL` | Database connection URL | Yes |
100-
| `REDIS_URL` | Redis connection URL | Yes |
101-
| `GITHUB_ACCESS_TOKEN` | GitHub personal access token | Yes |
102-
| `ALLOWED_HOSTS` | Comma-separated list of allowed hosts | Yes |
103-
| `CORS_ALLOWED_ORIGINS` | Comma-separated list of allowed origins | No |
104-
105-
## 🧪 Running Tests
106-
107-
```bash
108-
python manage.py test
109-
```
1+
# 🚀 GitHub Management & Developer Hub
1102

111-
## 🚀 Deployment
3+
Transform your GitHub journey into an engaging experience. This platform isn't just a management tool—it's a social and gamified ecosystem designed to help developers showcase their growth, compete with peers, and discover new opportunities.
1124

113-
### Production Setup
5+
---
1146

115-
1. Set up a production-ready web server (Nginx recommended)
116-
2. Configure Gunicorn as the application server
117-
3. Set up SSL certificates (Let's Encrypt recommended)
118-
4. Use the deployment script:
119-
```bash
120-
sudo ./deploy_django.sh
121-
```
7+
## 🌟 Key Features
1228

123-
### Environment Configuration
9+
### 🏆 Unlock Achievements
10+
Get recognized for your hard work! Whether you're a "Star Magnet," a "Commit Machine," or a "Polyglot Programmer," our achievement system tracks your milestones across multiple tiers.
11+
- **Tiers**: Progress from Bronze to legendary Gold ranks.
12+
- **Showcase**: Display your hard-earned badges on your profile.
12413

125-
For production, ensure these settings are properly configured:
126-
- `DEBUG=False`
127-
- Proper `ALLOWED_HOSTS`
128-
- Secure `SECRET_KEY`
129-
- Production database settings
130-
- Proper CORS configuration
14+
### 📊 Competitive Leaderboards
15+
See where you stand in the developer community. Our **Intelligence Score** algorithm ranks users fairly based on activity, impact, and influence.
16+
- **Global & Regional**: Compete globally or be the #1 in your country.
17+
- **Tech-Specific**: Find out if you're the top React developer in your region.
13118

132-
## 🤝 Contributing
19+
### 🔍 Discovery & Matching
20+
Stop searching, start finding.
21+
- **Discovery Feed**: Get personalized recommendations for developers and trending repositories.
22+
- **Developer Match**: Connect with collaborators having complementary skills for your next project.
13323

134-
1. Fork the repository
135-
2. Create a feature branch (`git checkout -b feature/AmazingFeature`)
136-
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
137-
4. Push to the branch (`git push origin feature/AmazingFeature`)
138-
5. Open a Pull Request
24+
### 📈 Personal Growth Analytics
25+
Watch your influence grow with daily snapshots of your progress.
26+
- **Trends**: Track followers, stars, and contribution streaks.
27+
- **Visual Insights**: Interactive charts showing your growth velocity.
13928

140-
## 📄 License
29+
---
14130

142-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
31+
## 📖 User Guide & Use Cases
14332

144-
## 🙏 Acknowledgments
33+
### 1. Setting up your Profile
34+
To get the most out of the system, you first need to sync your GitHub data:
35+
- **Step 1**: Sign in using your GitHub account.
36+
- **Step 2**: Go to your **Profile** page.
37+
- **Step 3**: Click on "Sync GitHub Data" (or wait for the automatic daily sync) to fetch your repositories, stars, and languages.
14538

146-
- Django and the Django community
147-
- Celery for task queue management
148-
- All open-source libraries used in this project
39+
### 2. Using GitHub Profile Trophies
40+
You can display your platform trophies directly on your GitHub README.
41+
**Copy and paste the markdown below into your GitHub README.md:**
14942

150-
## 📧 Contact
43+
```markdown
44+
[![GitHub Trophies](https://github.tarxemo.com/badges/YOUR_USERNAME/trophies/)](https://github.tarxemo.com/github/user/YOUR_USERNAME/)
45+
```
46+
*Replace `YOUR_USERNAME` with your actual GitHub username.*
47+
48+
### 3. Climbing the Leaderboard
49+
Want to reach the top? The system calculates your **Intelligence Score** based on:
50+
- **Activity**: Recent commits and pull requests.
51+
- **Impact**: Total stars and forks on your repositories.
52+
- **Influence**: Your follower count and organization associations.
53+
Check the [Leaderboard](https://github.tarxemo.com/github/leaderboard/) daily to see your new rank!
54+
55+
### 4. Discovering Collaborators
56+
Looking for someone to help with a Python project?
57+
- Go to the **Discovery** feed.
58+
- Look at the "Recommended Developers" section.
59+
- Click "Match" on a profile to see your compatibility score based on shared languages and interests.
60+
61+
---
62+
63+
## 🚀 Getting Started (Deployment)
64+
65+
### 🛠️ Local Development Setup
66+
67+
1. **Clone & Install**:
68+
```bash
69+
git clone <repository-url>
70+
pip install -r requirements.txt
71+
```
72+
2. **Environment**: Create a `.env` file with your `GITHUB_TOKEN` and database credentials.
73+
3. **Migrate & Run**:
74+
```bash
75+
python manage.py migrate
76+
python manage.py runserver 9000
77+
```
78+
4. **Celery Workers**:
79+
```bash
80+
# Run in separate terminals
81+
celery -A github_management_project worker -l info
82+
celery -A github_management_project beat -l info
83+
```
84+
85+
---
86+
87+
## 📄 License
88+
This project is licensed under the MIT License.
15189

90+
---
15291

92+
## 🙏 Join the community
93+
Join us in building the ultimate developer ecosystem!
15394
Project Link: [https://github.tarxemo.com](https://github.tarxemo.com)

badges/migrations/0001_initial.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Generated by Django 4.2.28 on 2026-02-09 08:27
2+
3+
from django.conf import settings
4+
from django.db import migrations, models
5+
import django.db.models.deletion
6+
import django.utils.timezone
7+
8+
9+
class Migration(migrations.Migration):
10+
11+
initial = True
12+
13+
dependencies = [
14+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
15+
]
16+
17+
operations = [
18+
migrations.CreateModel(
19+
name='Achievement',
20+
fields=[
21+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
22+
('name', models.CharField(max_length=100, unique=True)),
23+
('slug', models.SlugField(max_length=100, unique=True)),
24+
('description', models.TextField()),
25+
('icon_name', models.CharField(help_text='Lucide icon name or CSS class', max_length=50)),
26+
('points', models.PositiveIntegerField(default=10)),
27+
('tier', models.CharField(choices=[('bronze', 'Bronze'), ('silver', 'Silver'), ('gold', 'Gold'), ('platinum', 'Platinum'), ('diamond', 'Diamond')], default='bronze', max_length=20)),
28+
('condition_type', models.CharField(help_text="e.g., 'followers_count', 'contributions'", max_length=50)),
29+
('condition_value', models.IntegerField()),
30+
('created_at', models.DateTimeField(auto_now_add=True)),
31+
('is_active', models.BooleanField(default=True)),
32+
],
33+
options={
34+
'ordering': ['points'],
35+
},
36+
),
37+
migrations.CreateModel(
38+
name='UserAchievement',
39+
fields=[
40+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
41+
('earned_at', models.DateTimeField(default=django.utils.timezone.now)),
42+
('current_progress', models.IntegerField(default=0)),
43+
('is_unlocked', models.BooleanField(default=False)),
44+
('achievement', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='earned_by', to='badges.achievement')),
45+
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='achievements', to=settings.AUTH_USER_MODEL)),
46+
],
47+
options={
48+
'ordering': ['-earned_at'],
49+
'unique_together': {('user', 'achievement')},
50+
},
51+
),
52+
]

badges/migrations/__init__.py

Whitespace-only changes.

badges/models.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
from django.db import models
2+
from django.conf import settings
3+
from django.utils import timezone
4+
5+
class Achievement(models.Model):
6+
"""Definition of an achievement that can be earned by users."""
7+
8+
name = models.CharField(max_length=100, unique=True)
9+
slug = models.SlugField(max_length=100, unique=True)
10+
description = models.TextField()
11+
icon_name = models.CharField(max_length=50, help_text="Lucide icon name or CSS class")
12+
points = models.PositiveIntegerField(default=10)
13+
14+
class Tier(models.TextChoices):
15+
BRONZE = 'bronze', 'Bronze'
16+
SILVER = 'silver', 'Silver'
17+
GOLD = 'gold', 'Gold'
18+
PLATINUM = 'platinum', 'Platinum'
19+
DIAMOND = 'diamond', 'Diamond'
20+
21+
tier = models.CharField(
22+
max_length=20,
23+
choices=Tier.choices,
24+
default=Tier.BRONZE
25+
)
26+
27+
# Conditions (simplified for now, logic will be in services)
28+
condition_type = models.CharField(max_length=50, help_text="e.g., 'followers_count', 'contributions'")
29+
condition_value = models.IntegerField()
30+
31+
created_at = models.DateTimeField(auto_now_add=True)
32+
is_active = models.BooleanField(default=True)
33+
34+
class Meta:
35+
ordering = ['points']
36+
37+
def __str__(self):
38+
return f"{self.name} ({self.tier})"
39+
40+
class UserAchievement(models.Model):
41+
"""Relationship between a User and an Achievement they've earned."""
42+
43+
user = models.ForeignKey(
44+
settings.AUTH_USER_MODEL,
45+
on_delete=models.CASCADE,
46+
related_name='achievements'
47+
)
48+
achievement = models.ForeignKey(
49+
Achievement,
50+
on_delete=models.CASCADE,
51+
related_name='earned_by'
52+
)
53+
earned_at = models.DateTimeField(default=timezone.now)
54+
55+
# For tiered achievements that might have progress
56+
current_progress = models.IntegerField(default=0)
57+
is_unlocked = models.BooleanField(default=False)
58+
59+
class Meta:
60+
unique_together = ('user', 'achievement')
61+
ordering = ['-earned_at']
62+
63+
def __str__(self):
64+
return f"{self.user} - {self.achievement}"

badges/schema.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import graphene
2+
from graphene_django import DjangoObjectType
3+
from .models import Achievement, UserAchievement
4+
5+
class AchievementType(DjangoObjectType):
6+
class Meta:
7+
model = Achievement
8+
fields = "__all__"
9+
10+
class UserAchievementType(DjangoObjectType):
11+
class Meta:
12+
model = UserAchievement
13+
fields = "__all__"
14+
15+
class Query(graphene.ObjectType):
16+
all_achievements = graphene.List(AchievementType)
17+
user_achievements = graphene.List(UserAchievementType, username=graphene.String(required=True))
18+
19+
def resolve_all_achievements(self, info):
20+
return Achievement.objects.filter(is_active=True)
21+
22+
def resolve_user_achievements(self, info, username):
23+
return UserAchievement.objects.filter(user__github_username=username, is_unlocked=True)

0 commit comments

Comments
 (0)