-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a028194
commit 5f8ea3e
Showing
39 changed files
with
849 additions
and
224 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,38 @@ | ||
# Git | ||
/.git | ||
/.gitignore | ||
|
||
# GitHub | ||
/.github | ||
/.husky | ||
/.vscode | ||
|
||
# Build | ||
/dist | ||
/dist-lint | ||
/localstack | ||
/node_modules | ||
/coverage | ||
|
||
# DevTools | ||
/.husky | ||
/.vscode | ||
/localstack | ||
/.czrc | ||
/.editorconfig | ||
/.eslintrc.js | ||
/.lintstagedrc | ||
/.nvmrc | ||
/jest.config.json | ||
/LICENSE | ||
/redocly.yaml | ||
|
||
# Env | ||
.env.* | ||
!.env.docker | ||
!/prisma/.env | ||
|
||
# Deploy | ||
/appspec.yml | ||
|
||
# Unnecessary | ||
/openapi | ||
/scripts | ||
/testes |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,8 @@ jobs: | |
node-version-file: .nvmrc | ||
|
||
- uses: pnpm/action-setup@v3 | ||
with: | ||
version: 8 | ||
|
||
- name: Create .env file | ||
uses: SpicyPizza/[email protected] | ||
|
@@ -33,7 +35,9 @@ jobs: | |
envkey_AWS_REGION: ${{ secrets.AWS_REGION }} | ||
envkey_GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }} | ||
envkey_GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }} | ||
envkey_JWT_SECRET: ${{ secrets.JWT_SECRET }} | ||
envkey_FACEBOOK_CLIENT_ID: ${{ secrets.FACEBOOK_CLIENT_ID }} | ||
envkey_FACEBOOK_CLIENT_SECRET: ${{ secrets.FACEBOOK_CLIENT_SECRET }} | ||
envkey_PASETO_PRIVATE_KEY: ${{ secrets.PASETO_PRIVATE_KEY }} | ||
envkey_DATABASE_URL: ${{ secrets.DATABASE_URL }} | ||
|
||
- name: Build | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,7 @@ lerna-debug.log* | |
.env | ||
.env.* | ||
!.env.example | ||
!/prisma/.env | ||
|
||
# Temp | ||
/tmp | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,11 @@ | ||
FROM node:20 | ||
|
||
WORKDIR /app | ||
|
||
COPY ./package.json ./package.json | ||
COPY ./pnpm-lock.yaml ./pnpm-lock.yaml | ||
|
||
RUN pnpm i --ignore-scripts | ||
|
||
ADD ./prisma ./prisma | ||
|
||
RUN pnpm run prepare | ||
RUN npm i --ignore-scripts --no-package-lock | ||
|
||
ADD ./ ./ | ||
|
||
CMD pnpm run start:docker | ||
RUN npm run db:prisma | ||
|
||
CMD npm run start:docker |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
#!/usr/bin/env bash | ||
bucket1="las-musas-public" | ||
bucket2="las-musas-private" | ||
bucket1="econominhas-public" | ||
bucket2="econominhas-private" | ||
|
||
##buckets verification | ||
if awslocal s3 ls "s3://$bucket1" 2>/dev/null; then | ||
echo "[INFO] $bucket1 bucket already exists" | ||
else | ||
awslocal s3 mb s3://$bucket1 | ||
echo "[INFO] $bucket1 created" | ||
echo "[INFO] $bucket1 bucket already exists" | ||
else | ||
awslocal s3 mb s3://$bucket1 | ||
echo "[INFO] $bucket1 created" | ||
fi | ||
|
||
if awslocal s3 ls "s3://$bucket2" 2>/dev/null; then | ||
echo "[INFO] $bucket2 bucket already exists" | ||
else | ||
awslocal s3 mb s3://$bucket2 | ||
echo "[INFO] $bucket2 created" | ||
echo "[INFO] $bucket2 bucket already exists" | ||
else | ||
awslocal s3 mb s3://$bucket2 | ||
echo "[INFO] $bucket2 created" | ||
fi |
File renamed without changes.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
post: | ||
tags: | ||
- Auth | ||
summary: Sign In/Up with Facebook | ||
description: | | ||
Sign Ins or Sign Ups a user using a facebook account | ||
operationId: auth-facebook | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: ../../components/schemas/auth-with-external-provider.yaml | ||
required: true | ||
responses: | ||
$ref: ../../components/responses/auth.yaml |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,6 @@ | |
"type": "git", | ||
"url": "git+https://github.com/econominhas/backend.git" | ||
}, | ||
"packageManager": "^[email protected]", | ||
"engines": { | ||
"node": ">=20" | ||
}, | ||
|
@@ -81,24 +80,24 @@ | |
"webpack-cli": "^5.1.4" | ||
}, | ||
"scripts": { | ||
"prepare": "husky install && pnpm run db:prisma", | ||
"db:prisma": "pnpm run lint:prisma && prisma generate --generator client", | ||
"db:docs": "pnpm run lint:prisma && prisma generate --generator dbml && dbdocs build ./prisma/schema.dbml", | ||
"db:gen-migration": "pnpm run lint:prisma && prisma migrate dev --name", | ||
"prepare": "husky install && npm run db:prisma", | ||
"db:prisma": "npm run lint:prisma && prisma generate --generator client", | ||
"db:docs": "npm run lint:prisma && prisma generate --generator dbml && dbdocs build ./prisma/schema.dbml", | ||
"db:gen-migration": "npm run lint:prisma && prisma migrate dev --name", | ||
"db:migrate": "prisma migrate deploy", | ||
"openapi:serve": "redocly preview-docs", | ||
"openapi:bundle": "pnpm run lint:openapi && redocly bundle -o openapi/bundle.yaml", | ||
"openapi:postman": "pnpm run openapi:bundle && openapi2postmanv2 -s openapi/bundle.yaml -o openapi/postman.json -O folderStrategy=Tags,requestParametersResolution=Example", | ||
"openapi:bundle": "npm run lint:openapi && redocly bundle -o openapi/bundle.yaml", | ||
"openapi:postman": "npm run openapi:bundle && openapi2postmanv2 -s openapi/bundle.yaml -o openapi/postman.json -O folderStrategy=Tags,requestParametersResolution=Example", | ||
"build": "./scripts/ci-cd/build.sh", | ||
"release": "standard-version", | ||
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", | ||
"start": "nest start", | ||
"start:docker": "nest start --watch", | ||
"start:dev": "docker compose up", | ||
"start:dev": "docker compose up --build", | ||
"start:db": "docker compose up postgres", | ||
"start:prod": "node main", | ||
"clean:docker": "docker container rm econominhas-api && docker image rm econominhas-api", | ||
"lint:all": "pnpm run lint:ts && pnpm run lint:code && pnpm run lint:prisma && pnpm run lint:openapi", | ||
"lint:all": "npm run lint:ts && npm run lint:code && npm run lint:prisma && npm run lint:openapi", | ||
"lint:ts": "tsc --project tsconfig.lint.json", | ||
"lint:code": "eslint \"src/**/*.ts\" --fix --quiet", | ||
"lint:prisma": "prisma-case-format --file prisma/schema.prisma --map-table-case snake,plural --map-field-case snake --map-enum-case snake -p", | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DATABASE_URL=postgresql://username:password@localhost:5432/database?schema=public |
7 changes: 7 additions & 0 deletions
7
prisma/migrations/20240411010435_add_facebook_provider/migration.sql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-- AlterEnum | ||
ALTER TYPE "sign_in_provider_enum" ADD VALUE 'FACEBOOK'; | ||
|
||
-- AlterTable | ||
ALTER TABLE "sign_in_providers" ALTER COLUMN "access_token" SET DATA TYPE VARCHAR(300), | ||
ALTER COLUMN "refresh_token" DROP NOT NULL, | ||
ALTER COLUMN "refresh_token" SET DATA TYPE VARCHAR(300); |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ import { type Account } from "@prisma/client"; | |
|
||
export const EMAIL_TEMPLATES = { | ||
MAGIC_LINK_LOGIN: { | ||
from: "", | ||
from: "[email protected]", | ||
title: "", | ||
body: "", | ||
}, | ||
|
Oops, something went wrong.