https://github.com/efenstakes/authentication-api-type-graphql
A nodejs API authentication system using apollo server, type-graphql, typegoose, typescript, javascript, mongodb, AWS Lambda and Docker.
https://github.com/efenstakes/authentication-api-type-graphql
aws-lambda docker javascript mongodb nodejs serverless-framework type-graphql typescript
Last synced: about 2 months ago
JSON representation
A nodejs API authentication system using apollo server, type-graphql, typegoose, typescript, javascript, mongodb, AWS Lambda and Docker.
- Host: GitHub
- URL: https://github.com/efenstakes/authentication-api-type-graphql
- Owner: efenstakes
- Created: 2023-09-09T08:42:17.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-09T09:17:26.000Z (over 2 years ago)
- Last Synced: 2025-06-02T00:46:10.488Z (about 1 year ago)
- Topics: aws-lambda, docker, javascript, mongodb, nodejs, serverless-framework, type-graphql, typescript
- Language: TypeScript
- Homepage:
- Size: 45.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Authentication API
The code in this repo is fully functioning authentication API using graphql apollo, type-graphql, typegoose, nodejs, typescript, javascript, jwt tokens, express and mongodb.
## 🚀 Start
To start this project, first clone the code using git:
```sh
git clone https://github.com/efenstakes/authentication-api-type-graphql api
```
Navigate to the project directory:
```sh
cd api
```
Install dependencies:
```sh
yarn install
```
Create .env in the src/ directory with below keys:
```sh
touch src/.env
```
DB_URL=
PORT=
ACCESS_TOKEN_SECRET=
REFRESH_TOKEN_SECRET=
To start the API run:
```sh
yarn dev
```
To build the API run:
```sh
yarn build
```
To deploy the API to AWS Lambda, ensure you install serverless and run:
```sh
yarn build && serverless deploy
```
### Alternatively, you can use docker to run the api.
Build the Docker image:
```sh
docker build -t auth-api .
```
Start the Docker container:
```sh
docker run -p 8080:8080 auth-api
```
## Note For SQL users
Typegoose can easily be replaced by an SQL ORM like TypeORM and this API will work perfectly with MySQL, Postgres or any other MYSQL database.
## Contact
Contact me through.
efenstakes101@gmail.com