How morpheu5/unijobs-api works
UniJobs.it is a Rails JSON API for user accounts, organizations, content publishing, and social-post handling. Clients enter through versioned routes; controllers perform the requested operation, authorize protected actions, and return JSON backed by Active Record models. Content can include ordered blocks and is associated with an organization; creating content also creates a social-post record. Users can register, verify email, log in, and log out; the sampled controller sends verification mail and manages authentication tokens. The README gives little product detail, so capabilities are based mainly on routes and sampled controllers; model and policy internals were not sampled.
Main entry points: routes.rb API routes · schema.rb PostgreSQL · users_controller.rb Users API · contents_controller.rb Contents API
Components 22
API entry
- API routes
config/routes.rb
Accounts
- Users API
app/controllers/api/v1/users_controller.rb - Authentication
app/controllers/concerns/v1/authenticatable.rb - User accounts
app/models/user.rb - Auth tokens
app/models/authentication_token.rb - User policy
app/policies/user_policy.rb - Verification mail
app/mailers/user_mailer.rb
Content publishing
- Organizations API
app/controllers/api/v1/organizations_controller.rb - Organizations
app/models/organization.rb - Organization policy
app/policies/organization_policy.rb - Contents API
app/controllers/api/v1/contents_controller.rb - Content
app/models/content.rb - Content blocks API
app/controllers/api/v1/content_blocks_controller.rb - Content blocks
app/models/content_block.rb - Content policy
app/policies/content_policy.rb
Social publishing
- Social posts API
app/controllers/api/v1/social_posts_controller.rb - Social posts
app/models/social_post.rb - Social policy
app/policies/social_post_policy.rb
Persistence
- PostgreSQL
db/schema.rb
Other components
- API client
- Email service
- Twitter service
Connections 27
- API client → API routes: sends requests
- API routes → Users API: dispatches
- API routes → Organizations API: dispatches
- API routes → Contents API: dispatches
- API routes → Content blocks API: dispatches
- API routes → Social posts API: dispatches
- Users API → User accounts: reads and writes
- Users API → Auth tokens: manages tokens
- Users API → Verification mail: sends verification
- Verification mail → Email service: delivers email
- Users API → User policy: authorizes
- Organizations API → Organizations: reads and writes
- Organizations API → Organization policy: authorizes
- Contents API → Content: reads and writes
- Contents API → Content policy: authorizes
- Contents API → Social posts: creates post
- Content blocks API → Content blocks: reads and writes
- Content blocks API → Content policy: authorizes
- Social posts API → Social posts: reads and writes
- Social posts API → Social policy: authorizes
- Social posts API → Twitter service: publishes tweets
- User accounts → PostgreSQL: persists
- Auth tokens → PostgreSQL: persists
- Organizations → PostgreSQL: persists
- Content → PostgreSQL: persists
- Content blocks → PostgreSQL: persists
- Social posts → PostgreSQL: persists