Medsos App is a simple social media application that allows users to create posts, comment on posts, edit comments, edit user data, and delete accounts. This repository contains the frontend code for the Medsos App.
- Go installed on your machine
- GORM
- Echo
- Postman
- Database (e.g., Mysql) installed and accessible
-
Clone the repository:
git clone https://github.com/medsos-kelompok3/be_medsos.git
-
Change into the project directory:
cd be_medsos -
Install dependencies:
go mod tidy
Circles provides a RESTful API for managing and retrieving media sosial. Below are the available endpoints:
-
Endpoint:
/register- Method:
POST - Description: Register a new user.
- Request Body:
{ "username": "your_name", "email":"your_email", "address":"your_address", "password": "your_password" } - Response:
{ "message": "User registered successfully" }
- Method:
-
Endpoint:
/login- Method:
POST - Description: Log in an existing user.
- Request Body:
{ "username": "your_name", "password": "your_password" } - Response:
{ "token": "your_access_token" }
- Method:
- Endpoint:
/user/:id- Method:
PUT - Description: Update data from User.
- Request Body:
{ "bio": "your_bio", "avatar":"your_avatar", "address":"your_address" } - Response:
{ "message": "User registered successfully" }
- Method:
- Endpoint:
/user/:id- Method:
DELETE - Description: Delete data from User.
- Response:
{ "message": "User deleted successfully" }
- Method:
- Endpoint:
/posting- Method:
POST - Description: Posting Successfully created.
- Request Body:
{ "caption": "your_caption", "gambar_posting":"your_posting" } - Response:
{ "message": "Posting successfully created" }
- Method:
- Endpoint:
/posting/:id- Method:
PUT - Description: Posting Sucessfully updated.
- Request Body:
{ "caption": "your_caption", "gambar_posting":"your_posting" } - Response:
{ "message": "Posting updated successfully" }
- Method:
- Endpoint:
/posting- Method:
GET - Description: Posting Successfully read.
- Response:
{ "caption": "your_caption", "gambar_posting":"your_posting" }
- Method:
- Endpoint:
/posting/:id- Method:
DELETED - Description: Posting Sucessfully deleted.
- Response:
{ "message": "Posting deleted successfully" }
- Method:
- Endpoint:
/comment- Method:
POST - Description: Comment Successfully created.
- Request Body:
{ "posting_id": 1, "isi_comment":"your_comment" } - Response:
{ "message": "Comment successfully created" }
- Method:
- Endpoint:
/posting/:id- Method:
PUT - Description: Comment Sucessfully updated.
- Request Body:
{ "isi_comment":"your_comment" } - Response:
{ "message": "Posting updated successfully" }
- Method:
- Endpoint:
/comment/:id- Method:
DELETED - Description: Comment Sucessfully deleted.
- Response:
{ "message": "Comment deleted successfully" }
- Method: