Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OCI Infrastructure & APEX Application — ACE Demo

OCI Terraform APEX

A production-grade Oracle Cloud Infrastructure deployment featuring a full-stack APEX application on Autonomous Database, cloud networking with compute, and a serverless API Gateway — all on the Always Free Tier.

Architecture Overview

                              ┌─────────────────────────────────────────┐
                              │          OCI Tenancy (us-phoenix-1)     │
                              │    Compartment: ace-demo                │
                              │                                         │
Internet ──► Internet GW ──►  │  ┌──────────────────────────────────┐   │
                              │  │  VCN: 10.0.0.0/16                │   │
                              │  │                                   │   │
                              │  │  ┌─────────────┐ ┌────────────┐  │   │
                              │  │  │Public Subnet │ │Private Sub │  │   │
                              │  │  │10.0.1.0/24   │ │10.0.2.0/24│  │   │
                              │  │  │              │ │            │  │   │
                              │  │  │ ┌──────────┐ │ │  NAT GW ──┼──┼───┼──► Internet
                              │  │  │ │Compute   │ │ │            │  │   │
                              │  │  │ │(Nginx)   │ │ └────────────┘  │   │
                              │  │  │ └──────────┘ │                 │   │
                              │  │  │              │                 │   │
                              │  │  │ ┌──────────┐ │                 │   │
                              │  │  │ │API GW    │ │                 │   │
                              │  │  │ │(3 routes)│ │                 │   │
                              │  │  │ └─────┬────┘ │                 │   │
                              │  │  └───────┼──────┘                 │   │
                              │  └──────────┼────────────────────────┘   │
                              │             │                            │
                              │  ┌──────────▼─────────────────────────┐  │
                              │  │  Autonomous DB (23ai ATP)          │  │
                              │  │  ├── APEX Workspace                │  │
                              │  │  ├── ORDS REST APIs                │  │
                              │  │  └── PL/SQL Business Logic         │  │
                              │  └────────────────────────────────────┘  │
                              │                                          │
                              │  ┌────────────────────────────────────┐  │
                              │  │  Object Storage: ace-demo-assets   │  │
                              │  │  (Public Read)                     │  │
                              │  └────────────────────────────────────┘  │
                              │                                          │
                              │  ┌────────────────────────────────────┐  │
                              │  │  Oracle Functions: ace-demo-fn-app │  │
                              │  └────────────────────────────────────┘  │
                              └──────────────────────────────────────────┘

Projects

1. APEX Expense Tracker on Autonomous Database

A full-stack expense tracking application built with Oracle APEX on Always Free Autonomous Transaction Processing (23ai).

Features:

  • Interactive Report dashboard with spending visualizations
  • Form-based data entry with List of Values for categories
  • Interactive Grid for CRUD operations on categories
  • PL/SQL function for monthly aggregate calculations
  • ORDS REST API endpoints for programmatic access

Technologies: Oracle Autonomous Database (ATP), Oracle APEX, PL/SQL, ORDS, SQL Developer Web

2. Cloud Infrastructure Build-Out

Production-style networking and compute deployment following OCI best practices.

Components:

  • VCN with public/private subnet isolation
  • Internet Gateway + NAT Gateway architecture
  • Security Lists with least-privilege ingress rules
  • Always Free compute instance running Nginx
  • Object Storage with public read access

Technologies: OCI Networking, OCI Compute, OCI Object Storage, Oracle Linux 8

3. Serverless API with API Gateway

Cloud-native REST API using OCI API Gateway as a unified entry point.

Endpoints:

Route Method Backend Description
/api/health GET Stock Response Service health check
/api/categories GET ORDS Proxy Expense categories from ADB
/api/expenses GET ORDS Proxy Expense dashboard data

Technologies: OCI API Gateway, Oracle Functions, ORDS

Repository Structure

oci-ace-demo/
├── terraform/              # Infrastructure as Code
│   ├── main.tf             # Provider and compartment
│   ├── network.tf          # VCN, subnets, gateways
│   ├── compute.tf          # Compute instance
│   ├── database.tf         # Autonomous Database
│   ├── storage.tf          # Object Storage
│   ├── apigateway.tf       # API Gateway + Functions
│   ├── variables.tf        # Configurable variables
│   ├── outputs.tf          # Output values
│   └── terraform.tfvars.example
├── apex-app/               # APEX application artifacts
│   ├── schema.sql          # DDL for tables, views, functions
│   ├── seed_data.sql       # Sample data
│   ├── rest_config.sql     # ORDS REST enablement
│   └── workspace_setup.sql # APEX workspace creation
├── scripts/                # Automation scripts
│   ├── provision.sh        # Full provisioning via OCI CLI
│   ├── setup_webserver.sh  # Nginx installation
│   └── test_endpoints.sh   # API endpoint verification
├── api-gateway/            # API Gateway configuration
│   └── deployment.json     # Route definitions
├── docs/                   # Documentation
│   └── architecture.md     # Detailed architecture notes
├── .gitignore
├── LICENSE
└── README.md

Quick Start

Prerequisites

  • OCI Free Tier account
  • OCI CLI installed and configured
  • Terraform >= 1.0 (optional, for IaC approach)

Option 1: Terraform (Recommended)

cd terraform/
cp terraform.tfvars.example terraform.tfvars
# Edit terraform.tfvars with your tenancy details
terraform init
terraform plan
terraform apply

Option 2: OCI CLI Scripts

cd scripts/
chmod +x provision.sh
./provision.sh

Post-Deployment

  1. SSH into the compute instance and run scripts/setup_webserver.sh
  2. Open the APEX URL and build the application using apex-app/ SQL scripts
  3. Test API endpoints with scripts/test_endpoints.sh

Cost

$0/month — All resources use OCI Always Free Tier:

  • 1x VM.Standard.E2.1.Micro (1/8 OCPU, 1 GB RAM)
  • 1x Autonomous Database (1 ECPU, 20 GB storage)
  • 10 GB Object Storage
  • API Gateway (free tier)
  • Oracle Functions (free tier)

License

MIT License — see LICENSE for details.

Author

Built for the Oracle ACE Apprentice Product Usage Milestone.

About

OCI Infrastructure & APEX Application - Autonomous DB, VCN, Compute, API Gateway, Functions on Always Free Tier

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages