Skip to content

An example of CRUD operations in Refiber framework

License

Notifications You must be signed in to change notification settings

refiber/example-crud

Repository files navigation

An example of CRUD operations in Refiber

How to run it?

I recommend using Air for live reloading.

git clone https://github.com/refiber/example-crud.git

cd example-crud

npm i && npm run build

air

If you're new to the Refiber framework, simply open the route file at /routes/web.go, then follow the pattern from the route to the controller and finally to the view.

Refiber

Refiber is a web framework based on the Gofiber framework, follows the MVC architecture (Model, View & Controller).

Refiber comes with Inertia.js built-in. Inertia.js is a powerful tool for creating Single Page Applications (SPA) without needing a separate API.

// in your Controller
func (web *webController) Index(s support.Refiber) error {
	return web.inertia.Render().Page("Home", &fiber.Map{
		"hello": "World",
	})
}
// in your React App
export default function HomePage({ hello }) {
	return <h1>Hello {hello}</h1>;
}

Documentation

Online documentation https://refiber.notion.site

Quick Install

To install Refiber, you first need to install the CLI. Use the following command:

go install github.com/refiber/refiber-cli@latest

Now you can just run this command bellow to create a new Refiber project

refiber-cli new my-app

Releases

No releases published

Packages

No packages published

Languages