Skip to content

oracle/create-database-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Create Database App

Table of Contents

Overview

Installation

  1. Install the package globally using npm
npm install -g @dbtools/create-database-app

Project Name:

  1. Enter a desired name for your application
? What would you like your application's name to be?

Template Selection:

  1. Select node-vanilla
? Which template would you like to use for your project? (Use arrow keys)
> node-vanilla
> node-react
> node-vue
> node-react-todo

Database Connection Type:

  1. Select the preferred database connection method
? Which database connection type would you like to choose? (Use arrow keys)
> Cloud Wallet Path
> Basic Connection (Protocol, Hostname, Port, Service Name / SID)

Basic Connection Configuration:

  1. Provide database connection details when promted by the terminal
  • Protocol: (defaults to TCP)
? What is your database protocol? (TCP)
  • Hostname: (defaults to localhost)
? What is your database protocol? (TCP)
  • Protocol: (defaults to TCP)
? What is your database port? (1521)
  • Service Type:
? Which service type would you like to use? (Use arrow keys)
> SID
> Service name
  • SID:
? Please input your database SID:
  • Service Name:
? Please input your database service name:
  • Database Username
? What's your database username?
  • Database Password
? What's your database password?

Database Environment

Within this .env file, you'll find details regarding the connection to the database used in the application.

# Database User
DB_USER= username
# Database User
DB_PASSWORD= password
# Connection string to your ADB instance
CONNECT_STRING= connection_string

Cloud Wallet Path (if selected)

If you selected the option of Cloud Wallet path yo will need to establish an Oracle Wallet, you'll require the Oracle Public Key Infrastructure (PKI) command line tool, known as orapki.

WALLETPATH <Domain Root>/<Domain Name>/config/fmwconfig/essconfig/essbase/walletssl

Next you will then provide the path of your Cloud Wallet

? Please input your Cloud Wallet Path:

Cloud Wallet Environment

Within this configuration file, you'll find details regarding the connection to the cloud Wallet used in the application.

# Oracle Wallet Password (If using a cloud wallet)
WALLET_PASSWORD= password
# Path to your Oracle Wallet directory (If using a cloud wallet)
WALLET_LOCATION= <Domain Root>/<Domain Name>/config/fmwconfig/essconfig/essbase/walletssl

Usage

$ npm install -g @dbtools/create-database-app
$ create-database-app COMMAND
running command...
$ create-database-app (--version)
@dbtools/create-database-app/1.1.3 darwin-arm64 node-v18.18.2
$ create-database-app --help [COMMAND]
USAGE
  $ create-database-app COMMAND
...

Commands

Create an Oracle Database Application from a template.

NOTE: The applications generated by this package should not be deployed using privileged database accounts. In turn, Oracle recommends for them to be deployed using the least privileged account possible.

Prerequisites

  • An Oracle Database, either on-prem or an Autonomous Database instance
  • Node.js 18 (Recommendation is to use nvm)

Getting Started

The main application usage is through the @oracle/create-database-app NPM package, which will scaffold an application that will be connected to your Oracle Database.

npm create @oracle/database-app

This will temporarily install the package in your computer and prompt you for details like the name of the application, the template, and the database connection, from which it will create a git folder named as the given application name in your current directory, and install its dependencies.

Next, you will be able to open the project in your favorite IDE or Code Editor and read the provided documentation to get started creating a database application using your favorite framework. We ship configuration files with recommended settings and extensions for Visual Studio Code.

The package offers the following templates, which connect to the database using the the oracledb database driver:

  • node-vanilla: A starter template that uses Node.js, vanilla JavaScript, HTML and CSS. It is built by vite
  • node-jet: A starter template that uses Node.js and Oracle JET. It is built using the ojet-cli
  • node-react: A starter template that uses Node.js and React. It is built by vite
  • node-vue: A starter template that uses Node.js and Vue.js. It is built by vite
  • node-react-todo: A simple task manager template that uses Node.js and React. It demonstrates the use of the database for Create, Read, Update and Delete (CRUD) operations. It is built by vite

Each of the templates include documentation for you to get started with them, as well as NPM scripts for you to use right after generating the application.

You can provide the following options directly to the command:

  • --name: followed by the name of your application
  • --template: followed by the name of the template to use (See above)

If none or only a few options are provided to the command, it will prompt for the missing details.

Examples

Create a React Database App

If you want to generate an application named my-app with the node-react template, you can execute:

npm create @oracle/database-app -- \
    --name 'my-app' \
    --template 'node-react'

Create a Todo Database App

If you want to generate an application named my-todo with the node-todo template, you can execute:

npm create @oracle/database-app -- \
    --name 'my-todo' \
    --template 'node-react-todo'

Contributing

This project welcomes contributions from the community. Before submitting a pull request, please review our contribution guide

Security

Please consult the security guide for our responsible security vulnerability disclosure process

License

Copyright (c) 2024 Oracle and/or its affiliates.

Released under the Universal Permissive License v1.0 as shown at https://oss.oracle.com/licenses/upl/.

About

An NPM package to create Oracle Database Applications from a selection of templates

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 12