Golang App - Fiber Framework
Application - Task Management
- Create Users
- Upload User image
- Add Tasks
- Upload Tasks from CSV File
- Add Task Attachment
- Search Users and Tasks
- Reports (PDF)
- Statistics (Count Records)
- Logs
- Pagination
Architecture
- Config
- Helpers: functions (Date, Strings, Conversions, Uploads, ...)
- Entities: Represents a table ina database
- Models: Represents the Business Logic
- Controllers: Represents all controllers or handlers
- Templates: All Html templates for rendering data
- Application: Main Layer that call all other layers
Design
- Models: Operations: Create, Read, Find, ...
- Interface for Controllers
- SetupController: Load all routes
- Configs: Env, Logs, Template Engines
- Main: Loadd all components to run application
- App: Main class or file, that call all controllers, migrations, configs and template engines
Libraries
- GORM
- Fiber Framework
- go-wkhtmltopdf - For PDF Rendering
Installation
- Create database
CREATE DATABASE golang_fiber_mvc; USE golang_fiber_mvc;
- Copy database script to MySQL Server: golang_fiber_mvc.sql
- Download wkhtmltopdf
- Install wkhtmltopdf and add to environment variables
- clone git repository:
git clone https://github.com/ortizdavid/golang-fiber-webapp
- Install dependencies:
go mod install
- Create Admin User:
go run create_user.go
- Run application:
go run main.go