Skip to content

garry911128/Gwriter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project README

Tech Stack

  • Frontend: Vite + TypeScript
  • Backend: Golang
  • Database: MySQL

Prerequisites

Ensure you have the following installed:

  • Git
  • Docker
  • NPM
  • Go
  • MySQL

How to Run

Frontend

Setup Environment Variables

cd frontend
cp .example.env .env
  • For local development:
    BACKEND_PATH='http://localhost:5000/api/v1'
  • For Docker deployment:
    BACKEND_PATH='http://go-server:5000/api/v1'

Install Dependencies

npm install --legacy-peer-deps

Run Locally

cd frontend
npm run dev -- --open

The server will automatically reload after code changes.


Backend

Setup Environment Variables

go mod download

Run the Server

go run cmd/main.go

Code Formatting & Linting

When to Check

  • Before opening a pull request

Format Code

npm run format
gofmt -w .

Check Code Format

npm run lint
gofmt -l -d .

Docker

Start Containers

Run the project with Docker:

docker-compose up --detach --build

Run Only the Go Server

If go.mod or go.sum has changed, rebuild the Go server image:

docker-compose up go-server

Run Only MySQL

docker-compose up mysql-db

Database Initialization

Place .sql files inside the db folder.

Access MySQL

If you have MySQL installed:

mysql -h localhost -P 3306 -u root -p

If you do not have MySQL installed:

docker exec -it <containerName> mysql -u root -p

Shutdown Docker Containers

docker-compose down

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published