nodetube icon indicating copy to clipboard operation
nodetube copied to clipboard

Invite system

Open BassOfBass opened this issue 4 years ago • 2 comments

As per https://github.com/mayeaux/nodetube/issues/387 there is a need for system to control the amount of incoming accounts. It would look something like this:

Frontend

  • Additional input field at signup.pug(https://github.com/mayeaux/nodetube/blob/master/views/account/signup.pug).
  • A way to see the list of all available and used invites and a way to generate new ones somewhere in the admin templates, don't know which one. But it probably requires a new template and a new endpoint to go along with it.

Backend

  • A new model looking something like this.
  • Endpoints and logic for handling ran out/expired invites and creating new ones.
  • Some sort of a global state switch allowing to turn the whole instance into invite-only mode and back.

Endpoints:

  • GET /admin/invitations - the list of all invitations in the database.

  • GET /admin/invitations/:code- the expanded details of a given invitation.

  • GET /admin/invitations/:code/edit - edit a given invitation.

  • POST /admin/invitations - API for fetching invitations.

  • POST /admin/invitations/create - API for creating invitations.

  • POST /admin/invitations/edit - API for editing existing invitations.

BassOfBass avatar Nov 25 '20 08:11 BassOfBass

Looks really cool.

mayeaux avatar Nov 27 '20 02:11 mayeaux

@mayeaux Already working on it btw: invite system branch. I saw some inconsistent exporting style between modules, is it okay if I change exports.Property to module.exports ones in the files I'll have to edit? Also is there a particular reason you aren't using Express.Route and just dump all routes in routes.js? It already looks quite unwieldy tbh.

BassOfBass avatar Nov 27 '20 05:11 BassOfBass