📄️ Installation
To create a new Goffee project you need to install goffee first which is the cli tool
📄️ Getting Started
To create a new Goffee project you need to install the command goffee first. It is the cli tool.
📄️ Environment Variables
Environment variables are values accessible globally within the app
📄️ Routing
All routes are defined in the file routes.go which is located in the root dir, here is an example for defining a route:
📄️ Controllers
A Controller is nothing but a function to handle the HTTP requests to the matching route.
📄️ Context
The context is an object that provides you with all the functionalities and information you need to handle a request, it contains things like request headers, form's post data, uploaded files, database orm, sending emails, etc.
📄️ Request
All request information like posted data, uploaded files, headers, etc; can be accessed using the context.
📄️ Response
Below are the different types of responses you can return to the user
📄️ Templates
The html/template package in Go offers a powerful
📄️ Templates components
The predefined components in the Goffee core mostly consist of html_template/structure pair.
📄️ Validation
To access the validator call the function GetValidator() in the context object.
📄️ Hooks
A Hook is a pieces of functional that gets executed either before handling the request or after.
📄️ JWT Tokens
JWT tokens are used for authentication, Goffee provides you with ways to generate JWT tokens, decode them, and check their expiry.
📄️ Authentication
Goffee comes with a built-in users authentication feature, you can turn it on by uncommenting the auth related routes in routes.go, the authentication feature consists of the following features:
📄️ Session
Goffee comes with a built-in users authentication feature, you can turn it on by uncommenting the auth related routes in routes.go, the authentication feature consists of the following features:
📄️ Authority
Goffee comes with a built-in roles and access control system consists of the following features:
📄️ Cache
Goffee uses Redis for cache and its disabled by default, you can enable it in the file config/cache.go by setting the attribute EnableCache to true, then add Redis connection information to the .env if you are using it. otherwise, you can use an external tool to inject these variables into the environment
📄️ TLS
Goffee gives you the ability to run your app in tls mode (https), you just need to copy your tls certificates my-server-cert.cert and my-server-cert.key to the directory tls at the root directory of the project, next update the tls config in the .env file or inject them to the environment with an external tool
📄️ Hashing passowrds
Hashing passowrds in Goffee can be done by using the object hashing from the context, here is how you can do that:
📄️ Sending Emails
Goffee supports 3 different drivers for sending emails, SMTP, SparkPost, SendGrid, and MailGun.
📄️ Events
In Goffee defining events is straightforward, first you need to add the event name as a constant to the file events\event-names.go
📄️ Database Configuration
Goffee uses GORM to query the database, all the features of GORM are available for you to use. Supported databases are mysql, postgres and sqlite
📄️ Models
Models are located in the directory models
📄️ CRUD Operations
To perform operations on your database first make sure database is enabled in the config/gorm.go
📄️ Relationships (Associations)
Belongs To