Code Monkey home page Code Monkey logo

reddit-feed-api's Introduction

Reddit Feed API

Go build tests codecov Go Report Card Swagger Validator License

Environment Setup

  1. Install the latest Go from https://go.dev/
  2. Install make and curl tools.
  3. Install PostgreSQL 13 or later from https://www.postgresql.org/download/
  4. Install the latest Jaeger from https://www.jaegertracing.io/
  5. Install the latest Prometheus from https://prometheus.io/
  6. Install OpenJDK 17 from https://openjdk.java.net/projects/jdk/17/
  7. Install Kafka 3.1.0 or later from https://kafka.apache.org/
  8. Install the latest Docker from https://www.docker.com/

Usage

$ make help
  Local commands
help:    Show this help
all:     Run the all build commands
reqs:    Install requirements
deps:    Build and install Go dependencies
gen:     Generate Go code
build:   Compile the current package and all of its dependencies
test:    Execute the unit tests
bench:   Execute the benchmark tests
lint:    Check the current package to catch common mistakes and improve the code
tidy:    Cleanup go.mod
fmt:     Format *.go and *.proto files using gofmt and clang-format
cover:   Show the cover report
grpcui:  Run the grpcui tool
clean:   Remove generated artifacts
update:  Update dependencies as recorded in the go.mod and go.sum files
  Docker commands
image:           Build Dockerfile
debug-image:     Build Dockerfile.debug
dc-build:        Build docker-compose.yaml
up:              Up reddit-feed-api
down:            Down reddit-feed-api
rm:              Remove Docker artifacts
  CLI commands
run:             Run reddit-feed-api locally
cli-create:      Run the CreatePostsV1 handle
cli-generate:    Run the GenerateFeedV1 handle
producer:        Run the Kafka producer command
consumer:        Run the Kafka consumer command

Reddit Feed API Overview

Method Path Description
POST /v1/posts Create new posts
GET /v1/feed/{page_id} Generate a feed of posts

Metrics Server

Status Server

pgcli "postgresql://docker:docker@localhost:5432/reddit_feed_api"
goose -dir migrations/reddit-feed-api postgres "postgresql://docker:docker@localhost:5432/reddit_feed_api" status
goose -dir migrations/reddit-feed-api postgres "postgresql://docker:docker@localhost:5432/reddit_feed_api" up
goose -dir migrations/reddit-feed-api postgres "postgresql://docker:docker@localhost:5432/reddit_feed_api" status

Tools (Use docker-compose)

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.