func Favorite(w http.ResponseWriter, r *http.Request) {
	vars := mux.Vars(r)
	name := vars["name"]
	site, _ := database.GetSiteByName(name)
	user, _ := database.GetUserByID(utils.GetUserObjectID(r))
	if !utils.IsAuthorized(site, user) {
		utils.RespondWithJSON(w, http.StatusUnauthorized, "unauthorized", nil)
		return
	}
	database.SetSiteFavorite(user, site.ID)
	utils.RespondWithJSON(w, http.StatusOK, "success", nil)
	return
}
Favorite : favorite a site
package adminhandlers
import (
	"encoding/json"
	"log"
	"net/http"
	"regexp"
	"github.com/asaskevich/govalidator"
	"github.com/backpulse/core/constants"
	"github.com/backpulse/core/database"
	"github.com/backpulse/core/models"
	"github.com/backpulse/core/utils"
	"github.com/gorilla/mux"
)
func GetSites(w http.ResponseWriter, r *http.Request) {
	id := utils.GetUserObjectID(r)
	user, _ := database.GetUserByID(id)
	sites, _ := database.GetSitesOfUser(user)
	utils.RespondWithJSON(w, http.StatusOK, "success", sites)
	return
}
func GetOverview(w http.ResponseWriter, r *http.Request) {
	vars := mux.Vars(r)
	name := vars["name"]
	site, _ := database.GetSiteByName(name)
	user, _ := database.GetUserByID(utils.GetUserObjectID(r))
	if !utils.IsAuthorized(site, user) {
		utils.RespondWithJSON(w, http.StatusUnauthorized, "unauthorized", nil)
		return
	}
	for _, c := range site.Collaborators {
		if user.Email == c.Email {
			site.Role = "collaborator"
		}
	}
	if site.Role == "" {
		site.Role = "owner"
	}
	files, _ := database.GetSiteFiles(site.ID)
	galleries, _ := database.GetGalleries(site.ID)
	albums, _ := database.GetAlbums(site.ID)
	videogroups, _ := database.GetVideoGroups(site.ID)
	articles, _ := database.GetVideoGroups(site.ID)
	projects, _ := database.GetProjects(site.ID)
	type overview struct {
		Files       int `json:"files"`
		Galleries   int `json:"galleries"`
		Albums      int `json:"albums"`
		VideoGroups int `json:"video_groups"`
		Articles    int `json:"articles"`
		Projects    int `json:"projects"`
		TotalSize     float64               `json:"total_size"`
		Name          string                `json:"name"`
		DisplayName   string                `json:"display_name"`
		Collaborators []models.Collaborator `json:"collaborators"`
		Modules       []constants.Module    `json:"modules"`
	}
	data := overview{
		Files:         len(files),
		Galleries:     len(galleries),
		Albums:        len(albums),
		VideoGroups:   len(videogroups),
		Articles:      len(articles),
		Projects:      len(projects),
		DisplayName:   site.DisplayName,
		Name:          site.Name,
		Modules:       site.Modules,
		Collaborators: site.Collaborators,
		TotalSize: database.GetSiteTotalSize(site.ID),
	}
	log.Println(database.GetSiteTotalSize(site.ID))
	utils.RespondWithJSON(w, http.StatusOK, "success", data)
	return
}
func GetSite(w http.ResponseWriter, r *http.Request) {
	vars := mux.Vars(r)
	name := vars["name"]
	site, _ := database.GetSiteByName(name)
	user, _ := database.GetUserByID(utils.GetUserObjectID(r))
	if !utils.IsAuthorized(site, user) {
		utils.RespondWithJSON(w, http.StatusUnauthorized, "unauthorized", nil)
		return
	}
	for _, c := range site.Collaborators {
		if user.Email == c.Email {
			site.Role = "collaborator"
		}
	}
	if site.Role == "" {
		site.Role = "owner"
	}
	site.TotalSize = database.GetSiteTotalSize(site.ID)
	utils.RespondWithJSON(w, http.StatusOK, "success", site)
	return
}
func RemoveModule(w http.ResponseWriter, r *http.Request) {
	vars := mux.Vars(r)
	name := vars["name"]
	moduleName := vars["module"]
	log.Println(moduleName)
	site, _ := database.GetSiteByName(name)
	user, _ := database.GetUserByID(utils.GetUserObjectID(r))
	if !utils.IsAuthorized(site, user) {
		utils.RespondWithJSON(w, http.StatusUnauthorized, "unauthorized", nil)
		return
	}
	err := database.RemoveModule(site, moduleName)
	if err != nil {
		utils.RespondWithJSON(w, http.StatusInternalServerError, "error", nil)
		return
	}
	exists := false
	for _, m := range site.Modules {
		if m == constants.Module(moduleName) {
			exists = true
		}
	}
	if !exists {
		utils.RespondWithJSON(w, http.StatusNotFound, "not_found", nil)
		return
	}
	utils.RespondWithJSON(w, http.StatusOK, "success", nil)
	return
}
func AddModule(w http.ResponseWriter, r *http.Request) {
	vars := mux.Vars(r)
	name := vars["name"]
	moduleName := vars["module"]
	log.Println(moduleName)
	site, _ := database.GetSiteByName(name)
	user, _ := database.GetUserByID(utils.GetUserObjectID(r))
	if !utils.IsAuthorized(site, user) {
		utils.RespondWithJSON(w, http.StatusUnauthorized, "unauthorized", nil)
		return
	}
	exists := utils.CheckModuleExists(moduleName)
	if !exists {
		utils.RespondWithJSON(w, http.StatusNotFound, "not_found", nil)
		return
	}
	for _, m := range site.Modules {
		if m == constants.Module(moduleName) {
			utils.RespondWithJSON(w, http.StatusConflict, "exists", nil)
			return
		}
	}
	err := database.AddModule(site, moduleName)
	if err != nil {
		utils.RespondWithJSON(w, http.StatusInternalServerError, "error", nil)
		return
	}
	utils.RespondWithJSON(w, http.StatusOK, "success", nil)
	return
}
func GetSiteModules(w http.ResponseWriter, r *http.Request) {
	vars := mux.Vars(r)
	name := vars["name"]
	site, _ := database.GetSiteByName(name)
	user, _ := database.GetUserByID(utils.GetUserObjectID(r))
	if !utils.IsAuthorized(site, user) {
		utils.RespondWithJSON(w, http.StatusUnauthorized, "unauthorized", nil)
		return
	}
	utils.RespondWithJSON(w, http.StatusOK, "success", site.Modules)
	return
}