It is a basic version of a RESTful API based on Instagram where we can create user, get the users, create post and get post and get all posts of an user.
A User has the Following details
- Id
- Name
- Email
- Password
A post has the Following details
- Id
- Caption
- Image URL
- Posted Timestamp
- Feature 1- Create an User using the details by the POST request
- Feature 2- Get an User using their ID by GET request
- Feature 3- Create a Post using the details by POST request
- Feature 4- Get a Post using the details of ID by GET request
- Feature 5- Get all Posts of User using the the Unique ID of the User by GET request
- Feature 6- Impelmented Pagination to get all Posts of User using the the Unique ID of the User by GET request
- Hashed to protect password so that it cannot be Reverse Engineered
- Implemented Thread security by Implementing Locks
- Fully Structured Code with code reusability
- Pagination for the list endpoint
Clone the project
git clone https://github.com/ayan2809/Instagram-API-Clone
Install Dependencies
git mod init test3
Run the Code
go run instagram.go
http://localhost:4000/users
http://localhost:4000/users/{id}
http://localhost:4000/posts
http://localhost:4000/posts/{id}
http://localhost:4000/posts/users/{id}
http://localhost:4000/posts/users/{id}&limit=3