Skip to content

Commit f604735

Browse files
committed
chore: rename repository
updated README added redis.conf for docker
1 parent 8d1f0f2 commit f604735

File tree

9 files changed

+78
-29
lines changed

9 files changed

+78
-29
lines changed

.cloud/redis.conf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Enable persistence
2+
appendonly yes
3+
appendfsync everysec
4+
5+
# Snapshotting (adjust as needed)
6+
save 900 1
7+
save 300 10
8+
save 60 10000
9+
10+
# AOF (Append-Only File) configuration
11+
appendfilename "appendonly.aof"

README.md

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,55 @@
1-
# Basic Authentication for Nodejs
1+
# Node.js Rest API
22

33
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](http://prettier.io) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
44

5-
This project, titled "Basic Authentication for Nodejs", is a comprehensive authentication solution built with Node.js. It includes features such as user authentication, token refresh, user logout, password reset, and user management (creation, update, deletion).
5+
This is a sample Node.js application comprehensive API including features such as user authentication, token refresh, user logout, password reset, and user management (creation, update, deletion).
66

77
Additionally, it supports authentication through various platforms including Facebook, Apple, Google, and Github. Twitter and LinkedIn are planned for future integration.
88

99
The project also includes a Swagger documentation.
1010

11+
## Features
12+
- Auth
13+
- [X] Authenticate user
14+
- [X] Email verify
15+
- [X] Implement "Forgot Password" via email
16+
- [] Implement "Forgot Password" via phone
17+
- [X] Logout a user
18+
- [X] Refresh token
19+
- [X] Implement "Reset Password" via email
20+
- [] Implement "Reset Password" via phone
21+
- User
22+
- [X] Create a new user
23+
- [X] Update user
24+
- [X] Reset password
25+
- [X] Delete user
26+
- Social Platform Integration
27+
- [ ] Linkedin
28+
- [ ] Twitter
29+
- [X] Apple
30+
- [X] Facebook
31+
- [X] Github
32+
- [X] Google
33+
- Testing
34+
- [X] Unit
35+
- [ ] E2E
36+
- [ ] Integration
37+
- [X] Implement Swagger for API documentation
38+
39+
## API Documentation
40+
41+
The REST API exposes its OpenAPI. You can view the API definition interactively using the Swagger UI, hosted at /docs. Simply start the server and navigate to [http://127.0.0.1:5858/docs](http://127.0.0.1:5858/docs) in your browser to access the Swagger UI.
42+
43+
Alternatively, you can explore the [online version of the API documentation](https://neverovski.github.io/nodejs-rest-api/) without running the server.
44+
45+
[![openapi](docs/img/openapi.png)](https://neverovski.github.io/nodejs-rest-api/)
46+
1147
## Installation
1248

1349
Development environment requirements:
14-
- [Docker](https://www.docker.com) >= 17.06
15-
- [Docker Compose](https://docs.docker.com/compose/install/)
50+
- [Node.js](https://nodejs.org) >= 20
51+
- [Docker](https://www.docker.com) >= 24
52+
- [Docker Compose V2](https://docs.docker.com/compose/install/)
1653

1754
## Project initialization
1855

docker-compose.yml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
version: '3.9'
22

33
services:
4-
auth-server:
5-
image: auth-server
6-
container_name: auth-server
4+
rest-api-server:
5+
image: rest-api-server
6+
container_name: rest-api-server
77
networks:
8-
- auth-network
8+
- rest-api-network
99
build:
1010
context: .
1111
dockerfile: ./Dockerfile
@@ -17,25 +17,26 @@ services:
1717
- ${APP_PORT}:${APP_PORT}
1818
restart: unless-stopped
1919

20-
auth-redis:
20+
rest-api-redis:
2121
image: redis:7
22-
container_name: auth-redis
22+
container_name: rest-api-redis
2323
networks:
24-
- auth-network
25-
command: redis-server --save 20 1 --loglevel warning
24+
- rest-api-network
25+
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
2626
volumes:
27-
- auth-redis-data:/data
27+
- ./.cloud/redis.conf:/usr/local/etc/redis/redis.conf
28+
- rest-api-redis-data:/data
2829
ports:
2930
- ${REDIS_PORT}:6379
3031
restart: unless-stopped
3132

32-
auth-db:
33+
rest-api-db:
3334
image: postgres:15
34-
container_name: auth-db
35+
container_name: rest-api-db
3536
networks:
36-
- auth-network
37+
- rest-api-network
3738
volumes:
38-
- auth-db-data:/var/lib/postgresql/data
39+
- rest-api-db-data:/var/lib/postgresql/data
3940
environment:
4041
TZ: 'UTC'
4142
POSTGRES_DB: ${DB_NAME}
@@ -46,11 +47,11 @@ services:
4647
restart: unless-stopped
4748

4849
volumes:
49-
auth-redis-data:
50+
rest-api-redis-data:
5051
driver: local
51-
auth-db-data:
52+
rest-api-db-data:
5253
driver: local
5354

5455
networks:
55-
auth-network:
56-
name: auth-network
56+
rest-api-network:
57+
name: rest-api-network

docs/img/openapi.png

160 KB
Loading

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "nodejs-auth-jwt",
2+
"name": "nodejs-rest-api",
33
"version": "1.3.0",
44
"description": "Node.js for Token Based Authentication (access and refresh) with PostgreSQL database.",
55
"index": "src/index.ts",
@@ -38,7 +38,7 @@
3838
},
3939
"repository": {
4040
"type": "git",
41-
"url": "git+https://github.com/neverovski/nodejs-auth-jwt.git"
41+
"url": "git+https://github.com/neverovski/nodejs-rest-api.git"
4242
},
4343
"author": {
4444
"name": "Dmitry Neverovski",
@@ -47,13 +47,13 @@
4747
},
4848
"license": "MIT",
4949
"bugs": {
50-
"url": "https://github.com/neverovski/nodejs-auth-jwt/issues"
50+
"url": "https://github.com/neverovski/nodejs-rest-api/issues"
5151
},
5252
"engines": {
5353
"node": "^20",
5454
"npm": "^10"
5555
},
56-
"homepage": "https://github.com/neverovski/nodejs-auth-jwt#readme",
56+
"homepage": "https://github.com/neverovski/nodejs-rest-api#readme",
5757
"dependencies": {
5858
"@autotelic/pino-seq-transport": "^0.1.0",
5959
"@elastic/ecs-pino-format": "^1.5.0",

src/common/utils/swagger.util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class SwaggerUtil {
1010
definition: {
1111
openapi: '3.0.3',
1212
info: {
13-
title: 'Auth - OpenAPI 3.0',
13+
title: 'Node.js Rest API - OpenAPI 3.0',
1414
version,
1515
description,
1616
contact: author,

src/modules/auth/auth.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { IAuthController, IAuthService } from './interface';
2727
* @openapi
2828
* tags:
2929
* name: Auth
30-
* description: auth
30+
* description: The Auth API provides endpoints for managing user authentication, including login, logout, password reset, and token refresh.
3131
*/
3232
@Injectable()
3333
export class AuthController extends ControllerCore implements IAuthController {

src/modules/user/user.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { UserInject } from './user.enum';
2121
* @openapi
2222
* tags:
2323
* name: User
24-
* description: user
24+
* description: The User API provides endpoints for managing user data, including creating, updating, retrieving, and deleting user records.
2525
*/
2626
@Injectable()
2727
export class UserController extends ControllerCore implements IUserController {

swagger.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const { author, description, version } = require('./package.json');
33
module.exports = {
44
openapi: '3.0.3',
55
info: {
6-
title: 'Auth - OpenAPI 3.0',
6+
title: 'Node.js Rest API - OpenAPI 3.0',
77
version,
88
description,
99
contact: author,

0 commit comments

Comments
 (0)