๐Ÿ“ฆ sglkc / 01-monorepo

Go News API using Zero One Group's monorepo template

โ˜… 0 stars โ‘‚ 0 forks ๐Ÿ‘ 0 watching
๐Ÿ“ฅ Clone https://github.com/sglkc/01-monorepo.git
HTTPS git clone https://github.com/sglkc/01-monorepo.git
SSH git clone git@github.com:sglkc/01-monorepo.git
CLI gh repo clone sglkc/01-monorepo
Seya Seya docs(README): fix erd 54a2c3f 7 months ago ๐Ÿ“ History
๐Ÿ“‚ master View all commits โ†’
๐Ÿ“ .github
๐Ÿ“ .moon
๐Ÿ“ .vscode
๐Ÿ“ apps
๐Ÿ“ docker
๐Ÿ“ docs
๐Ÿ“ internal
๐Ÿ“„ .dockerignore
๐Ÿ“„ .editorconfig
๐Ÿ“„ .gitignore
๐Ÿ“„ .ncurc.json
๐Ÿ“„ .npmrc
๐Ÿ“„ biome.json
๐Ÿ“„ package.json
๐Ÿ“„ pnpm-lock.yaml
๐Ÿ“„ PROMPTS.md
๐Ÿ“„ README.md
๐Ÿ“„ tsconfig.json
๐Ÿ“„ README.md

Zero One News API

About

Zero One Group News API made using Go, Echo, PostgreSQL, and documented by Swagger.

Documentation

For generated Swagger JSON and additional documentations, see /docs directory.

Entity Relationship Diagram

ERD

Swagger

Screenshot

Endpoints

flowchart TD
    Root["/api"] --> Version["/v1"]
    Version --> Articles["/articles"] & Topics["/topics"]
    Topics --> TopicsGet["GET"] & TopicsPost["POST"] & TopicId["/:topic_id"]
    TopicId --> TopicIdGet["GET"] & TopicIdPatch["PUT"] & TopicIdDelete["DELETE"] & TopicArticles["/articles"]
    TopicArticles --> TopicArticlesGet["GET"]
    Articles --> ArticlesGet["GET"] & ArticlesPost["POST"] & ArticleId["/:article_id"]
    ArticleId --> ArticleIdGet["GET"] & ArticleIdPatch["PUT"] & ArticleIdDelete["DELETE"] & ArticleTopics["/topics"]
    ArticleTopics --> ArticleTopicsGet["GET"] & ArticleTopicsPut["PUT"] & ArticleTopicsId["/:topic_id"]
    ArticleTopicsId --> ArticleTopicsIdPost["POST"] & ArticleTopicsIdDelete["DELETE"]

     Root:::Sky
     Root:::Aqua
     Version:::Sky
     Version:::Aqua
     Articles:::Aqua
     Articles:::Sky
     Topics:::Aqua
     Topics:::Sky
     TopicId:::Rose
     TopicArticles:::Peach
     ArticleId:::Rose
     ArticleTopics:::Peach
     ArticleTopicsId:::Ash
    classDef Aqua stroke-width:1px, stroke-dasharray:none, stroke:#46EDC8, fill:#DEFFF8, color:#378E7A
    classDef Sky stroke-width:1px, stroke-dasharray:none, stroke:#374D7C, fill:#E2EBFF, color:#374D7C
    classDef Rose stroke-width:1px, stroke-dasharray:none, stroke:#FF5978, fill:#FFDFE5, color:#8E2236
    classDef Peach stroke-width:1px, stroke-dasharray:none, stroke:#FBB35A, fill:#FFEFDB, color:#8F632D
    classDef Ash stroke-width:1px, stroke-dasharray:none, stroke:#999999, fill:#EEEEEE, color:#000000

Prerequisites

  • PostgreSQL
  • Docker
  • Moon
  • Go
  • pnpm

Development

  • Clone the repository
git clone https://github.com/sglkc/01-monorepo.git
cd 01-monorepo

  • Install dependencies with pnpm
pnpm install

  • Copy and set environment variables
cp .env.example .env

  • Run local development server
pnpm compose:up       # Start local development server
pnpm compose:down     # Stop local development server
pnpm compose:cleanup  # Remove all local development server data

  • Install Go dependencies
moon run tidy

  • Migrate database
moon zog-news:migration-up

  • Run on development mode
moon zog-news:dev

  • Open documentation endpoint at /swagger/index.html

Testing

moon zog-news:test

Building

moon zog-news:build