Insta_api using golang and mongodb
Proper hashing algorithms have been implemented so that user password cannot be reverse engineered.
Features:
User can create a new account
User data is safe as hashing algorithms have been implemented
User can see user details using userid
User can post images with caption
Automatic time stamp will be generated
User can get all details of his posts
User can search for a particular post using its id
Proper pagination algorithms have been implemented to keep a check on the user data(Internet consumption while using the system). Used mutex to make the server thread safe Unit testing has been deployed to test the app.
To get started:
clone the repo
Change the current working directory to the location where you cloned the directory
Ensure you have golang installed(For this project, i have used 1.17)
Ensure mongodb is up and running(I have used the default port number 27017)
To run the application, type
# go run app.go
Now the server starts on port 3000
You can access it using Curl or postman
- Create an User <- URL should be ‘/users'
- Get a user using id <- URL should be ‘/users/’
- Create a Post <- URL should be ‘/posts'
- Get a post using id <- URL should be ‘/posts/’
- List all posts of a user <- URL should be ‘/posts/users/'
User creation
Updated Database
As we can see, the password is properly hashed
Used mutex to make the server thread safe