- Go
- HTMX
- PostgreSQL
- Gorm
- Go: Ensure you have Go installed. You can download it from golang.org.
- PostgreSQL: Make sure PostgreSQL is installed and running.
-
Open your terminal and clone the repository:
git clone https://github.com/U-to-E/dashboard cd dashboard
-
Install the necessary Go packages:
go mod tidy
-
Create a
.env
file in the root of your project directory:vim .env
-
Add the following content to the
.env
file:DB_HOST=localhost DB_PORT=5432 DB_USER=postgres DB_PASSWORD=your_password DB_NAME=your_db_name SECRET=your_secret ADMIN_EMAIL=[email protected] ADMIN_PASS=your_admin_password EMAIL_ADDR=email EMAIL_PASS=pass EMAIL_SMTP=smtp.gmail.com EMAIL_PORT=587
-
Build the binary:
go build -o dashboard
-
Run the binary:
./dashboard
-
Run the application directly from the source:
go run main.go
-
Open your browser and navigate to
http://localhost:3000
.
-
Create a
Dockerfile
in the root of your project directory with the following content:FROM golang:1.18-alpine WORKDIR /app COPY . . RUN go mod tidy RUN go build -o dashboard EXPOSE 3000 CMD ["./dashboard"]
-
Build the Docker image:
docker build -t dashboard-app .
-
Run the Docker container:
docker run --env-file .env -p 3000:3000 dashboard-app
-
Open your browser and navigate to
http://localhost:3000
.