Shira is an open-source platform for creating and taking phishing awareness quizzes, with realistic scenarios across email, SMS, messaging apps and social media.
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.
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.
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.
- Node.js and npm installed
- Docker and Docker Compose installed
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/.envSet 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.
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 --tagsThis 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.
- Install dependencies from the repo root:
npm install- Create the shared Docker network once:
docker network create shira-network- Start MySQL and Redis for the API:
docker compose -f apps/api/docker-compose.required.yml up -d- Start the workspace from the repo root:
npm run devDon't forget to build from root if you made changes in the shira-ui package:
npm run build- You can also run Storybook from
packages/shira-ui:
cd packages/shira-ui
npm run storybookThis 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.tsShira 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!
