Skip to content

Repository files navigation

LOGIN APP:

How to use it and what it does:

1.What it does?
Allows users to signup and store their new username and password in a protected manner.
These passwords are hashed using bcrypt module and are stored in mongoDB.
Once the user signs up they can also login using the username and password credentials where upon
success a json webtoken gets returned for further future use.

2.How to use it: The requests made to the server must be through POST requests(you can use POSTMAN for this)
for signup: http://localhost:5000/api/auth/signup
for login: http://localhost:5000/api/auth/login
and the request data must be of the JSON format
ex:{
"username":"newUser123",
"password":"user_123"
}
!!Before running postman see the "Using the docker application" part!!

Using the docker application

1. Go to the terminal and run: docker pull kingcloudamazing/user_auth_service:1.0
2. After the image is downloaded, download the mongodb.yaml and the .env file as well
and save it in one common file.
3. Now go the common file location in the terminal and type: docker compose -f mongodb.yaml up -d
4. This will install all the mongo, mongo-express and the program containers and put them in one common network. After installing the containers it will start running them. To confirm if the application is running successfully you can type:
docker logs (name or id of container whose image name is - kingcloudamazing/user_auth_service:1.0)
If it shows: > user-auth-service@1.0.0 start
> node server.js

MongoDB connected!
Server has started running at PORT:5000
Your code is running successfully and you can start giving postman the user credentials.

To view all the users just go to localhost:8081, where user:admin and password:pass to see the
users details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages