Categorygithub.com/mBuergi86/devseconnect
module
0.0.0-20241121115549-6926e7630d75
Repository: https://github.com/mbuergi86/devseconnect.git
Documentation: pkg.go.dev

# README

DevSeConnect 🌐

Welcome to DevSeConnect – A social media platform for developers to share knowledge and collaborate on DevOps and software development topics.

Project Overview šŸ› ļø

This repository contains the backend and frontend implementation of DevSeConnect, built using Go (Golang) and Svelte. The project utilizes several modern technologies including RabbitMQ, PostgreSQL, Redis, Svelte and Docker to provide a scalable and performant architecture.

Folder Structure šŸ“

ā”œā”€ā”€ cmd
│   ā”œā”€ā”€ main.go      # Main entry point of the application           
ā”œā”€ā”€ internal
│   ā”œā”€ā”€ application
│   │   └── service
│   │       ā”œā”€ā”€ comment_service.go
│   │       ā”œā”€ā”€ like_service.go
│   │       ā”œā”€ā”€ message_service.go
│   │       ā”œā”€ā”€ post_service.go
│   │       ā”œā”€ā”€ post_tags_service.go
│   │       ā”œā”€ā”€ tags_service.go
│   │       └── user_service.go
│   ā”œā”€ā”€ domain
│   │   ā”œā”€ā”€ entity
│   │   │   ā”œā”€ā”€ comments.go
│   │   │   ā”œā”€ā”€ likes.go
│   │   │   ā”œā”€ā”€ messages.go
│   │   │   ā”œā”€ā”€ network.go
│   │   │   ā”œā”€ā”€ posts.go
│   │   │   ā”œā”€ā”€ posttags.go
│   │   │   ā”œā”€ā”€ tags.go
│   │   │   ā”œā”€ā”€ user_connections.go
│   │   │   └── users.go
│   │   ā”œā”€ā”€ handler
│   │   │   ā”œā”€ā”€ comment_handler.go
│   │   │   ā”œā”€ā”€ like_handler.go
│   │   │   ā”œā”€ā”€ message_handler.go
│   │   │   ā”œā”€ā”€ post_handler.go
│   │   │   ā”œā”€ā”€ post_tags_handler.go
│   │   │   ā”œā”€ā”€ tag_handler.go
│   │   │   └── user_handler.go
│   │   └── repository
│   │       ā”œā”€ā”€ comment_repository.go
│   │       ā”œā”€ā”€ likes_repository.go
│   │       ā”œā”€ā”€ message_repository.go
│   │       ā”œā”€ā”€ post_repository.go
│   │       ā”œā”€ā”€ post_tags_repository.go
│   │       ā”œā”€ā”€ tags_repository.go
│   │       └── user_repository.go
│   └── infrastructure
│       ā”œā”€ā”€ cache
│       │   └── redis.go
│       ā”œā”€ā”€ database
│       │   └── postgres.go
│       ā”œā”€ā”€ messaging
│       │   ā”œā”€ā”€ comment_consumer.go
│       │   ā”œā”€ā”€ consumer.go
│       │   ā”œā”€ā”€ like_consumer.go
│       │   ā”œā”€ā”€ message_consumer.go
│       │   ā”œā”€ā”€ post_consumer.go
│       │   ā”œā”€ā”€ post_tags_consumer.go
│       │   ā”œā”€ā”€ producer.go
│       │   ā”œā”€ā”€ rabbitmq.go
│       │   ā”œā”€ā”€ tags_consumer.go
│       │   └── user_consumer.go
│       └── routing
│           └── router.go
ā”œā”€ā”€ pkg
│   ā”œā”€ā”€ response
│   │   └── error.go
│   └── security
│       └── hash.go
ā”œā”€ā”€ scripts
│   ā”œā”€ā”€ migrate.sh
│   └── migrations
│       ā”œā”€ā”€ devseconnect_insert.sql
│       ā”œā”€ā”€ devseconnect.sql
│       ā”œā”€ā”€ devseconnect_test_select2.sql
│       └── devseconnect_test_select.sql
ā”œā”€ā”€ .gitignore                     # Git ignore rules
ā”œā”€ā”€ docker-compose.yml             # Docker Compose setup
ā”œā”€ā”€ Dockerfile                     # Dockerfile for containerization
ā”œā”€ā”€ nginx.conf
ā”œā”€ā”€ nohup.out
ā”œā”€ā”€ go.mod                         # Go module dependencies
ā”œā”€ā”€ prometheus.yml
ā”œā”€ā”€ LICENSE                        # License file

Technologies Used šŸ› ļø

  • Go (Golang)
  • Svelte - Web Framework.
  • PostgreSQL – For database management.
  • Redis – Caching layer.
  • RabbitMQ – Message broker for async communication.
  • Docker – Containerization of the application.
  • Grafana – Monitoring graph visualization.
  • Prometheus – Monitoring tool.

Installation šŸš€

Prerequisites

Make sure you have the following installed:

  • Go v1.18+
  • Svelte 5
  • Docker & Docker Compose
  • Redis
  • RabbitMQ
  • PostgreSQL
  • Prometheus
  • Grafana

Steps to Install

  1. Clone the repository:

    git clone https://github.com/mBuergi86/devseconnect.git
    cd devseconnect
    
  2. Install dependencies:

    go mod download
    
  3. Run with Docker:

    docker-compose up -d --build
    
  4. Run locally (without Docker):

    go run cmd/main.go
    
  5. Log Webserver:

    docker logs -f golang_web_server
    

API Endpoints šŸ”—

The platform uses RESTful APIs to handle different operations:

  • Users:

    • GET /users – Fetch all users.
    • POST /users – Create a new user.
    • PUT /users/:id – Update a user with id.
    • DELETE /users/:id – Delete a user with id.
  • Posts:

    • GET /posts – Fetch all posts.
    • POST /posts/:username – Create a new post.
    • PUT /posts/:id – Update a post with id.
    • DELETE /posts/:id – Delete a post with id.
  • Comments:

    • GET /comments – Fetch all comments.
    • POST /comments/:title/:username – Add a comment to a post.
    • PUT /comments/:id – Update a comment with id.
    • DELETE /comments/:id – Delete a comment with id.
  • Likes:

    • GET /likes – Fetch all likes.
    • POST /likes/:title/:username – Like a post.
    • POST /likes/:content/:username – Like a comment.
    • DELETE /likes/:id – Delete a like with id.

Database Schema šŸ—„ļø

The database is managed using PostgreSQL, and migration scripts are located in scripts/migrations/. The key tables include:

  • users
  • posts
  • comments
  • messages
  • likes
  • tags
  • post_tags

Messaging System āœ‰ļø

Asynchronous communication between services is managed via RabbitMQ. Producers and consumers are defined in the internal/infrastructure/messaging/ directory.

Monitoring šŸ“Š

Prometheus is used for application monitoring and metrics collection. The configuration is located in prometheus.yml.

License šŸ“œ

This project is licensed under the MIT License.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author