Developer
Development
Setting up a local development environment, running tests, and compiling the project.
Development
Contributing to GO Shortener or running it in a local development environment requires only standard Go tooling.
Prerequisites
Local Setup
1. Clone the Repository
Clone the codebase to your local development workstation:
Terminal
git clone https://github.com/ItsARCn/Go-shortner.git
cd Go-shortner
2. Configure Local Environment
Copy the development environment template to .env:
Terminal
cp .env.example .env
The default values in .env.example are pre-configured for local testing (binding to http://localhost:3000 with SQLite storage in ./data/go-dev.sqlite).
3. Sync Frontend Assets
Before compiling or running tests, ensure that the embedded filesystem package contains the latest frontend assets:
Terminal
mkdir -p backend/internal/embedded/public
cp -r frontend/public/* backend/internal/embedded/public/
4. Run Automated Test Suite
Execute the Go test suite across all internal packages:
Terminal
cd backend
go test -v ./...
5. Launch the Development Server
Run the application directly using go run:
Terminal
cd backend
go run ./cmd/server/main.go
Open http://localhost:3000 in your web browser.