Skip to content

ISS-Security/tyto2026-api

Repository files navigation

Tyto API

API to manage courses, events, locations, and attendance tracking.

Routes

All routes return JSON.

  • GET /: Root route shows if Web API is running
  • GET api/v1/accounts/[username]: Get a single account
  • POST api/v1/accounts: Create a new account
  • GET api/v1/courses: Get list of all courses
  • POST api/v1/courses: Create a new course
  • GET api/v1/courses/[course_id]: Get a single course
  • GET api/v1/courses/[course_id]/events: Get list of events for a course
  • POST api/v1/courses/[course_id]/events: Create a new event for a course
  • GET api/v1/courses/[course_id]/events/[event_id]: Get a single event
  • GET api/v1/courses/[course_id]/locations: Get list of locations for a course
  • POST api/v1/courses/[course_id]/locations: Create a new location for a course
  • GET api/v1/courses/[course_id]/locations/[location_id]: Get a single location

Install

Install this API by cloning the relevant branch and use bundler to install specified gems from Gemfile.lock:

bundle config set --local without 'production'
bundle install

The --without production config skips the pg gem locally so you don't need libpq installed for development. Heroku/PaaS deployments pick up pg from the :production group automatically and must not carry this config.

Copy config/secrets-example.yml to config/secrets.yml and adjust as needed.

Setup development database once:

rake db:migrate

Optionally populate the development database with sample accounts, courses, enrollments, locations, and events:

rake db:seed
# or, to wipe and reseed from scratch:
rake reseed

Execute

Run this API using:

puma

Test

Setup test database once:

RACK_ENV=test rake db:migrate

Run the test specification:

rake spec

Release check

Before submitting pull requests, please check if specs, style, and dependency audits pass:

rake release_check

For Contributors

  • Database schema — see docs/schema.md for the entity-relationship diagram and the rationale behind encrypted columns, keyed-hash lookup, role enumeration, and cascade behavior.

About

Web API for Tyto security demonstration project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors