A points and contribution tracking system for the GenLayer Foundation's Testnet Program.
Points is a comprehensive tracking system for the GenLayer Testnet Program incentives. It enables transparent monitoring of community contributions, with each action earning participants badges and points. The system serves as an experiment for developing autonomous and trustless GLF programs that will eventually be part of the Deepthought DAO.
- Track various contribution actions (Node Running, Uptime, Asimov, Blog Posts, etc.)
- Award badges and action points to participants
- Apply dynamic multipliers to transform action points into global points
- Maintain a global leaderboard of all participants
- Provide transparent and open tracking of contributions
- Backend: Python-based Django REST API
- Frontend: Svelte 5
- User: Custom user model with email as the unique identifier. Extends Django's AbstractUser with additional fields for name and address.
- ContributionType: Represents different types of contributions participants can make (e.g., Node Runner, Uptime, Asimov, Blog Post).
- Contribution: Records specific contributions made by users, with points, evidence, and notes. Tracks a frozen point value that includes the multiplier at the time of creation.
- GlobalLeaderboardMultiplier: Tracks multiplier values over time for each contribution type. Each multiplier has a valid_from date that determines when it becomes active.
- LeaderboardEntry: Represents a user's position on the leaderboard with their total points and rank.
- Action: Defines different types of actions participants can perform.
- Participant: Extends the User model with additional profile fields.
- Badge: Represents badges awarded to participants for completing actions.
- Leaderboard: Stores historical snapshots of the global leaderboard.
- LeaderboardEntry: Records a participant's position on a historical leaderboard snapshot.
- BaseModel: Abstract model providing created_at and updated_at fields for all models.
- Users make contributions of various types
- Each contribution has base points
- Contributions are multiplied by the active multiplier at the time of creation
- The resulting "global points" are frozen and used for leaderboard rankings
- Multipliers can change over time, but this doesn't affect previously awarded points
- Python 3.8+
- Node.js 16+
- PostgreSQL (optional, SQLite for development)
-
Clone the repository:
git clone https://github.com/yourusername/points.git cd points
-
Create and activate a virtual environment:
cd backend python -m venv env source env/bin/activate # On Windows: env\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Setup Node.js environment using nodeenv:
nodeenv -p
-
Run migrations:
python manage.py migrate
-
Create a superuser:
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver
-
Navigate to the frontend directory:
cd frontend
-
Install dependencies:
npm install
-
Run the development server:
npm run dev
The backend is structured into several Django apps:
- users: Custom user management
- contributions: Tracking different types of contributions
- leaderboard: Global ranking system
- utils: Shared utilities
- api: Core API functionality
The following API endpoints will be available:
/api/users/
- User management/api/auth/
- Authentication (login, refresh token)/api/contributions/
- Contribution management/api/contributions/types/
- Contribution types/api/leaderboard/
- Leaderboard data/api/leaderboard/multipliers/
- Manage contribution type multipliers/api/participants/
- Participant profiles/api/actions/
- Available actions/api/badges/
- User badges
The frontend is built with Svelte 5 and will include:
- User dashboard with personal stats
- Contribution submission forms and history
- Global leaderboard with real-time rankings
- Badge collection display
- Participant profile pages
- Admin interfaces for managing contribution types and multipliers
Contributions are welcome! Please feel free to submit a Pull Request.
- Create a feature branch:
git checkout -b feature/your-feature-name
- Make your changes
- Run tests:
python manage.py test
- Push your branch:
git push origin feature/your-feature-name
- Submit a pull request
See LICENSE for details.
GenLayer's Testnet Program aims to reach Mainnet with the most mature and decentralized ecosystem possible. It's directed at professional Validators, Developers, and Community Contributors, working together to grow the GenLayer ecosystem.