MyGram is an application where you can store photos and make comments on other people's photos. This application will be equipped with CRUD (Create, Read, Update, Delete) operations with tables and the following flow:
- Create: Users can upload their photos to the platform and add accompanying comments.
- Read: Users can view their own uploaded photos along with comments, as well as browse through photos uploaded by other users and their respective comments.
- Update: Users can edit the captions or details of their uploaded photos, as well as modify their comments.
- Delete: Users can delete their uploaded photos, as well as remove their comments from any photo.
This CRUD functionality will provide users with a seamless experience for managing their photos and interactions within the application.
URL Deploy: https://h8-mygram.fly.dev/v1/
- Register
- Login
- Get profile
- Edit profile
- Delete profile
Feature User | Endpoint | Param | JWT Token | Function |
---|---|---|---|---|
POST | /register | - | NO | Register new users (account). |
POST | /login | - | NO | Log in into account. |
GET | /users | - | YES | Get account information details. |
PUT | /users | - | YES | Edit account details. |
DELETE | /users | - | YES | Delete account. |
- Add new Photo
- Show all list photos
- Edit photo
- Show detail photo
- Delete photo
Feature Photos | Endpoint | Param | JWT Token | Function |
---|---|---|---|---|
POST | /photos | - | YES | Add new photo. |
GET | /photos | - | YES | Get all photos. |
PUT | /photos | PHOTO ID | YES | Edit photo. |
GET | /photos | PHOTO ID | YES | Get photos details |
DELETE | /photos | PHOTO ID | YES | Delete photo |
- Add new comment
- Show all my list comments
- Edit comment
- Show detail comment
- Delete comment
Feature Comments | Endpoint | Param | JWT Token | Function |
---|---|---|---|---|
POST | /comments | - | YES | Add new comment. |
GET | /comments | - | YES | Get all my comment. |
PUT | /comments | COMMENT ID | YES | Edit comment. |
GET | /comments | COMMENT ID | YES | Get comment details |
DELETE | /comments | COMMENT ID | YES | Delete comment |
- Add new social media
- Show all list social media
- Edit social media
- Show detail social media
- Delete social media
Feature Comments | Endpoint | Param | JWT Token | Function |
---|---|---|---|---|
POST | /socialmedias | - | YES | Add new social media. |
GET | /socialmedias | - | YES | Get all social media. |
PUT | /socialmedias | SOCIALMEDIA ID | YES | Edit social media. |
GET | /socialmedias | SOCIALMEDIA ID | YES | Get social media details |
DELETE | /socialmedias | SOCIALMEDIA ID | YES | Delete social media |
-
Clone the project
$ git clone https://github.com/roihan12/h8-mygram.git
-
Create new database
-
Go to project directory
$ cd mygram
-
Dont forget to activate the credential for third party api cloudinary,
-
Create env using env.example format and fill in all value
-
Download all packages and dependencies
$ go mod tidy
-
Run the program
$ go run .
-
Enjoy
Distributed under the MIT License. See LICENSE.txt
for more information.