Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.
forked from trotto/go-links

The open source go links app at the core of Trotto.

License

Notifications You must be signed in to change notification settings

pathstream/go-links-backend

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trotto Go Links

CircleCI

Reliable and battle-tested, this go links solution is used by companies all around the world daily as the core of Trotto.

Try out the latest build at latest-master.trotto.dev. If you'd rather use the fully-managed instance of Trotto, check out www.trot.to.


Don't hesitate to reach out to us through [email protected], a GitHub issue, or live chat at https://www.trot.to.


Features

Trotto provides all the baseline functionality you'd expect from a go links solution, including the ability to create, use, and modify go links that are shared with your organization—and with nobody else.

Trotto also includes powerful features above and beyond a basic go links implementation, including a searchable go links directory, a Chrome extension* that makes go links work instantly, and programmatic links, which are go links containing placeholders that map onto the destination URL (ex: go/gh/%s pointing to https://github.com/my_org/%s).

For a full list of Trotto's features, check out https://www.trot.to/how-it-works.

* We're in the process of open-sourcing the Chrome extension as well. If you'd like to be involved in that, subscribe to this issue or email us at [email protected].

Authentication

At the moment, the open-source app solely supports authentication using a Google account, but we plan to add support for additional identity providers upon request. So if you need support for another provider, submit a GitHub issue, and we'll help you out!

Local development

You can bring up a local instance of Trotto within a few minutes.

Install the Google Cloud SDK

Follow the instructions here to install the Cloud SDK for Google Cloud Platform.

Once you've installed the SDK, you should be able to successfully run gcloud info.

With gcloud installed, also run:

gcloud components install app-engine-python

Clone this repository

git clone [email protected]:trotto/go-links.git
cd go-links

Create a virtualenv

Inside the go-links/server directory, create and enter a Python 2 (at least 2.7.12) virtualenv:

cd go-links/server
virtualenv --python=/usr/bin/python2.7 .virtualenv/
source .virtualenv/bin/activate

You can use pyenv as well.

Start the backend server

From the server/ directory, run:

./install_deps.sh
./run_local.sh

If you get an error like dev_appserver.py: command not found, be sure to install the Cloud SDK as described above.

Start the frontend development server

In a separate terminal, from the frontend/ directory, run:

npm install
./start_dev_server.sh

Now, you can access the local instance at http://localhost:5007.

Making changes

Most server-side and frontend changes should be picked up automatically, thanks to the App Engine dev server and React Hot Loader.

View the admin console

Access the development admin console at http://localhost:8095. The admin console allows you to view the datastore, use an interactive console, and more.

Deploying your own Trotto instance

You can deploy your own instance to Google App Engine in around 15 minutes. If you have any trouble, contact us through any of the channels mentioned above, and we'll get back to you ASAP.

Sign up for App Engine

If you don't already use Google App Engine, sign up through https://console.cloud.google.com/freetrial.

Create a new App Engine app

Go here and create a new Google Cloud Platform project, then create a new App Engine application in that project. See this screencast.

Be sure to note your GCP project ID, which is shown when you create a new project and is also visible in the GCP console URL, as the project= query parameter. For example, in the screencast above, the new project's ID is trotto-test-7.

Obtain OAuth client credentials

To support Google authentication, you need to create OAuth client credentials to include with your app. See this screencast.

  • Your authorized domain will have the format PROJECT_ID.appspot.com (example: trotto-test-7.appspot.com)
  • Your authorized redirect URI will have the format https://PROJECT_ID.appspot.com/_/auth/oauth2_callback (example: https://trotto-test-7.appspot.com/_/auth/oauth2_callback)
  • You'll need to download a credentials file as shown in the screencast and rename it client_secrets.json

Clone this repository

git clone [email protected]:trotto/go-links.git
cd go-links/server

Install the Google Cloud SDK

Install the Google Cloud SDK using the instructions here.

Once you've installed the SDK, authorize the SDK to access your GCP project:

gcloud auth login

Create a virtualenv

Inside the go-links/server directory, create and enter a Python 2 (at least 2.7.12) virtualenv:

cd go-links/server
virtualenv --python=/usr/bin/python2.7 .virtualenv/
source .virtualenv/bin/activate

You can use pyenv as well.

Install Python dependencies

From the same directory, run:

pip install -r requirements.txt

Add your OAuth client credentials

Take the credentials file you generated above (which should be renamed to client_secrets.json) and put it in the server/src/config directory.

Deploy the app

Now, you can deploy the app. From the server/ directory, run:

./deploy.sh

After a successful deploy, you'll be able to access your Trotto instance at https://PROJECT_ID.appspot.com!

About

The open source go links app at the core of Trotto.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 48.0%
  • JavaScript 34.6%
  • CSS 9.6%
  • HTML 7.0%
  • Other 0.8%