Giter Club home page Giter Club logo

blog's Introduction

BinaryBlog

Go Version License Last Commit Issues Stars


BinaryBlog

Description

BinaryBlog is a blog backend api that allows users to create an account, verify their email address, login, create, update, delete blog posts, and search for blog posts.

Requirements

  • Go 1.21.5 and above
  • Postgres 13.3 and above
  • Docker 20.10.7 and above
  • sqlc 1.25.0 and above
  • golang-migrate 4.17.0 and above

Sqlc

# Docker recommended
docker run --rm -v $(pwd):/src -w /src sqlc/sqlc generate

or

Visit sqlc to install sqlc

Usage

go run cmd/api/blog/main.go [option]
# [option] = 1, 2

# 1: Database migration-up
# 2: Database migration-down

Keep in mind that you need to have a postgres database running on your local machine or in a docker container before running the above command

leave [option] empty to run the server

Endpoints

  • GET /api/v1/health

Users

POST /api/v1/user/signup This endpoint allows you to create a new user.
GET /api/v1/user/verify?token={token} This endpoint allows you to verify a user's email address.
POST /api/v1/user/login This endpoint allows you to login a user.
GET /api/v1/user/{id} This endpoint returns a specific user based on the provided ID.
DELETE /api/v1/user/{id} This endpoint allows you to delete a specific user based on the provided ID.
GET /api/v1/user/profile This endpoint returns the currently logged in user.
PUT /api/v1/user/profile This endpoint allows you to update the currently logged in user.

Posts

GET /api/v1/posts?page={page} This endpoint returns a list of posts with a limit of 10 posts per page. The page query parameter is optional and defaults to 1.
POST /api/v1/posts This endpoint allows you to create a new blog post.
GET /api/v1/posts/{id} This endpoint returns a specific blog post based on the provided ID.
PUT /api/v1/posts/{id} This endpoint allows you to update a specific blog post based on the provided ID.
DELETE /api/v1/posts/{id} This endpoint allows you to delete a specific blog post based on the provided ID.
GET /api/v1/article/search?match-type=single&term=python This endpoint allows you to search for a blog post based on the provided query parameters where match-type can be single or multi and term is the search term. The default match-type is single.

blog's People

Contributors

jay-bhogayata avatar vinitparekh17 avatar deepsource-io[bot] avatar

Watchers

 avatar

Forkers

vinitparekh17

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.