light's People
light's Issues
feat(db): add PostgreSQL db [WiP]
You need to do:
- set dependencies
npm install --save @nestjs/typeorm typeorm pg
- import module typeorm to app.module
- config .env file
PORT=3000
DB_TYPE=postgres
DB_NAME=SVVS_DB
DB_HOST=localhost
DB_HOST_NAME=postgres
DB_PORT=5433
DB_USER_NAME=postgres
DB_USER_PASSWORD=123456
PGADMIN_PORT=5555
[email protected]
PGADMIN_DEFAULT_PASSWORD=admin
FRONTEND_CLIENT_PORT=4201
- create database
Docker
version: '3.1'
services:
postgres:
image: postgres:13-alpine
hostname: ${DB_HOST_NAME}
ports:
- ${DB_PORT}:5432
environment:
POSTGRES_USER: ${DB_USER_NAME}
POSTGRES_PASSWORD: ${DB_USER_PASSWORD}
POSTGRES_DB: ${DB_NAME}
volumes:
- postgres-data:/var/lib/postgresql/data
restart: unless-stopped
networks:
- backend
pgadmin:
image: dpage/pgadmin4
depends_on:
- postgres
ports:
- ${PGADMIN_PORT}:80
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
restart: unless-stopped
networks:
- backend
volumes:
postgres-data:
networks:
backend:
Scripts
"db:start": "cp .env ./docker-compose && cd docker-compose && docker-compose up -d",
"db:stop": "cd docker-compose && docker-compose stop && rm .env",
- connect database
config
export const environment = {
production: false,
connection: {
type: process.env.DB_TYPE,
host: process.env.DB_HOST,
port: process.env.DB_PORT,
username: process.env.DB_USER_NAME,
password: process.env.DB_USER_PASSWORD,
database: process.env.DB_NAME,
dropSchema: false,
synchronize: true,
logging: true,
entities: [
'dist/apps/backend/api/src/**/*.entity{.ts, .js}'
],
migrations: [
'dist/apps/backend/api/migrations/*{.ts, .js}'
],
cli: {
'migrationsDir': 'db/migrations'
}
}
};
feat(scss): add styles [WiP]
You need to do:
guideline css
guideline sass
pattern integration 7-1 for angular
- add shared styles
- add setup style for each other apps
- add setup uses libraries shared styles
- connect frameworks
documentation
angular material
bootstrap
ng-bootstrap
ng add @angular/material
npm i bootstrap
ng add @ng-bootstrap/ng-bootstrap
ng add @ng-bootstrap/ng-bootstrap --project frontend-admin
- add setup customs framework for apps/environments
theming material
feat(admin app * Nx ws): add admin app [WiP]
You need to do:
- add admin app
nx generate @nrwl/angular:application frontend/admin --style=scss
- change ports
- setup tags
- setup IDE, linting, etc.
feat(api): add api app [WiP]
You need to do:
- connect support nest applications
NestJS doc for setup for Nx
NestJS doc
ng add @nrwl/nest
- initialize backend-api
ng g @nrwl/nest:app backend/api --frontendProject=frontend-client
- add proxy for admin app
- add tags
feat(api): add GraphQL [WiP]
You need to do:
- add dependencies
GraphQL doc
npm install @nestjs/graphql @nestjs/apollo apollo-server-express graphql-tools graphql
- setup config and check working
- connect playground
feat(api-auth): add authentication [WiP]
You need to do:
- setup dependencies password
npm install graphql-type-json
npm install @nestjs/passport passport @nestjs/jwt passport-jwt bcrypt
npm install -D @types/passport-jwt
- add shared library interfaces
- create module users
- create module auth
- setup entities and migrations
tsconfig.entities.json
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../../dist",
"types": ["node"],
"target": "es5",
"module": "commonjs"
},
"exclude": ["src/**/*.spec.ts"],
"include": ["src/app/**/*entity.ts"]
}
tsconfig.migrations.json
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../../dist",
"types": ["node"],
"target": "es5",
"module": "commonjs"
},
"exclude": ["src/**/*.spec.ts"],
"include": ["src/migrations/**/*.ts"]
}
scripts
"backend:api:entities": "node_modules/.bin/tsc --project apps/backend/api/tsconfig.entities.json",
"backend:api:migrations:run": "node_modules/.bin/tsc --project apps/backend/api/tsconfig.migrations.json && node_modules/.bin/ts-node node_modules/.bin/typeorm migration:run -t=false",
"backend:api:migration:create": "node_modules/.bin/ts-node node_modules/.bin/typeorm migration:create -n",
- create migration for test user
- test functionality
feat(Nx ws * github): init [WiP]
👋 Initialize
- initialize Nx ws
Nx documentation
npx create-nx-workspace@latest --preset=angular
- initialize github repo
- setup templates issue
Site emojipedia
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.