Skip to content

Latest commit

 

History

History
271 lines (234 loc) · 6.37 KB

DEV.md

File metadata and controls

271 lines (234 loc) · 6.37 KB

rin-project


Web

background

foreground

Managed via bower

Tracker

  • opentracker

Other

Shall we give it a try? webtorrent

Files

  • APP_ROOT
    • bin/ - Executables
    • controller/ - Controllers and route definitions
    • doc/ - Documentations
    • lib/ - Libraries & functions
    • models/ - Model definitions
    • public/ - Public static directory, delegate to nginx directly as root directory
      • bower_components/ - Static app resource (managed by bower)
      • templates/ - ui-router page templates
      • images/ - images directory (if necessary)
      • angular-prpr.js - Angular.js main app file
      • index.html - Frontpage index file
    • package.json - Package info file
    • rin.js - rin-pr main app

Routes

All routes defined under /api

  • Frontpage: 50 latest torrents

    • Path: /torrents/latest
    • Method: GET
    • Return: 50 latest torrents (all bangumi, sort by publish_time) list
    [
        {
            _id: ObjectID(),
            title: '[KNA][Sora no Method][天體運行式]][10][720p][MP4]',
            tags: ['KNA', 'Sora no Method', '720p', 'mp4', 'PSV', 'Mizi-raws'],
            bangumi_id: ObjectID(),
            downloads: 144,
            finished: 128,
            leechers: 17,
            seeders: 26,
            team: 'KNA',
            author: 'angelcat',
            publish_time: UNIX_TIMESTAMP(),
            magnet: 'magnet:...',
            file: '/download/2014/12/(md5).torrent',
            content: 'Torrent desc here.'
        },
        {...}
    ]
  • Frontpage: Season bangumi list

    • Path: /bangumi/current
    • Method: GET
    • Return: Currently on showing bangumi list
    [
        {
            _id: ObjectID(),
            name: '天體運行式',
            startDate: UNIX_TIMESTAMP(),
            endDate: UNIX_TIMESTAMP(),
            showOn: 6, // Date().getDay()
            tags: ObjectID()
        },
        {...}
    ]
  • Frontpage: Team list

    • Path: /team/all
    • Method: GET
    • Return: Registered team list
    [
        {
            _id: ObjectID(),
            name: 'KNA'
        },
        {...}
    ]
  • Frontpage: Torrent details

    • Path: /torrent/:torrent_id
    • Method: GET
    • Return: Torrent details Deprecated: angular already requested the resources
  • Filter page: Specific bangumi torrents list

    • Path: /bangumi/:bangumi_id
    • Method: GET
    • Return: 50 (or customizable amount) latest torrents list of the bangumi
    [
        {
            _id: ObjectID(),
            title: '[KNA][Sora no Method][天體運行式]][10][720p][MP4]',
            tags: ['KNA', 'Sora no Method', '720p', 'mp4', 'PSV', 'Mizi-raws'],
            bangumi_id: ObjectID(),
            downloads: 144,
            finished: 128,
            leechers: 17,
            seeders: 26,
            team: 'KNA',
            author: 'angelcat',
            publish_time: UNIX_TIMESTAMP(),
            magnet: 'magnet:...',
            file: '/download/2014/12/(md5).torrent',
            content: 'Torrent desc here.'
        },
        {...}
    ]
  • Filter page: Specific team torrents list

    • Path: /team/:team_id
    • Method: GET
    • Return: 50 (or customizable amount) latest torrents list by the team
    [
        {
            _id: ObjectID(),
            title: '[KNA][Sora no Method][天體運行式]][10][720p][MP4]',
            tags: ['KNA', 'Sora no Method', '720p', 'mp4', 'PSV', 'Mizi-raws'],
            bangumi_id: ObjectID(),
            downloads: 144,
            finished: 128,
            leechers: 17,
            seeders: 26,
            team: 'KNA',
            author: 'angelcat',
            publish_time: UNIX_TIMESTAMP(),
            magnet: 'magnet:...',
            file: '/download/2014/12/(md5).torrent',
            content: 'Torrent desc here.'
        },
        {...}
    ]
  • Admin: Summary

    • Path: /admin/summary
    • Method: GET
    • Return: App & system summary
    {
        sysload: [0.20, 0.51, 0.73],
        teams: 32,
        members: 41,
        torrents: 765
    }
  • Admin: Team CRUD

  • Admin: User CRUD

  • Admin: Torrents CRUD

  • Admin: Bangumi CRUD

  • User: signin

  • User: signout

  • User: Submit new torrent

  • Function: Search tags

Models/Functions

  • Model: Admin

    • Prototype:
  • Model: Users

    • Document object:
    {
        _id: ObjectID(),
        username: 'user',
        password: md5(md5('password') + salt),
        salt: random(12),
        email: '[email protected]',
        team_ids: [ ObjectID(team_id) ],
        group: 'members'|'admin'
    }
    • Prototype:
  • Model: Bangumis

    • Document object:
    {
        _id: ObjectID(),
        name: '天體運行式',
        startDate: UNIX_TIMESTAMP(),
        endDate: UNIX_TIMESTAMP(),
        showOn: 6, // Date().getDay()
        tag: ObjectID(tag_id)
    }
    • Prototype:
  • Model: Torrents

    • Document object:
    {
        _id: ObjectID(),
        title: '[KNA][Sora no Method][天體運行式]][10][720p][MP4]',
        tags: ['KNA', 'Sora no Method', '720p', 'mp4', 'PSV', 'Mizi-raws'],
        bangumi_id: ObjectID(),
        downloads: 144,
        finished: 128,
        leechers: 17,
        seeders: 26,
        team: 'KNA',
        author: 'angelcat',
        publish_time: UNIX_TIMESTAMP(),
        magnet: 'magnet:...',
        file: '/download/2014/12/(md5).torrent',
        content: 'Torrent desc here.'
    }
  • Model: Tags

    • Document object:
    {
        _id: ObjectID(),
        name: '天体のメソッド',
        synonyms: ['天体のメソッド', 'Sora no Method', '天體運行式', '天体运行式', '天体的方式']
    }

Angular Pages