Skip to content

Okabe-Junya/golink

Repository files navigation

GoLink

GoLink is a URL shortener service built with Go and React.

Getting Started

  1. Clone the repository:
git clone https://github.com/Okabe-Junya/golink.git
cd golink
  1. Set up environment variables:
cp .env.example .env
  1. Update the .env file with your configuration:
  • Set FIREBASE_CREDENTIALS_JSON or FIREBASE_CREDENTIALS_FILE for Firebase authentication
  • Adjust other variables as needed
  1. Start the application:
docker compose up

The application will be available at:

Development

Backend Development

The backend is written in Go and uses:

  • Gin web framework
  • Firebase/Firestore for data storage
  • Docker for containerization

To run backend tests:

cd backend
make test

Frontend Development

The frontend is built with:

  • React
  • TypeScript
  • Tailwind CSS

To run frontend tests:

cd frontend
npm install
npm test

Environment Variables

Variable Description Default
FIREBASE_CREDENTIALS_JSON Firebase credentials in JSON format -
FIREBASE_CREDENTIALS_FILE Path to Firebase credentials file path/to/serviceAccountKey.json
APP_DOMAIN Application domain localhost
PORT Backend port 8080
FRONTEND_PORT Frontend port 3001
BACKEND_PORT Backend port (for Docker) 8080
FIRESTORE_EMULATOR_HOST Firestore emulator host firestore:8081
GOOGLE_CLOUD_PROJECT GCP project ID golink-local

License

This project is licensed under the GNU AFFERO GENERAL PUBLIC LICENSE Version 3.