command
module
Version:
v0.0.0-...-4297218
Opens a new window with list of versions in this module.
Published: Oct 1, 2023
License: MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
website-template
Setup
To setup this GO project you need to install the following tools:
Development Setup
-
To Start the development server run the following command:
air
Air will start a development server on port 8080
and create a development build in tmp
folder.
To change the port run the following command:
air -- --port :<port> # replace <port> with the port number
-
Create a .env
using a env file from environments
folder.
cp environments/.env.development .env
Note: You can also create a .env
file manually and copy the content from .env.example
file.
-
Create a database in PostgreSQL and update the database url in .env
file.
-
Run the following command to run the migrations:
migrate -path ./migrations -database <database_url> up
Note: Replace <database_url>
with the database url from .env
file.
Build
Build the app for production run the following command:
go build -o ./build/
This will create a binary file in the build
folder.
Migrations
Migrations are handled using golang-migrate, read the docs for more info.
Folder Structure
├── build
├── models # All models
├── migrations # Database migrations
├── environments # All env files
├── .env.development
├── .env.production
├── .env.test
├── .env.example
├── routes # All routes
├── main.go
├── <route group> # A route group example: users
├── utils # All utils which are used in the project
├── main.go
├── <util> # A util example: formatDate
├── .gitignore
├── .air.toml # Air config file
├── go.mod
├── go.sum
├── main.go # Main file
└── README.md
Documentation
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.