@ -1,23 +1,30 @@ |
|||||
POSTGRES_HOST=postgres |
### BACK ### |
||||
POSTGRES_PORT=5432 |
|
||||
POSTGRES_USER=postgres_usr |
|
||||
POSTGRES_PASSWORD=postgres_pw |
|
||||
POSTGRES_DB=transcendence |
|
||||
|
|
||||
MAIL_USER=vaganiwast@gmail.com |
|
||||
MAIL_PASSWORD= |
|
||||
|
|
||||
FRONT_FPS=144 |
|
||||
|
|
||||
HOST=localhost |
HOST=localhost |
||||
VITE_HOST=localhost |
|
||||
FRONT_PORT=80 |
FRONT_PORT=80 |
||||
BACK_PORT=3001 |
BACK_PORT=3001 |
||||
HASH_SALT=10 |
HASH_SALT=10 |
||||
|
|
||||
JWT_SECRET= |
### FRONT ### |
||||
JWT_EXPIRATION_TIME=900 |
VITE_HOST=localhost |
||||
|
VITE_BACK_PORT=3001 |
||||
|
|
||||
|
### GAME ### |
||||
|
VITE_FRONT_FPS=144 |
||||
|
|
||||
|
### 2FA ### |
||||
|
MAIL_USER=vaganiwast@gmail.com |
||||
|
MAIL_PASSWORD= |
||||
|
|
||||
|
### AUTH ### |
||||
FT_OAUTH_CLIENT_ID= |
FT_OAUTH_CLIENT_ID= |
||||
FT_OAUTH_CLIENT_SECRET= |
FT_OAUTH_CLIENT_SECRET= |
||||
FT_OAUTH_CALLBACK_URL=http://localhost:3001/log/inReturn |
FT_OAUTH_CALLBACK_URL=http://localhost:3001/log/inReturn |
||||
|
JWT_SECRET=test |
||||
|
JWT_EXPIRATION_TIME=900 |
||||
|
|
||||
|
### DB ### |
||||
|
POSTGRES_HOST=postgres |
||||
|
POSTGRES_PORT=5432 |
||||
|
POSTGRES_USER=postgres_usr |
||||
|
POSTGRES_PASSWORD=postgres_pw |
||||
|
POSTGRES_DB=transcendence |
||||
|
@ -0,0 +1,6 @@ |
|||||
|
*.ts text=auto eol=lf |
||||
|
*.svelte text=auto eol=lf |
||||
|
*.yml text=auto eol=lf |
||||
|
*.json text=auto eol=lf |
||||
|
*.html text=auto eol=lf |
||||
|
*.xml text=auto eol=lf |
@ -0,0 +1,5 @@ |
|||||
|
FROM alpine:3.15 |
||||
|
|
||||
|
RUN apk update && apk upgrade && apk add npm && npm install -g @nestjs/cli |
||||
|
WORKDIR /var/www/html |
||||
|
ENTRYPOINT npm install && npm run dev |
@ -1,10 +0,0 @@ |
|||||
FROM alpine:3.15 |
|
||||
|
|
||||
RUN apk update && apk upgrade && apk add npm \ |
|
||||
&& npm install -g @nestjs/cli |
|
||||
|
|
||||
|
|
||||
WORKDIR /var/www/html |
|
||||
|
|
||||
COPY entrypoint.sh /tmp/entrypoint.sh |
|
||||
ENTRYPOINT ["sh", "/tmp/entrypoint.sh"] |
|
@ -1,31 +0,0 @@ |
|||||
npm install; |
|
||||
cat >.env <<EOF |
|
||||
POSTGRES_HOST=$POSTGRES_HOST |
|
||||
POSTGRES_PORT=$POSTGRES_PORT |
|
||||
POSTGRES_USER=$POSTGRES_USER |
|
||||
POSTGRES_PASSWORD=$POSTGRES_PASSWORD |
|
||||
POSTGRES_DB=$POSTGRES_DB |
|
||||
|
|
||||
MAIL_USER=$MAIL_USER |
|
||||
MAIL_PASSWORD=$MAIL_PASSWORD |
|
||||
|
|
||||
HOST=$HOST |
|
||||
FRONT_PORT=$FRONT_PORT |
|
||||
BACK_PORT=$BACK_PORT |
|
||||
HASH_SALT=$HASH_SALT |
|
||||
|
|
||||
JWT_SECRET=$JWT_SECRET |
|
||||
JWT_EXPIRATION_TIME=$JWT_EXPIRATION_TIME |
|
||||
|
|
||||
FT_OAUTH_CLIENT_ID=$FT_OAUTH_CLIENT_ID |
|
||||
FT_OAUTH_CLIENT_SECRET=$FT_OAUTH_CLIENT_SECRET |
|
||||
FT_OAUTH_CALLBACK_URL=$FT_OAUTH_CALLBACK_URL |
|
||||
EOF |
|
||||
|
|
||||
if [[ $NODE_ENV == "debug" ]]; then |
|
||||
npm run start:debug; |
|
||||
elif [[ $NODE_ENV == "check" ]]; then |
|
||||
npm run format && npm run lint; echo "=== FINISH ==="; |
|
||||
else |
|
||||
npm run dev; |
|
||||
fi; |
|
@ -0,0 +1,36 @@ |
|||||
|
import { Module } from '@nestjs/common' |
||||
|
import { ConfigModule, ConfigService } from '@nestjs/config' |
||||
|
import { TypeOrmModule } from '@nestjs/typeorm' |
||||
|
import * as Joi from 'joi' |
||||
|
import { ScheduleModule } from '@nestjs/schedule' |
||||
|
|
||||
|
import { AuthModule } from './auth/auth.module' |
||||
|
import { ChatModule } from './chat/chat.module' |
||||
|
import { PongModule } from './pong/pong.module' |
||||
|
import { UsersModule } from './users/users.module' |
||||
|
|
||||
|
@Module({ |
||||
|
imports: [ |
||||
|
ScheduleModule.forRoot(), |
||||
|
TypeOrmModule.forRootAsync({ |
||||
|
imports: [ConfigModule], |
||||
|
inject: [ConfigService], |
||||
|
useFactory: (configService: ConfigService) => ({ |
||||
|
type: 'postgres', |
||||
|
host: process.env.POSTGRES_HOST || 'localhost', |
||||
|
port: (process.env.POSTGRES_PORT || 5432) as number, |
||||
|
username: process.env.POSTGRES_USER || 'postgres', |
||||
|
password: process.env.POSTGRES_PASSWORD || 'postgres', |
||||
|
database: process.env.POSTGRES_DB || 'postgres', |
||||
|
jwt_secret: process.env.JWT_SECRET || 'secret', |
||||
|
autoLoadEntities: true, |
||||
|
synchronize: true |
||||
|
}) |
||||
|
}), |
||||
|
AuthModule, |
||||
|
ChatModule, |
||||
|
PongModule, |
||||
|
UsersModule |
||||
|
] |
||||
|
}) |
||||
|
export class AppModule {} |
@ -1,73 +0,0 @@ |
|||||
<p align="center"> |
|
||||
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="200" alt="Nest Logo" /></a> |
|
||||
</p> |
|
||||
|
|
||||
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456 |
|
||||
[circleci-url]: https://circleci.com/gh/nestjs/nest |
|
||||
|
|
||||
<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p> |
|
||||
<p align="center"> |
|
||||
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a> |
|
||||
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a> |
|
||||
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a> |
|
||||
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a> |
|
||||
<a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a> |
|
||||
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a> |
|
||||
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a> |
|
||||
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a> |
|
||||
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a> |
|
||||
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a> |
|
||||
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a> |
|
||||
</p> |
|
||||
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer) |
|
||||
[![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)--> |
|
||||
|
|
||||
## Description |
|
||||
|
|
||||
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository. |
|
||||
|
|
||||
## Installation |
|
||||
|
|
||||
```bash |
|
||||
$ npm install |
|
||||
``` |
|
||||
|
|
||||
## Running the app |
|
||||
|
|
||||
```bash |
|
||||
# development |
|
||||
$ npm run start |
|
||||
|
|
||||
# watch mode |
|
||||
$ npm run start:dev |
|
||||
|
|
||||
# production mode |
|
||||
$ npm run start:prod |
|
||||
``` |
|
||||
|
|
||||
## Test |
|
||||
|
|
||||
```bash |
|
||||
# unit tests |
|
||||
$ npm run test |
|
||||
|
|
||||
# e2e tests |
|
||||
$ npm run test:e2e |
|
||||
|
|
||||
# test coverage |
|
||||
$ npm run test:cov |
|
||||
``` |
|
||||
|
|
||||
## Support |
|
||||
|
|
||||
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support). |
|
||||
|
|
||||
## Stay in touch |
|
||||
|
|
||||
- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com) |
|
||||
- Website - [https://nestjs.com](https://nestjs.com/) |
|
||||
- Twitter - [@nestframework](https://twitter.com/nestframework) |
|
||||
|
|
||||
## License |
|
||||
|
|
||||
Nest is [MIT licensed](LICENSE). |
|
@ -1,53 +0,0 @@ |
|||||
import { Module } from '@nestjs/common' |
|
||||
import { ConfigModule, ConfigService } from '@nestjs/config' |
|
||||
import { TypeOrmModule } from '@nestjs/typeorm' |
|
||||
import * as Joi from 'joi' |
|
||||
import { ScheduleModule } from '@nestjs/schedule' |
|
||||
|
|
||||
import { AuthModule } from './auth/auth.module' |
|
||||
import { ChatModule } from './chat/chat.module' |
|
||||
import { PongModule } from './pong/pong.module' |
|
||||
import { UsersModule } from './users/users.module' |
|
||||
|
|
||||
@Module({ |
|
||||
imports: [ |
|
||||
ScheduleModule.forRoot(), |
|
||||
ConfigModule.forRoot({ |
|
||||
validationSchema: Joi.object({ |
|
||||
POSTGRES_HOST: Joi.string().required(), |
|
||||
POSTGRES_PORT: Joi.number().required(), |
|
||||
POSTGRES_USER: Joi.string().required(), |
|
||||
POSTGRES_PASSWORD: Joi.string().required(), |
|
||||
POSTGRES_DB: Joi.string().required(), |
|
||||
MAIL_USER: Joi.string().required(), |
|
||||
MAIL_PASSWORD: Joi.string().required(), |
|
||||
JWT_SECRET: Joi.string().required(), |
|
||||
JWT_EXPIRATION_TIME: Joi.string().required(), |
|
||||
HOST: Joi.string().required(), |
|
||||
FRONT_PORT: Joi.number().required(), |
|
||||
BACK_PORT: Joi.number().required(), |
|
||||
HASH_SALT: Joi.number().required() |
|
||||
}) |
|
||||
}), |
|
||||
TypeOrmModule.forRootAsync({ |
|
||||
imports: [ConfigModule], |
|
||||
inject: [ConfigService], |
|
||||
useFactory: (configService: ConfigService) => ({ |
|
||||
type: 'postgres', |
|
||||
host: configService.get<string>('POSTGRES_HOST'), |
|
||||
port: configService.get<number>('POSTGRES_PORT'), |
|
||||
username: configService.get<string>('POSTGRES_USER'), |
|
||||
password: configService.get<string>('POSTGRES_PASSWORD'), |
|
||||
database: configService.get<string>('POSTGRES_DB'), |
|
||||
jwt_secret: configService.get<string>('JWT_SECRET'), |
|
||||
autoLoadEntities: true, |
|
||||
synchronize: true |
|
||||
}) |
|
||||
}), |
|
||||
AuthModule, |
|
||||
ChatModule, |
|
||||
PongModule, |
|
||||
UsersModule |
|
||||
] |
|
||||
}) |
|
||||
export class AppModule {} |
|
@ -1,8 +1,5 @@ |
|||||
FROM alpine:3.15 |
FROM alpine:3.15 |
||||
|
|
||||
RUN apk update && apk upgrade && apk add npm |
RUN apk update && apk upgrade && apk add npm |
||||
|
|
||||
WORKDIR /var/www/html |
WORKDIR /var/www/html |
||||
COPY entrypoint.sh /tmp/entrypoint.sh |
ENTRYPOINT npm install && npm run dev |
||||
|
|
||||
ENTRYPOINT ["sh", "/tmp/entrypoint.sh"] |
|
@ -1,13 +0,0 @@ |
|||||
npm install; |
|
||||
cat >.env <<EOF |
|
||||
VITE_FRONT_FPS=$FRONT_FPS |
|
||||
VITE_HOST=$HOST |
|
||||
VITE_BACK_PORT=$BACK_PORT |
|
||||
EOF |
|
||||
|
|
||||
npm install; |
|
||||
if [[ $NODE_ENV == "check" ]]; then |
|
||||
npm run format && npm run check; echo "=== FINISH ===" |
|
||||
else |
|
||||
npm run dev; |
|
||||
fi; |
|
Before Width: | Height: | Size: 724 B After Width: | Height: | Size: 724 B |
Before Width: | Height: | Size: 342 B After Width: | Height: | Size: 342 B |
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.1 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 858 B After Width: | Height: | Size: 858 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |