Languages: Polski (default) · English · Українська
Educational platform for schools (Web panels + API for a mobile app).
More documentation (including user flows, roles/screens and API/Swagger) is available in docs/README.md.
- Ruby:
3.4.6(see.ruby-version) - PostgreSQL: 13+ (15+ recommended)
- Node.js + Yarn (repo uses
yarn@3.2.0, seepackage.json) - Elasticsearch 8.x (optional; recommended for “School videos” search)
- FFmpeg (optional; auto
duration_sec+ thumbnails for uploaded videos) - Redis + Sidekiq (optional in dev; needed if you run jobs via Sidekiq like in prod)
- PostgreSQL 15+
- Node.js (assets:
esbuild/sass) - Elasticsearch 8.x (optional)
Defaults live in config/settings.yml (many values have ENV fallbacks).
Common environment variables:
DATABASE_URL(or standard PG vars)DEVISE_JWT_SECRET_KEY(JWT secret; dev has a fallback inconfig/settings.yml)ELASTICSEARCH_URL(if you use ES; defaulthttp://localhost:9200)TWILIO_*/SMTP_*/YOUTUBE_*(optional integrations)
bin/rails db:prepareOptional sample data (dev):
bin/rails db:seed- Install Ruby deps:
bundle install- Install JS deps:
corepack enable
yarn install- Prepare DB and run dev (Rails + JS/CSS watchers):
bin/setupAlternatively:
bin/rails db:prepare
bin/devbundle exec rspecEnd-to-end tests simulate real user interactions in a browser.
Requirements:
- Node.js + Yarn (Puppeteer installed automatically)
- Running application on
localhost:3000 - Test data in database (
rake db:seed)
Run all tests:
# Headless mode (fast, no visible browser)
rake test
# GUI mode (visible browser with cursor)
rake test:guiRun a single test:
# Headless
rake test[superadmin-menu]
# With visible browser
rake test[superadmin-menu,gui]Available tests:
| Test | Description |
|---|---|
superadmin-menu |
Superadmin panel menu navigation |
superadmin-users |
User management (filtering, editing) |
superadmin-content |
Content management (subjects, modules) |
principal-dashboard |
Principal panel menu |
principal-management |
Class, teacher, student management |
teacher-dashboard |
Teacher panel menu |
teacher-dashboard-full |
Full teacher functionality test |
student-dashboard |
Student panel menu |
student-dashboard-full |
Full student functionality test |
theme-switcher |
Light/dark theme switching |
dashboard-switcher |
Teacher↔principal dashboard switching |
subjects-dragdrop |
Subject drag & drop |
Details in e2e/README.md.
UI is available at /api-docs/index.html and serves docs/swagger/v1/swagger.yaml.
Regenerate docs:
bundle exec rake rswag:specs:swaggerizeFFmpeg is used for automatic video processing (duration extraction, thumbnail generation).
macOS:
brew install ffmpegUbuntu/Debian:
sudo apt-get install ffmpeg mediainfoCentOS/RHEL:
sudo yum install ffmpegWhen a student uploads a video:
ProcessVideoJobis automatically enqueued- FFmpeg extracts video duration (stored in
duration_sec) - FFmpeg captures a frame (at 1 second or the middle for short videos) as a thumbnail
- Thumbnail is stored via a CarrierWave uploader
If FFmpeg is not installed, videos will still upload but without automatic duration/thumbnail.
The app uses Elasticsearch for full-text search (the “School videos” feature).
The ES instance is shared between multiple projects — indices are prefixed with akademy2_{environment}.
In config/settings.yml:
elasticsearch:
url: http://localhost:9200
index_prefix: akademy2Or via environment variable:
export ELASTICSEARCH_URL=http://localhost:9200{prefix}_{environment}_{model}
Examples:
akademy2_development_student_videosakademy2_staging_student_videosakademy2_production_student_videos
# Start Rails console
rails c
# Reindex all StudentVideo records
StudentVideo.reindex
# Check index name
StudentVideo.searchkick_index.name
# => "akademy2_production_student_videos"
# Check if index exists
StudentVideo.searchkick_index.exists?
# Delete and recreate index
StudentVideo.reindex(force: true)
# Reindex asynchronously (via Sidekiq)
StudentVideo.reindex(async: true)# Basic search
StudentVideo.search("keyword")
# Search with filters
StudentVideo.search("keyword", where: { status: "approved", subject_id: "uuid" })
# Search with pagination
StudentVideo.search("keyword", page: 1, per_page: 20)- Sidekiq – background job processing (production; in development jobs may run inline by default)
- Elasticsearch – full-text search for “School videos”
- SMTP – email delivery (Devise notifications)
Deployment is done via Capistrano:
cap staging deploy
cap production deploy