Skip to content

devfolio-ucsy/devfolio-backend-core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

187 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Devfolio Backend Core

Spring Boot backend core for Devfolio, a campus-focused portfolio and collaboration platform. This service powers user profiles, content posts (projects, questions, articles), group collaboration, messaging, notifications, and admin workflows.

Tech Stack

  • Java + Spring Boot
  • Spring Data JPA
  • PostgreSQL
  • MinIO (object storage)
  • RabbitMQ (events + notifications)
  • Docker Compose

Quick Start (Docker)

docker compose up -d

Run Locally

./mvnw spring-boot:run

Configuration

Main settings live in src/main/resources/application.yaml.

Common values you may need to set:

  • spring.datasource.* for database connection
  • spring.jpa.* for Hibernate settings
  • minio.* for object storage
  • spring.rabbitmq.* for messaging

If you use environment variables, keep names aligned with the YAML keys.

Database Diagram

Please update the Draw.io diagram when the database changes:

Modules and Packages

  • admin_panel for admin-specific workflows
  • controller for public endpoints
  • service for business logic
  • repository for data access
  • dto for request/response models
  • config for security, CORS, and infrastructure

API Surface

Controllers are located under src/main/java/com/ucsy/devfolio_core/controller. Start with:

  • ProjectPostController
  • QuestionPostController
  • RoutesController
  • VoteController
  • FollowController
  • newsFeedControllers/ContentController

Features Added (2026)

Universal Voting (Content, Comment, Answer)

  • Unified vote target model using targetType + targetId.
  • Endpoints:
    • POST /votes/{targetType}/{targetId}/upvote
    • POST /votes/{targetType}/{targetId}/downvote
    • DELETE /votes/{targetType}/{targetId}
    • GET /votes/{targetType}/{targetId}/count
  • All vote mutations require authentication.

Karma / Reputation

  • Each upvote adds +1 and each downvote adds -1 to the target owner's reputationPoints.
  • Changes are applied on vote update/unvote using delta logic.
  • Displayed in the profile right panel (reputation field).

Answers (Question Posts)

  • Create answer: POST /content/question-post/{questionPostId}/answer
  • List answers: GET /content/question-post/{questionPostId}/answers
  • Accept answer (question author only): PATCH /content/question-post/{questionPostId}/answer/{answerId}/accept

Follow / Unfollow

  • Follow: POST /users/{targetUserId}/follow
  • Unfollow: DELETE /users/{targetUserId}/follow
  • Followers: GET /users/{userId}/followers
  • Following: GET /users/{userId}/following
  • Follow status: GET /users/{userId}/follow-status?targetUserId=...
  • Follow/unfollow requires authentication.

Notification Events (via RabbitMQ)

  • This service publishes notification events for:
    • comments
    • votes
    • project applications
    • question answers
    • follows
  • The notification service consumes these events via the shared exchange (notification.exchange).

Development Notes

  • Use the Maven wrapper (./mvnw) to keep versions consistent.
  • Keep entity changes in sync with the ER diagram.
  • Prefer DTOs for external payloads; avoid exposing entities directly.
  • If you add a new notification type, mirror the event in the notification service.

About

Main service component for DeVfolio's backend.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages