Welcome to DevSeConnect β A social media platform for developers to share knowledge and collaborate on DevOps and software development topics.
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.
βββ 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
Make sure you have the following installed:
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
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.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
Asynchronous communication between services is managed via RabbitMQ. Producers and consumers are defined in the internal/infrastructure/messaging/
directory.
Prometheus is used for application monitoring and metrics collection. The configuration is located in prometheus.yml
.
This project is licensed under the MIT License.