linksort / linksort

Pretty much an open source alternative to Pocket.

Home Page:https://linksort.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Linksort

CircleCI API Docs

Screenshot

Linksort is an open source bookmarking application.

Development

Setting up your development environment is easy. Make sure you have docker and docker-compose installed and run the following command from the root of this repository.

docker-compose up

That's it! Go to http://localhost:8000 to find the app up and running. Whenever you change a file, the code we be automatically recompiled and run.


Sometimes you need to develop without being inside a Docker container. Follow these steps to run the project in development mode without Docker.

You'll need a access to a mongodb endpoint that supports replica sets. You can build and run a docker image that provides such an endpoint by running the following commands.

# Build the image.
docker build -f docker/mongo.Dockerfile -t mongo-rs .

# Run it in the background.
docker run -p 27017:27017 -v db-data:/data/db -d mongo-rs

Run air to start the backend server. This also starts a watcher that automatically rebuilds and runs the server whenever changes are detected. You'll also need to set the following environment variables.

export PRODUCTION=0
export ANALYZER_KEY=$(cat /path/to/key)  # Optional
export FRONTEND_HOSTNAME=localhost
export FRONTEND_PORT=3000
air

Open another terminal window and start the frontend. This server also starts a watcher that supports hot module replacement.

cd frontend
yarn start

Go to http://localhost:8080.

Running Tests

# Build the mongo image.
docker build -f docker/mongo.Dockerfile -t mongo-rs .

# Run it. Note db-data2 and db2.
docker run -p 27017:27017 -v db-data2:/data/db2 -d mongo-rs

# Run tests. No need to repeat the previous steps for subsequent runs.
go test ./...

Running in Prod Mode Locally

docker build -f ./docker/main.Dockerfile -t ls .
docker run -e ANALYZER_KEY="$ANALYZER_KEY" -e DB_CONNECTION="mongodb://172.17.0.2:27017/?connect=direct" -p 8080:8080 ls

Generating API Docs

# Make sure swag is installed.
go install github.com/swaggo/swag/cmd/swag@latest

# Generate docs.
swag init --dir cmd/serve/,handler,model,payload

About

Pretty much an open source alternative to Pocket.

https://linksort.com


Languages

Language:JavaScript 54.7%Language:Go 38.3%Language:CSS 3.6%Language:HTML 3.0%Language:Dockerfile 0.3%Language:Smarty 0.1%