Short
Preview
s/
extension?
Want 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 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
andClient Secret
- Now you can copy the
Client ID
andClient 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
- Visit http://localhost
Tools We Use
- Drone: Continuous integration written in Go
- Sourcegraph: Code search written in Go
- Code Climate: Automated code review
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
- Update the README.md with details of changes to the interface, this includes new environment variables, exposed ports, useful file locations and container parameters.
- 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