This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@nestjs/common'; | |
import { CreateSubscriptionDto } from './dto/create-subscription.dto'; | |
import { UpdateSubscriptionDto } from './dto/update-subscription.dto'; | |
import { Repository } from 'typeorm'; | |
import { Subscription } from './entities/subscription.entity'; | |
import { InjectRepository } from '@nestjs/typeorm'; | |
import { AmqpConnection } from '@golevelup/nestjs-rabbitmq'; | |
import { RabbitSubscribe } from '@golevelup/nestjs-rabbitmq'; | |
import { DateTime } from 'luxon'; | |
@Injectable() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Entity, Column, ObjectIdColumn, ObjectID } from 'typeorm'; | |
import { DateTime } from 'luxon'; | |
import { UpdateSubscriptionDto } from '../dto/update-subscription.dto'; | |
import { CreateSubscriptionDto } from '../dto/create-subscription.dto'; | |
@Entity('subscriptions') | |
export class Subscription { | |
constructor(subscriptionDTO?: UpdateSubscriptionDto | CreateSubscriptionDto) { | |
this.userId = subscriptionDTO?.userId; | |
this.active = subscriptionDTO?.active ?? true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Module } from '@nestjs/common'; | |
import { SubscriptionsService } from './subscriptions.service'; | |
import { SubscriptionsController } from './subscriptions.controller'; | |
import { TypeOrmModule } from '@nestjs/typeorm'; | |
import { Subscription } from './entities/subscription.entity'; | |
import { RabbitMQModule } from '@golevelup/nestjs-rabbitmq'; | |
@Module({ | |
controllers: [SubscriptionsController], | |
providers: [SubscriptionsService], | |
imports: [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Module } from '@nestjs/common'; | |
import { AppController } from './app.controller'; | |
import { AppService } from './app.service'; | |
import { UsersModule } from './users/users.module'; | |
import { PlansModule } from './plans/plans.module'; | |
import { SubscriptionsModule } from './subscriptions/subscriptions.module'; | |
import { TypeOrmModule } from '@nestjs/typeorm'; | |
@Module({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.8' | |
services: | |
app: | |
build: | |
context: . | |
dockerfile: Dockerfile | |
args: | |
# Update 'VARIANT' to pick an LTS version of Node.js: 16, 14, 12. | |
# Append -bullseye or -buster to pin to an OS version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: | |
// https://github.com/microsoft/vscode-dev-containers/tree/v0.231.6/containers/javascript-node-mongo | |
// Update the VARIANT arg in docker-compose.yml to pick a Node.js version | |
{ | |
"name": "Node.js & Mongo DB", | |
"dockerComposeFile": "docker-compose.yml", | |
"service": "app", | |
"workspaceFolder": "/workspace", | |
// Set *default* container specific settings.json values on container create. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { SafeAreaProvider } from 'react-native-safe-area-context'; | |
import * as AuthSession from 'expo-auth-session'; | |
import { RefreshTokenRequestConfig, TokenResponse, TokenResponseConfig } from 'expo-auth-session'; | |
import jwtDecode from 'jwt-decode'; | |
import { useEffect, useState } from 'react'; | |
import { Alert, Platform, Text, TouchableOpacity } from 'react-native'; | |
import { useAsyncStorage } from '@react-native-async-storage/async-storage'; | |
import * as React from 'react' | |
import * as WebBrowser from 'expo-web-browser'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:16.13.1-alpine AS build-env | |
COPY . /app | |
WORKDIR /app | |
RUN npm ci --only=production | |
FROM node:16.13.1-alpine | |
COPY --from=build-env /app /app | |
WORKDIR /app | |
CMD ["./bin/www"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variables: | |
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID | |
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY | |
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION | |
AWS_ECR: "<ecr-account>.dkr.ecr.us-east-1.amazonaws.com/<repo-name>:<tag>" | |
DOCKER_REGISTRY: "<ecr-account>.dkr.ecr.us-east-1.amazonaws.com" | |
DOCKER_HOST: "tcp://docker:2375" | |
stages: | |
- buildx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cache: | |
key: mavencache | |
paths: | |
- ./.m2/repository | |
services: | |
- docker:dind | |
variables: | |
# Instruct Testcontainers to use the daemon of DinD. | |
DOCKER_HOST: "tcp://docker:2375" |
NewerOlder