Coder Social home page Coder Social logo

jirawat070 / api-oracle-nestjs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from filipercampos/api-oracle-nestjs

0.0 0.0 0.0 265 KB

API Rest with Oracle DB and NestJS

Shell 1.36% JavaScript 0.35% TypeScript 82.32% CSS 15.49% Dockerfile 0.48%

api-oracle-nestjs's Introduction

Nest Logo

Description

Nest framework TypeScript starter repository.

Installation

$ npm install

Running the app

# development mode (watch)
$ npm run dev

# debug mode
$ npm run debug

# production mode
$ npm start

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Oracle

This project uses oracle 21 xe

# get image
$ docker pull gvenzl/oracle-xe:21-full

# build oracle image and detached (it gonna take while)
$ docker run -d -p 1521:1521 --name ora21cFull -e ORACLE_PASSWORD=SysPassword1 -v oracle-volume:/opt/oracle/XEORA21CFull/oradata gvenzl/oracle-xe

Redis

# build redis image and detached
$ docker run --name redis-alpine -p 6379:6379 --hostname redis -v cache:/data -d redis:7.0.4-alpine --save 20 1 --loglevel warning --requirepass r123

# detached docker compose
$ docker-compose -f docker-compose-redis.yml up -d

Docker

# build docker register
$ docker build -t api-app001 .

# detached manually
$ docker run -p 3000:3000 --name api-app001 -d api-app001

# detached docker compose
$ docker-compose up -d

# run shell image
$ docker run -it api-app001 sh

# run command insdide container running
docker exec -u 0 -it container_id sh

Docker notes

Docker as default use directory name as main node example:

# docker three
 api-oracle-nestjs
 + api
 + redis

# connect oracle database use container ip
$ docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name_or_id

Conclusion

This project presents many stuffs about: API Rest, design pattern,microservices, good practices, clean architecture and docker.

I demonstrated a lot bunch of stuff about oracle database and build my own typeorm

We also saw how to use Redis with docker and the with docker-compose. We also added Redis as a cache to an existing NestJS API and witnessed the performance benefits.

api-oracle-nestjs's People

Contributors

filipercampos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.