waeeto

package module
v0.0.0-...-d66b9de Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2021 License: MIT Imports: 17 Imported by: 0

README

waeeto (incomplete)

A questions and answer framework usable on your own site.

Projects Used

Setup

Users Table Setup

Note that user creation and updating is not part of this project. You as the administrator is to provide this. This is to ensure that you can use any form of authentication you want eg. social auth (Facebook, google, twitter), passwords, fingerprint, keys etc.

Create a users table with the following properties:

  1. it must also have fields firstname and surname for easy recognition.
  2. it must also have field email for communications.
  3. It must also have field timezone for datetime values. Example value is 'Africa/Lagos'.

You must also provide a function that would get the currently logged in users. The function is given the request object to get the cookies for its purpose. Set the waeeto.GetCurrentUser to this function. The function has the following declaration func(r *http.Request) (int64, error).

The waeeto.GetCurrentUser should return 0 for public.

Begin

Get the framework through the following command go get -u github.com/bankole7782/waeeto

There is a sample application which details how to complete the setup. Take a look at it here

Copy the folder wa_files from the main repo into the same path as your main.go.

Make sure you look at main.go in the sample app, copy and edit it to your own preferences.

Go to /waeeto-setup/ to create some tables that the project would need.

Then go to /waeeto/ask-question to start using this project.

Files Setup

Read this for how to setup a service account to use in communicating with google cloud storage.

You would need to create a bucket on google cloud storage for all your files in a waeeto installation. Then set the name of the bucket to waeeto.BucketName.

Email Setup

Please create a function with signature func (to, subject, msg string) and set it to waeeto.SendMail.

Theming Your Project

The sample project has no design. To make it beautiful make a template from this template :wa_files/bad-base.html . Save it to your project and then point your version to waeeto.BaseTemplate.

There is no navigation or footer. Please add them to your base template.

FAQs

When is X Database Support Coming

I don't intend to support more than one database so has to make the work cheaper.

When is X Cloud Support Comming

I don't intend to support more than one cloud.

License

Released with the MIT License

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BaseTemplate string
View Source
var BucketName string
View Source
var DomainName string
View Source
var GetCurrentUser func(r *http.Request) (int64, error)
View Source
var Helpers []int64
View Source
var LoginPath string
View Source
var RegisterPath string
View Source
var SendMail func(to, subject, msg string)

Functions

func AddHandlers

func AddHandlers(r *mux.Router)

func GetTags

func GetTags() ([]string, error)

func GetTagsWithIds

func GetTagsWithIds() ([][]string, error)

Types

type MQA

type MQA struct {
	MQId             string
	QUserId          int64
	QUserName        string
	QuestionHTML     template.HTML
	CreationDT       string
	HasAnswer        bool
	MQAId            string
	AUserId          int64
	QHelper          string
	AnswerDT         string
	AnswerHTML       template.HTML
	HasMoreQuestions bool
}

type QuestionFragment

type QuestionFragment struct {
	QId       string
	Title     string
	AskedBy   string
	Tags      []string
	AskDate   string
	HasAnswer bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL