GoravelGoravel
Home
Video
  • English
  • 简体中文
GitHub
Home
Video
  • English
  • 简体中文
GitHub
  • Prologue

    • Upgrade Guide

      • Upgrading To v1.15 From v1.14
      • Upgrading To v1.14 From v1.13
      • History Upgrade
    • Contribution Guide
    • Excellent Extend Packages
  • Getting Started

    • Installation
    • Configuration
    • Directory Structure
    • Compile
  • Architecture Concepts

    • Request Lifecycle
    • Service Container
    • Service Providers
    • Facades
  • The Basics

    • Routing
    • HTTP Middleware
    • Controllers
    • Requests
    • Responses
    • Views
    • Grpc
    • Session
    • Validation
    • Logging
  • Digging Deeper

    • Artisan Console
    • Cache
    • Events
    • File Storage
    • Mail
    • Queues
    • Task Scheduling
    • Localization
    • Package Development
    • Color
    • Strings
    • Helpers
  • Security

    • Authentication
    • Authorization
    • Encryption
    • Hashing
  • ORM

    • Getting Started
    • Relationships
    • Migrations
    • Seeding
    • Factories
  • Testing

    • Getting Started
    • HTTP Tests
    • Mock

Installation

  • Server Requirements
  • Installation
    • Using Goravel Installer
    • Manual Installation
  • Start HTTP Service
    • Start Service According To .env File In The Root Directory
    • Specify .env File To Start Service
    • Start Service Using Environment Variables
    • Live reload
  • Configuration
    • Configuration files
    • Generate Application key
    • Generate JWT Token

Server Requirements

  • Golang >= 1.21

Installation

Using Goravel Installer

Initialize the installer according to the documentation, and then initialize a new Goravel project using the following command:

// Enter the directory where you want to install the project
goravel new blog

Manual Installation

// Download framework
git clone --depth=1 https://github.com/goravel/goravel.git && rm -rf goravel/.git*

// Install dependencies
cd goravel && go mod tidy

// Create .env environment configuration file
cp .env.example .env

// Generate application key
go run . artisan key:generate

Start HTTP Service

Start Service According To .env File In The Root Directory

go run .

Specify .env File To Start Service

go run . --env=./.env

Start Service Using Environment Variables

APP_ENV=production APP_DEBUG=true go run .

Live reload

Install cosmtrek/air, Goravel has a built-in configuration file that can be used directly:

air

If you are using Windows system, you need to modify the .air.toml file in the root directory, and add the .exe suffix to the following two lines:

[build]
  bin = "./storage/temp/main.exe"
  cmd = "go build -o ./storage/temp/main.exe ."

Configuration

Configuration files

All configuration files of the Goravel framework are placed in the config directory. All configuration items have annotations, you can adjust them according to your needs.

Generate Application key

You need to generate the application key after Goravel is installed locally. Running the command below, a 32-bit string will be generated on the APP_KEY key in the .env file. This key is mainly used for data encryption and decryption.

go run . artisan key:generate

Generate JWT Token

You need to generate JWT Token if you use Authentication.

go run . artisan jwt:secret
Edit this page
Next
Configuration