Coder Social home page Coder Social logo

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

Linksort's Projects

linksort icon linksort

Pretty much an open source alternative to Pocket.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.