nodetube
nodetube copied to clipboard
Invite system
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.
Looks really cool.
@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.