syncstream-dev / syncstream-backend

Java + SpringBoot backend for SyncStream Application
GNU General Public License v2.0
2 stars 2 forks source link

Java SpringBoot API services requirements #3

Closed Xu-Gavin closed 8 months ago

Xu-Gavin commented 9 months ago

Figure out how to setup API services in SpringBoot Java. Ticket for tracking the understanding of the setup.

Xu-Gavin commented 9 months ago
API Endpoints
├── All api calls: user_token (String)
├── All Returns if not specified
│   ├── All Success requests: success_message (String)
│   └── All Failed requests: error_message (String)
│
├── getPublicSessions
│   ├── Params: genre (Genre)
│   └── Return: sessions (ArrayList<PublicSession>)
│
├── startSession
│   ├── Params: session_public (boolean), capacity (int), password (byte[])
│   └── Return: session (PublicSession/PrivateSession)
│
├── joinSession
│   ├── Params: session_public (boolean), session_id (String), session_password (byte[])
│   └── Return: session (PublicSession/PrivateSession)
│
├── leaveSession
│   └── Params: session_id (String)
│
├── sendMessage
│   └── Params: session_id (String), content (String)
│
├── reportMessage
│   └── Params: session_id (String), user_id (String), message_id (String), reason (String)
│
├── viewProfile
│   ├── Params: user_id (String)
│   └── Return: user (User)
│
├── createProfile
│   ├── Params: local_user (boolean), user_username(String), user_password (byte[]), user_email (String)
│   └── Return: user (FullUser)
│
└── deleteProfile
    └── Params: user_id (String), user_username (String), user_password (byte[]), reason (String), user_email (String)
Xu-Gavin commented 9 months ago

The way SpringBoot project is organized is that there are 3 modules:

  1. Controllers (API Endpoints which focus only on the receiving requests, calling the appropriate services and returning an HTTP response)
  2. Services (Holds business logic and how to handle requests)
  3. Repositories (Interface between services and the database)

I think it logically follows to build the database first. Hence This issue is blocked by #13. Will review this ticket once database integration has been completed.

Xu-Gavin commented 8 months ago

The requirements are clarified. #13 is completed. Moving ticket to Done.