Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 62 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,68 +20,76 @@
|---------------|--------------------------|
| 🖼 Frontend | React |
| 🚀 Backend | Spring Boot (Java) |
| 🐘 Database | MS SQL Server |
| 🐘 Database | MS SQL Server |
| 🛡 Security | JWT Authentication |
| 🛡 File Storage| AWS S3 |
| 🐳 DevOps | Docker & Docker Compose |
| 🔁 CI/CD | GitHub Actions |

---

## 📂 Project Structure

TODO
### 📦 Backend Structure

```bash
backend/
├── mvnw
├── mvnw.cmd
├── pom.xml
├── src/
│ ├── main/
│ │ ├── java/hr/algebra/socialnetwork/
│ │ │ ├── AlgebraSocialNetworkApplication.java
│ │ │ ├── config/ # Configuration classes (CORS, Swagger, AWS, etc.)
│ │ │ ├── controller/ # REST Controllers
│ │ │ ├── dto/ # Data Transfer Objects
│ │ │ ├── exception/ # Exception handling
│ │ │ ├── mapper/ # DTO mappers
│ │ │ ├── model/ # JPA Entities
│ │ │ ├── payload/ # Request payloads
│ │ │ ├── repository/ # Spring Data Repositories
│ │ │ ├── s3/ # AWS S3 Service
│ │ │ ├── security/ # Security configuration
│ │ │ ├── service/ # Business logic services
│ │ │ └── validation/ # Custom annotations & validators

```
algebra-social-network/
├── frontend/ # React app
├── backend/ # Spring Boot app
│ └── src/
├── .github/workflows/ # GitHub Actions CI/CD //TDOD
├── docker-compose.yml //TODO
└── README.md
```

---

## 🔐 Authentication Endpoints

| Method | Endpoint | Description |
|--------|-----------------------------|----------------------|
| POST | `/api/v1/auth/register` | Register a new user |
| POST | `/api/v1/auth/login` | Login and get token |

---

## 👤 User Endpoints

| Method | Endpoint | Description |
|--------|-----------------------------------|--------------------|
| PUT | `/api/v1/users/{userId}` | Update user info |
| DELETE | `/api/v1/users/{userId}` | Delete user |
| GET | `/api/v1/users` | List all users |

---

## 📝 Post Endpoints

| Method | Endpoint | Description |
|--------|------------------------------------------|-------------------------|
| GET | `/api/v1/posts` | Get all posts |
| POST | `/api/v1/posts` | Create new post |
| POST | `/api/v1/posts/{id}/rate` | Rate a post |
| POST | `/api/v1/posts/{id}/comments` | Add comment to post |
| GET | `/api/v1/posts/{postId}/comments` | Get comments for post |
| GET | `/api/v1/posts/{id}` | Get post by ID |
| GET | `/api/v1/posts/user/{userId}` | Get posts by user |

---

## 🤝 Friends Endpoints

| Method | Endpoint | Description |
|--------|------------------------------------------|------------------------------|
| POST | `/api/v1/friends/request/{userId}` | Send friend request |
| POST | `/api/v1/friends/decline/{requestId}` | Decline friend request |
| POST | `/api/v1/friends/approve/{requestId}` | Approve friend request |
| GET | `/api/v1/friends/requests` | View friend requests |
| DELETE | `/api/v1/friends/remove/{userId}` | Remove a friend |
### 📦 Frontend Structure

```bash
frontend/src/
├── App.jsx
├── assets/ # Static assets (images, svg, etc.)
│ └── alg_wd_blur.svg
├── components/
│ ├── common/ # Reusable components (input, theme, toaster)
│ ├── layout/ # Layout components (navbar, sidebar)
│ ├── posts/ # Post-related UI
│ └── profile/ # Profile editing components
├── context/
│ └── AuthContext.jsx # Authentication context
├── index.css
├── main.jsx
├── pages/ # Route-level pages
│ ├── EditProfilePage.jsx
│ ├── FriendRequestsPage.jsx
│ ├── FriendsPage.jsx
│ ├── HomePage.jsx
│ ├── LoginPage.jsx
│ ├── ProfilePage.jsx
│ ├── RegisterPage.jsx
│ └── StudentsPage.jsx
├── routes/
│ └── PrivateRoute.jsx # Protected route wrapper
├── services/ # API calls and service layer
│ ├── authService.js
│ ├── friendsService.js
│ ├── postsService.js
│ └── usersService.js
├── styles/
│ └── App.css
└── utils/
└── utils.js # Helper functions|
```