Apple Silicon Full Stack Dev with Oracle 23ai

Apple Silicon Full Stack Dev with Oracle 23ai

I while back, I discussed full stack development using Oracle 23ai. But, there was one group of developers left out. Those that wanted to do local full stack development on their Apple Silicon based Macbooks. The wait is over, there is a new Oracle 23ai Docker image specifically for Apple ARM architectures.

Oracle has built a Storage Adapter that works with the Parse platform. The Parse Platform is an open-source framework for building web and mobile applications. It is a server that runs on an Express/Node.js instance. Parse Platform supports wide variety of Web and Mobile SDKs including React/React Native, Flutter and GraphQL.

Once the following prereqs are installed, the stack can be up and ready for development in a few minutes.

Prerequisites

SQL Client - he Oracle SQL client is a software application that allows users to connect to an Oracle database and execute queries and manage the database.

Instant Client Libraries - The Oracle Instant Client is a set of software libraries that allow users to connect to an Oracle database without a full Oracle database installation.

Installation

Clone Parse Server Repository Supported version 7.3.0 and above.

git clone --depth 1 --branch 7.3.0 https://github.com/parse-community/parse-server.git
cd parse-server        

Clone the Oracle Samples repo into src/Adapters/Storage/Oracle

cd src/Adapters/Storage
git clone https://github.com/oracle-samples/oracleadapter-parse.git Oracle
cd Oracle
rm -rf .git  # IMPORTANT or build will fail
cd ../../../.. # Go back to Project Root        

Building Parse with Oracle Storage Adapter

1. Add the Oracle database dependency

 npm install [email protected]        

Quick Start node-oracledb Installation

2. Add the Parse File Adapter dependency

npm install --save @parse/fs-files-adapter        

This defaults to local storage.

Parse Server File Storage Adapter Repository

3. Run

 npm ci        

to build the server

Configuring Free23ai Oracle database image

1. Get and Start the image

docker run --name free23ai -d -p 1521:1521 -e ORACLE_PASSWORD=Welcome12345 -e APP_USER=testuser -e APP_USER_PASSWORD=Welcome12345 gvenzl/oracle-free:23.5-slim-faststart        


Run Parse Server

1. Create a config.json. This is a minimal set of configuration parameters for booting the server. The databaseURI is configured to attach to the local 23ai Oracle Database instance.

{
  "appId": "APPLICATION_ID",
  "masterKey": "MASTER_KEY",
  "allowClientClassCreation": true,
  "port": 1338,
  "logLevel": "info",
  "verbose": false,
  "mountGraphQL": true,
  "mountPlayground": true,
  "graphQLPath": "/graphql",
  "filesAdapter": {
    "module": "@parse/fs-files-adapter"
  },
  "databaseAdapter": {
    "module": "./Storage/Oracle/OracleStorageAdapter",
    "options": {
      "databaseURI": "oracledb://testuser:Welcome12345@localhost:1521/freepdb1",
      "collectionPrefix": ""
    }
  }
}        

2. Boot the Server using the Oracle Instant Client location

ORACLE_CLIENT_LOCATION=/Users/DDRECHSE/instantclient_23_3 npm start -- ./config.json        

Test the Local Stack

1. Run a curl command

 curl -X POST -H "X-Parse-Application-Id: APPLICATION_ID" -H "Content-Type: application/json" -d '{"score":12,"playerName":"scooby","cheatmode":false}' https://localhost:1338/parse/classes/GameScore        

Upon success

 {"objectId":"CdmLJT6Duc","createdAt":"2023-10-16T19:33:27.382Z"}        


2. Connect to the database and verify

 sql testuser/Welcome12345@localhost:1521/FREEPDB1        

3. Run SODA commands

SQL> soda list
List of collections:

GameScore
_Hooks
_Idempotency
_Role
_SCHEMA
_User

SQL> soda get GameScore
KEY						     Created On

3A8CB47A41A74F59BFDD143A3F365F4A.       2023-10-16T19:33:27.404374000Z

1 row selected. 

SQL> soda get GameScore -k 3A8CB47A41A74F59BFDD143A3F365F4A

Key:    	 3A8CB47A41A74F59BFDD143A3F365F4A
Content:	 {"score":12,"playerName":"scooby","cheatmode":false,"updatedAt":"2023-10-16T19:33:27.382Z","createdAt":"2023-10-16T19:33:27.382Z","_id":"CdmLJT6Duc"}

1 row selected. 


 soda help – list all soda commands
        

I hope I have convinced you that Oracle offers a powerful and flexible full stack development environment that is now supported on Apple Silicon.

Hy sir i want to learn orecl Apex but how i will start plz guide me i m a house wife i did my master deree in education i don have any knowledge about this but i can do every thing with hard work so plz tell me the guide line and road map plz

回复

要查看或添加评论,请登录

Doug Drechsel的更多文章

社区洞察

其他会员也浏览了