# 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
-
Clone the repository:
git clone https://github.com/mBuergi86/devseconnect.git cd devseconnect
-
Install dependencies:
go mod download
-
Run with Docker:
docker-compose up -d --build
-
Run locally (without Docker):
go run cmd/main.go
-
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.