Skip to main content

Overview

GenLayer Points is a full-stack application built with:
  • Backend: Django 4.2+ (Python)
  • Frontend: Svelte 5 with Vite
  • Database: PostgreSQL (production) / SQLite (development)
  • Authentication: Sign-In With Ethereum (SIWE)

Prerequisites

Before you begin, ensure you have the following installed:
  • Python 3.8+ - Backend runtime
  • Node.js 16+ - Frontend build tools and dependencies
  • PostgreSQL (optional) - Production-grade database
  • Git - Version control
  • MetaMask or compatible wallet - For authentication testing

Quick Start

1

Clone the repository

git clone https://github.com/genlayer/points.git
cd points
2

Set up the backend

See Backend Setup for detailed instructions:
cd backend
python -m venv env
source env/bin/activate  # On Windows: env\Scripts\activate
pip install -r requirements.txt
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
3

Set up the frontend

See Frontend Setup for detailed instructions:
cd frontend
source ../backend/env/bin/activate  # Activate Python env first
npm install
npm run dev
4

Access the application

Project Structure

points/
├── backend/                # Django backend
│   ├── api/               # Core API app
│   ├── contributions/     # Contribution tracking
│   ├── leaderboard/      # Rankings and multipliers
│   ├── users/            # User management
│   ├── validators/       # Validator profiles
│   ├── builders/         # Builder profiles
│   ├── stewards/         # Steward management
│   ├── utils/            # Shared utilities
│   ├── manage.py         # Django management
│   └── requirements.txt  # Python dependencies

├── frontend/              # Svelte 5 frontend
│   ├── src/
│   │   ├── components/   # Reusable UI components
│   │   ├── routes/       # Page components
│   │   ├── lib/          # API client and utilities
│   │   └── App.svelte    # Main app with routing
│   ├── package.json      # Node dependencies
│   └── vite.config.js    # Build configuration

└── README.md             # Project documentation

Development Workflow

Branch Strategy

The dev branch is the main merging branch for all development work. Always create pull requests targeting dev, not main.
  • main - Production releases only
  • dev - Main development branch
  • feature/* - Feature branches (based on dev)
  • bugfix/* - Bug fix branches (based on dev)

Workflow Steps

  1. Create a feature branch:
    git checkout dev
    git pull origin dev
    git checkout -b feature/your-feature-name
    
  2. Make your changes and test locally
  3. Run tests:
    # Backend tests
    cd backend
    python manage.py test
    
    # Frontend tests
    cd frontend
    npm test
    
  4. Commit your changes:
    git add .
    git commit -m "Add feature: brief description"
    
  5. Push and create pull request:
    git push origin feature/your-feature-name
    
    Then create a PR targeting the dev branch.

Common Issues

Port Already in Use

If port 8000 or 5173 is already in use:
# Backend - use a different port
python manage.py runserver 8001

# Frontend - Vite will automatically try the next available port
npm run dev

Database Migrations

If you encounter migration errors:
cd backend
python manage.py migrate --fake-initial

Node.js Environment

The frontend requires activating the Python virtual environment first because the project uses nodeenv to manage Node.js within the Python environment.
cd frontend
source ../backend/env/bin/activate  # Always do this first
npm install
npm run dev

Next Steps

Backend Setup

Detailed Django backend configuration

Frontend Setup

Svelte 5 frontend development

Architecture

System architecture overview

Deployment

AWS deployment guide

Additional Resources

Build docs developers (and LLMs) love