Skip to content

Back End

Michael Rudloff edited this page Sep 23, 2021 · 1 revision

Routes

Format: "METHOD" "ROUTE" "dESCRIPTION

@GET /LOGIN   
@DESC LOGIN PAGE  

TO DO:

  • Routes: Move model code blocks to models
  • Routes: Write new code blocks that show what front-end should CRUD

Auth Routes

GET /admin

POST /signup

  • Creates a new user

POST /login

  • Verify existing user
{  
	email: String,  
	password: String,  
}  

Models

User

// Define what data sent will be
{
	email: String [required],
	password: String [required],
	userName: ...,
	profilePic: ...,
	discordName: ... [required],
	twitterName: ...,
	twitchName: ...,
	githubName: ...,
	portfolioSite: ...,
	isAdmin: Boolean,
}

Task

{
	taskID: String,
	week: Number,
	category: String (video \ daily \ article \ ),
	link: String (optional),
	description: String,
	internalNote: String (optional), // for admin?
	
}

Week

{
	week: Number,
	userId: { type: ObjectID, ref: User },
	tasks: [ { type: Object, ref: Task } ],
	completed: Boolean,
	
}

Timestamps: true;

Controllers

NPM Packages

Middleware

Clone this wiki locally