Skip to content

Latest commit

 

History

77 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AA Example.

Warning

Before you create Models, etc remove the 0001_initial.py from migrations folder if you dont have created own one.

A Example App that templating example to example


Features

  • Modern React SPA Frontend:
    • React 19, TypeScript, and Vite build pipeline
    • Tailwind CSS v4 styling, custom sci-fi theme variables, and responsive layouts
    • Lucide icons (lucide-react) and status indicators (LiveStatusIndicator, SecurityBadge)
    • TanStack Query (@tanstack/react-query) for cached state management & TanStack Table (@tanstack/react-table) for sortable, searchable data tables
    • Full internationalization (i18next / react-i18next) with translations for 12 languages
    • Type-safe API communication using openapi-fetch and auto-generated TypeScript schemas
  • Django Ninja REST API:
    • Modular API endpoints (/example/api/) with interactive OpenAPI documentation
    • Automated schema and TypeScript type generation via Makefile
  • Example Boilerplate:
    • Clean Alliance Auth app architecture (models, managers, tasks, forms, and views)
    • Pre-configured unit tests for backend (AuthTestCase) and frontend (Vitest + Testing Library)

Installation

Note

AA Example needs at least Alliance Auth v5 Please make sure to update your Alliance Auth before you install this APP

Step 1 - Install the Package

Make sure you're in your virtual environment (venv) of your Alliance Auth then install the pakage.

pip install aa-example

Step 2 - Configure Alliance Auth

Configure your Alliance Auth settings (local.py) as follows:

INSTALLED_APPS = [
    # other apps
    "eve_sde",  # only if it not already existing
    "example",
    # other apps?
]

# This line is right below the `INSTALLED_APPS` list, if not already exist!
INSTALLED_APPS = ["modeltranslation"] + INSTALLED_APPS

Step 3 - Add the Scheduled Tasks

To set up the Scheduled Tasks add following code to your local.py

if "example" in INSTALLED_APPS:
    CELERYBEAT_SCHEDULE["AA Example :: Test Task"] = {
        "task": "example.tasks.example_task",
        "schedule": crontab(minute=0, hour="*/1"),
    }

Step 3.1 - (Optional) Add own Logger File

To set up the Logger add following code to your local.py Ensure that you have writing permission in logs folder.

LOGGING["handlers"]["example_file"] = {
    "level": "INFO",
    "class": "logging.handlers.RotatingFileHandler",
    "filename": os.path.join(BASE_DIR, "log/example.log"),
    "formatter": "verbose",
    "maxBytes": 1024 * 1024 * 5,
    "backupCount": 5,
}
LOGGING["loggers"]["extensions.example"] = {
    "handlers": ["example_file"],
    "level": "DEBUG",
}

Step 4 - Migrate & Preload EVE SDE Data

AA Skillfarm uses EVE SDE data to map IDs to names for EveTypes. You will need to preload some data from SDE once.

python manage.py migrate eve_sde
python manage.py esde_load_sde

Step 4.1 - Migrate App and collect static

Migrate the app and collect static.

python manage.py migrate example
python manage.py collectstatic --noinput

Step 5 - Setting up Permissions

With the Following IDs you can set up the permissions for the Example

ID Description Details
basic_access Can access the Example module All members with this permission can access the Example module.
manage_access Can Manage Example module Can manage application settings and data.
full_access Full access to Example module Administrative access with full management permissions.

Step 6 - (Optional) Setting up Compatibilies

The Following Settings can be setting up in the local.py

  • EXAMPLE_APP_NAME: "YOURNAME" - Set the name of the APP
  • EXAMPLE_TASKS_TIME_LIMIT: 7200 - Defines the time (in seconds) a task will timeout

If you set up EXAMPLE_LOGGER_USE to True you need to add the following code below:

Frontend Development (React SPA)

The user interface of AA Example is built as a modern React Single-Page Application (SPA) located in the frontend/ directory.

Tech Stack

  • Framework: React 19, TypeScript
  • Bundler & Tooling: Vite 8 (@vitejs/plugin-react-swc), Tailwind CSS v4 (@tailwindcss/vite)
  • UI Components & Icons: React-Bootstrap, Lucide Icons (lucide-react)
  • Data & Tables: TanStack React Query (@tanstack/react-query), TanStack Table (@tanstack/react-table)
  • API Client: openapi-fetch with types generated via openapi-typescript
  • Testing: Vitest with @testing-library/react and jsdom
  • Localization: i18next & react-i18next (12 languages)

Frontend Makefile Commands

You can control the frontend build, test, and development workflows directly from the repository root:

Command Description
make react-dev Starts the Vite development server with proxy to backend
make react-build Runs TypeScript compilation (tsc -b) and Vite production build
make react-test Runs Vitest unit tests
make react-lint Runs ESLint verification
make react-eslint Runs ESLint with automated fixes (--fix)
make react-test-build Runs build, asset copy, translation sync, and collectstatic
make react-release Runs full release build (build, i18n scan, asset copy, collectstatic)
make react-copy-assets Copies Vite production build artifacts to Django's static directory
make react-copy-translations Copies frontend i18n translations to Django's static directory
make react-translations Scans source code and updates i18n translation files
make react-openapi Exports Django Ninja OpenAPI schema and regenerates TypeScript types
make react-clean Cleans React build directory

Local Frontend Development

  1. Install dependencies:

    cd frontend
    npm install
  2. Start Vite development server:

    # Inside frontend/
    npm run dev
    
    # Or from repository root:
    make react-dev
  3. Run tests and linter:

    make react-test
    make react-lint

Translations

Translations

Help us translate this app into your language or improve existing translations. Join our team!"

Contributing

You want to improve the project? Please ensure you read the Contribution Guidelines

About

A Template for Alliance Auth Module Creation

Topics

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages