shade34321 / short

URL shortening service written in Go and React

Home Page:https://s.time4hacks.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Short

Build Status codecov Maintainability Go Report Card Open Source Love

Demo

Preview

Demo

Want s/ extension?

Get it from Chrome Web Store or build it from source

Prerequisites

  • Docker v19.03.1

Dependencies

Short is built on top of app, a reusable framework for Go apps & command line tools

Getting Started

Create reCAPTCHA account

Create ReCAPTCHA account

Create Github OAuth Application

  • Register at Github OAuth with the following configurations:
Field Value
Application Name Short
Homepage URL http://localhost
Application description URL shortening service written in Go and React
Authorization callback URL http://localhost/oauth/github/sign-in/callback
  • Once you have registered the application, you should get Client ID and Client Secret
  • Now you can copy the Client ID and Client Secret into their respective locations in the .env file

Create .env file at project root directory with the following content:

DOCKER_IMAGE_PREFIX=local
DOCKERHUB_USERNAME=local
DB_USER=your_db_user
DB_PASSWORD=your_db_password
DB_NAME=your_db_name
RECAPTCHA_SECRET=your_recaptcha_secret
GITHUB_CLIENT_ID=your_Github_client_id
GITHUB_CLIENT_SECRET=your_Github_client_secret
JWT_SECRET=your_JWT_secret
WEB_PORT=80
API_PORT=8080

Remember to replace the appropriate lines with your db user, db password, db name, and reCAPTCHA secret.

Build docker image

GRAPHQL_BASE_URL=http://localhost:8080 \
HTTP_API_BASE_URL=http://localhost \
RECAPTCHA_SITE_KEY=your_recaptcha_site_key \
docker build -t local/short:latest .

Remember to replace the appropriate line with your reCAPTCHA site key.

Start server

docker-compose up
  1. Visit http://localhost

Tools We Use

Contributing

When contributing to this repository, please first discuss the change you wish to make via issues with the owner of this repository before making a change.

Pull Request Process

  1. Update the README.md with details of changes to the interface, this includes new environment variables, exposed ports, useful file locations and container parameters.
  2. You may merge the Pull Request in once you have the sign-off of code owner, or if you do not have permission to do that, you may request the code owner to merge it for you.

Code of Conduct

  • Using welcoming and inclusive language
  • Being respectful of differing viewpoints and experiences
  • Gracefully accepting constructive criticism
  • Focusing on what is best for the community
  • Showing empathy towards other community members

Author

Harry Liu - byliuyang

License

This project is maintained under MIT license

About

URL shortening service written in Go and React

https://s.time4hacks.com

License:MIT License


Languages

Language:Go 63.2%Language:TypeScript 16.4%Language:CSS 8.1%Language:Shell 5.6%Language:JavaScript 4.5%Language:HTML 2.0%Language:Dockerfile 0.2%