A progressive Node.js service which provides user signup, login, and profile management
- Nest - A framework for building efficient and scalable Node.js applications.
- Auth0 - For secure authentication and authorization
- JWT - For stateless management of user tokens
- Swagger - For API documentation
$ yarn install
- Copy environment variables from
.env.sample
file in project root into a new.env
file in project root - Fill the environment variables with actual values
# development
$ yarn start
# watch mode
$ yarn start:dev
# production mode
$ yarn start:prod
- To login, go to the following web address (Replace env variables with actual values):
https://${AUTH0_DOMAIN}/authorize?audience=${BASE_URL}&scope=openid%20profile&response_type=code&client_id=${AUTH0_CLIENT_ID}&redirect_uri=${LOGIN_REDIRECT_URL}&state=STATE?prompt=none
- To register, go to the following web address (Replace env variables with actual values):
https://${AUTH0_DOMAIN}/authorize?audience=${BASE_URL}&scope=openid%20profile&response_type=code&client_id=${AUTH0_CLIENT_ID}&redirect_uri=${REGISTER_REDIRECT_URL}}&state=STATE?prompt=none
-
After login or register, copy the
auth_token
in your response body and set as bearer token in your request header -
With
access_token
set, you now access the following protected endpoints:
GET /api/me
POST /api/upload
- To logout current user: go to the following web address (Replace env variables with actual values):
https://${AUTH0_DOMAIN}/v2/logout?federated
- Goto here
- Complete the above steps to install and setup the project locally
- Start the app
- Click Here to register
- Copy your
auth_token
, set asBearer
token in your headers and tryout other endpoints in the docs
- Write unit and e2e tests
- Upload profile images to cloud and save image url to a database
- API docs was rushed, add more details