Skip to content
Horizontal-orgPublic

About

No description, website, or topics provided.

Resources

Stars

9 stars

Watchers

0 watching

Forks

Repository files navigation

Shira logo

Translation status

Shira

Shira is an open-source platform for creating and taking phishing awareness quizzes, with realistic scenarios across email, SMS, messaging apps and social media.

Looking for help using Shira?

This repository contains Shira's source code and is mainly aimed at developers and people self-hosting Shira.

If you're looking for guides on how to use Shira (creating quizzes, managing learners, viewing results and more) visit the Shira Help Center.

You can also try a ready-made quiz or contact us.

About this repository

Shira is a Turborepo monorepo with a NestJS API, a public-facing quiz app, an internal spaces app, and shared packages used across the workspace.

Looking to deploy Shira? See the self-hosting guide.

Workspace

  • apps/api: NestJS backend for auth, quizzes, learners, subscriptions, email, and integrations.
  • apps/public: Public quiz experience for learners and invite flows.
  • apps/spaces: Internal product for managing quizzes, questions, learners, and organizations.
  • packages/shira-ui: Shared UI components used by the frontend apps.

Prerequisites

  • Node.js and npm installed
  • Docker and Docker Compose installed

Local development environment

Copy the app env files before starting:

cp apps/api/.env.example apps/api/.env
cp apps/public/.env.example apps/public/.env
cp apps/spaces/.env.example apps/spaces/.env

Set ENABLE_PUBLIC_LIBRARY=false in apps/api/.env to disable the public quiz library on self-hosted instances that don't want to depend on the public library service.

To generate passwords for local services and add them to the relevant app-level .env file, use openssl rand -hex 32.

Releases

When starting development on a new Shira version, update the root package.json version field (for example, 2.X.Y).

Once the related commits have been merged into main, create and tag the new release:

git switch main
git pull
# Update version number in the root .env.example
$EDITOR .env.example
# Commit the version
git add .env.example
git commit -m 2.X.Y
# Follow semver.org
git tag 2.X.Y
git push
git push --tags

This will start the auto build on https://hub.docker.com/u/horizontalorg and publish the new images. After this process is done, you can create a release on Github.

Local Development

  1. Install dependencies from the repo root:
npm install
  1. Create the shared Docker network once:
docker network create shira-network
  1. Start MySQL and Redis for the API:
docker compose -f apps/api/docker-compose.required.yml up -d
  1. Start the workspace from the repo root:
npm run dev

Don't forget to build from root if you made changes in the shira-ui package:

npm run build
  1. You can also run Storybook from packages/shira-ui:
cd packages/shira-ui
npm run storybook

This starts:

  • API on http://localhost:3000
  • Public app on http://localhost:3001
  • Spaces app on http://localhost:3002

Run API migrations from apps/api after the backend is up:

cd apps/api
npm run typeorm -- migration:run -d ./src/utils/datasources/mysql.datasource.ts

App Docs

Translations

Shira is translated by users and supporters on Weblate. If you'd like to help make Shira available in your language, you can join and start translating there — no coding required. If you need any help, please contact us!

About

No description, website, or topics provided.

Resources

Stars

9 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages