An open API service indexing awesome lists of open source software.

https://github.com/montasim/authentication-microservice


https://github.com/montasim/authentication-microservice

authentication authentication-backend login logout request-new-password resend-email-verification reset-password signup verify

Last synced: 8 months ago
JSON representation

Awesome Lists containing this project

README

          

[//]: # 'AUTHENTICATION MICROSERVICE'

# AUTHENTICATION MICROSERVICE

[//]: # ''
[//]: # '

'
[//]: # ' Continuous Integration'
[//]: # ' Build on Merge'
[//]: # ' Automated Release Workflow for PR Merges'
[//]: # '
'
[//]: # ''


Wakatime coding time badge
GitHub release
GitHub last commit
GitHub commit activity
GitHub contributors
GitHub repo file count
GitHub repo size
GitHub license


[//]: # 'CONTENTS'

## CONTENTS:

1. [FEATURES](#1-features)
2. [PREREQUISITES](#2-prerequisites)
3. [SETUP](#3-setup)
4. [RUNNING THE SCRIPT](#4-running-the-script)
5. [ERROR HANDLING](#5-error-handling)
6. [HOSTING](#6-hosting)
7. [USED PACKAGES](#7-used-packages)
8. [TOOLS](#8-tools)
9. [ARTICLES](#9-articles)
10. [DO NOT FORGET TO DO](#10-do-not-forget-to-do)
11. [TUTORIALS](#11-tutorials)
12. [INSPIRATIONS](#12-inspirations)
13. [CONTRIBUTE](#13-contribute)
14. [CONTRIBUTORS](#14-contributors)
15. [SPECIAL THANKS](#15-special-thanks)
16. [LICENSE](#16-license)
17. [CONTACT](#17-contact)


[//]: # '1. FEATURES'

## 1. FEATURES

1. Signup
2. Verify email
3. Resend email verification
4. Request new password
5. Reset password
6. Login
7. Logout


[//]: # '2. PREREQUISITES'

## 2. PREREQUISITES


[//]: # '3. SETUP'

## 3. SETUP

1. **Clone the repository and navigate to the directory:**

```bash
git clone https://github.com/montasim/authentication-microservice.git
cd authentication
```

2. **Install the dependencies:**

```bash
yarn install
```

3. **Configuring the Environment:**

Create a `.env.development` or `.env.staging` or `.env.production` file in the root directory of the project and populate it with the necessary environment variables. See the [.env.example](.env.example) file for an example.


[//]: # '4. RUNNING THE SCRIPT'

## 4. RUNNING THE SCRIPT

1. **Running the Application:**

To start the application in development mode, use:

```bash
yarn dev
```

This will run the server with nodemon, automatically restarting when any changes are made.

2. **To build and run the application in production mode, use:**

```bash
yarn start
```

This will build the application and start the server using the built files.

This script first builds the project by linting the code, fixing lint issues, running prettier, and then starts the application with pm2.

3. **Testing:**

To run the tests configured with Jest, use:

```bash
yarn test
```

This will build the project and then run all the Jest tests.

4. **Linting and Code Formatting:**

- To check for linting errors:

```bash
yarn lint:check
```

- To fix linting errors:

```bash
yarn lint:fix
```

- To check if files are formatted correctly:

```bash
yarn prettier:check
```

- To format files:

```bash
yarn prettier:fix
```

5. **Generating Documentation:**

To generate code documentation with JSDoc, run:

```bash
yarn generate-docs
```

This will create documentation based on your JSDoc comments.

6. **Release Management:**

To create a new release, you can use:

```bash
yarn release
```

This will automatically bump the version, update the CHANGELOG, and create a commit and a tag.

For minor or major releases:

```bash
yarn release:minor
yarn release:major
```

7. **Cleanup:**

To clean up dependencies and rebuild the project:

```bash
yarn clean
```

This command initializes the auto cleanup process and then forces a rebuild.

### Docker

1. **Build the Docker Compose Services:**

```bash
yarn docker:build-dev
```

2. **Run the Docker Compose Services:**

```bash
yarn docker:run-dev
```

3. **Stop the Containers:**

```bash
yarn docker:stop-dev
```

4. **Rebuild the Containers:**

```bash
yarn docker:rebuild-dev
```

[//]: # '5. ERROR HANDLING'

## 5. ERROR HANDLING


[//]: # '6. HOSTING'

## 6. HOSTING

[![Deploy to Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/montasim/authentication-microservice)


Step-by-step guide on setting up your own Vercel instance:

Vercel is the recommended option for hosting the files since it is free and easy to set up.

1. Go to [vercel.com](https://vercel.com/).
2. Click on `Log in`.
![Login page](https://files.catbox.moe/qwqrjn.png)
3. Sign in with GitHub by pressing `Continue with GitHub`.
![Sign in with GitHub](https://files.catbox.moe/18vwjq.png)
4. Sign in to GitHub and allow access to all repositories if prompted.
5. [Fork this repo.](https://github.com/montasim/authentication-microservice/fork)
6. Go back to your [Vercel dashboard](https://vercel.com/dashboard).
7. To import a project, click the `Add New...` button and select the `Project` option.
![Add new project](https://files.catbox.moe/h1a87z.png)
8. Click the `Continue with GitHub` button, search for the required Git Repository and import it by clicking the `Import` button. Alternatively, you can import a Third-Party Git Repository using the `Import Third-Party Git Repository ->` link at the bottom of the page.
![Select GitHub project](https://files.catbox.moe/9ubkss.png)
9. Create a personal access token (PAT) [here](https://github.com/settings/tokens/new) and enable the `repo` and `user` permissions (this allows access to see private repo and user stats).
10. Copy all the .env.development file as environment variables in the Vercel dashboard.
11. Click deploy, and you're good to go. See your domains to use the API!


[//]: # '7. USED PACKAGES'

## 7. USED PACKAGES


[//]: # '8. TOOLS'

## 8. TOOLS

1. [WebStorm](https://www.jetbrains.com/webstorm/)
2. [Postman](https://www.postman.com/)
3. [Swagify.io](https://swagify.io/convert/)


[//]: # '9. ARTICLES'

## 9. ARTICLES

1. [StackOverflow answer on file upload to Google Drive](https://stackoverflow.com/questions/65181932/how-i-can-upload-file-to-google-drive-with-google-drive-api).


[//]: # '10. DO NOT FORGET TO DO'

## 10. DO NOT FORGET TO DO


[//]: # '11. TUTORIALS'

## 11. TUTORIALS

1. [Google Drive file upload tutorial](https://www.youtube.com/watch?v=bkaQTLCBBeo&t=600s).


[//]: # '12. INSPIRATIONS'


[//]: # '13. CONTRIBUTE'

## 13. CONTRIBUTE

Contributions are always welcome!
Please read the [contribution guidelines](CONTRIBUTION.md) and [contributor license agreement](CLA.md).


[//]: # '14. CONTRIBUTORS'

## 14. CONTRIBUTORS

contributors


[//]: # '15. SPECIAL THANKS'

## 15. SPECIAL THANKS


[//]: # '16. LICENSE'

## 16. LICENSE

[![Licence](https://img.shields.io/github/license/Ileriayo/markdown-badges?style=for-the-badge)](./LICENSE)


[//]: # '17. CONTACT'

## 17. CONTACT





linkedin icon




github icon




github icon




web icon




gmail icon




facebook icon




x icon