one-for-all-framework 4.1.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -3
- data/app/views/docs.erb +22 -2
- data/app/views/index.erb +1 -1
- data/bin/ofa +110 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1634666412d07dfeae3b9416c7a27b16436ba9d1a03f726df8b245e6f6fe71f7
|
|
4
|
+
data.tar.gz: 4240f873f851ecfccd556a7b061e2ac3c2020aa26d383b87a217506160c6295b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: efb0120858fb436c64f1ec7a92433deda88fee6dc1738661af68a0a303d8874cb4f6a5a7f2583a527ad8e9a9188b0e67b16abaf201c205044a421cb2a3780635
|
|
7
|
+
data.tar.gz: ff176420fce31ecfec8fffcec1862e911d64f8b78478d3a073f3b317bd98fa553df7b9d05fd36b5a0c219582ec1b835a83eb854480cdeb62a624822c2df02170
|
data/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<img src="public/images/logo.png" width="500" height="500" alt="OFA Framework Logo">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
-
# ⚡ One-For-All (OFA) Framework v4.
|
|
5
|
+
# ⚡ One-For-All (OFA) Framework v4.2.0
|
|
6
6
|
|
|
7
7
|
[](https://www.ruby-lang.org/)
|
|
8
8
|
[](LICENSE)
|
|
@@ -126,10 +126,13 @@ Securely manages admin credentials.
|
|
|
126
126
|
### 📁 Project Lifecycle
|
|
127
127
|
| Command | Description |
|
|
128
128
|
| :--- | :--- |
|
|
129
|
-
| `ofa new NAME [TYPE]` | **Create a new project.** Generates a new directory, initializes the framework structure, and automatically runs `bundle install`.
|
|
129
|
+
| `ofa new NAME [TYPE]` | **Create a new project.** Generates a new directory, initializes the framework structure, and automatically runs `bundle install`. |
|
|
130
130
|
| `ofa init [TYPE]` | **Initialize in current folder.** Ideal if you've already created a folder or cloned a repository. It triggers an **Interactive Wizard** to configure your Database (SQLite/MongoDB) and Image Storage (Local/Cloudinary). |
|
|
131
131
|
| `ofa run` | **Start Development Server.** Boots the high-performance Eksa Server. Your app will be accessible at `http://localhost:3000`. |
|
|
132
|
-
| `ofa
|
|
132
|
+
| `ofa console` | **Interactive REPL.** Starts a Ruby console pre-loaded with your application environment and models for testing and debugging. |
|
|
133
|
+
| `ofa doctor` | **System Health Check.** Validates `.env` config, database connectivity (SQL/MongoDB), Ruby version, and dependencies. |
|
|
134
|
+
| `ofa routes` | **Route Inspection.** Lists all registered routes in your application in a clean tabular format. |
|
|
135
|
+
| `ofa deploy` | **Production Deployment.** Automatically detects deployment targets (Railway/Docker/Git). |
|
|
133
136
|
|
|
134
137
|
---
|
|
135
138
|
|
data/app/views/docs.erb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div class="space-y-12 pb-20">
|
|
2
2
|
<div class="text-left">
|
|
3
|
-
<div class="badge-premium">Documentation v4.
|
|
3
|
+
<div class="badge-premium">Documentation v4.2.0</div>
|
|
4
4
|
<h1 class="text-5xl font-black tracking-tighter mb-4 text-slate-700 dark:text-white">Framework <span class="text-primary">Guide</span></h1>
|
|
5
5
|
<p class="text-xl text-slate-500 max-w-2xl leading-relaxed">Everything you need to know about building premium web applications with the One-For-All framework.</p>
|
|
6
6
|
</div>
|
|
@@ -62,6 +62,18 @@
|
|
|
62
62
|
<td class="px-6 py-4 font-mono text-primary">./ofa run</td>
|
|
63
63
|
<td class="px-6 py-4 text-slate-600 dark:text-slate-400">Starts the high-performance Eksa Server on port 3000.</td>
|
|
64
64
|
</tr>
|
|
65
|
+
<tr>
|
|
66
|
+
<td class="px-6 py-4 font-mono text-primary">./ofa console</td>
|
|
67
|
+
<td class="px-6 py-4 text-slate-600 dark:text-slate-400 text-xs">Interactive REPL pre-loaded with your DB & Models.</td>
|
|
68
|
+
</tr>
|
|
69
|
+
<tr>
|
|
70
|
+
<td class="px-6 py-4 font-mono text-primary">./ofa doctor</td>
|
|
71
|
+
<td class="px-6 py-4 text-slate-600 dark:text-slate-400 text-xs">Check system health (DB, Env, Gems, Config).</td>
|
|
72
|
+
</tr>
|
|
73
|
+
<tr>
|
|
74
|
+
<td class="px-6 py-4 font-mono text-primary">./ofa routes</td>
|
|
75
|
+
<td class="px-6 py-4 text-slate-600 dark:text-slate-400 text-xs">List all registered routes in a clean table.</td>
|
|
76
|
+
</tr>
|
|
65
77
|
<tr>
|
|
66
78
|
<td class="px-6 py-4 font-mono text-primary">./ofa deploy</td>
|
|
67
79
|
<td class="px-6 py-4 text-slate-600 dark:text-slate-400 text-xs italic">Railway/Docker/Git auto-detection for production.</td>
|
|
@@ -136,6 +148,14 @@
|
|
|
136
148
|
<code class="text-primary font-bold text-xs">./ofa run</code>
|
|
137
149
|
<p class="text-slate-500 text-xs mt-1">Starts the high-performance Eksa Server on port 3000.</p>
|
|
138
150
|
</div>
|
|
151
|
+
<div>
|
|
152
|
+
<code class="text-primary font-bold text-xs">./ofa console</code>
|
|
153
|
+
<p class="text-slate-500 text-xs mt-1">Interactive REPL session.</p>
|
|
154
|
+
</div>
|
|
155
|
+
<div>
|
|
156
|
+
<code class="text-primary font-bold text-xs">./ofa doctor</code>
|
|
157
|
+
<p class="text-slate-500 text-xs mt-1">System health check tool.</p>
|
|
158
|
+
</div>
|
|
139
159
|
</div>
|
|
140
160
|
</div>
|
|
141
161
|
|
|
@@ -251,7 +271,7 @@ resources :posts
|
|
|
251
271
|
<p>Authentication is handled via BCrypt hashing with an 8-hour session sliding expiration window for optimal security.</p>
|
|
252
272
|
|
|
253
273
|
<h4 class="font-bold text-lg mt-8 mb-4">🖋️ Rich Text Editor (Trix)</h4>
|
|
254
|
-
<p class="text-sm text-slate-500 mb-4">Version 4.1.0
|
|
274
|
+
<p class="text-sm text-slate-500 mb-4">Version 4.1.0 introduced a premium WYSIWYG editor integration. Enable it to transform your CMS experience:</p>
|
|
255
275
|
<div class="p-4 bg-white/5 border border-white/10 rounded-2xl mb-4 font-mono text-sm">
|
|
256
276
|
./ofa feature enable rich_text
|
|
257
277
|
</div>
|
data/app/views/index.erb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div class="text-center space-y-6 max-w-2xl mx-auto py-12">
|
|
2
2
|
<div class="inline-flex items-center px-4 py-1.5 rounded-full bg-primary/10 border border-primary/20 text-primary text-xs font-bold uppercase tracking-wider animate-pulse">
|
|
3
|
-
Framework Version 4.
|
|
3
|
+
Framework Version 4.2.0
|
|
4
4
|
</div>
|
|
5
5
|
|
|
6
6
|
<h1 class="text-5xl md:text-7xl font-black tracking-tight leading-tight">
|
data/bin/ofa
CHANGED
|
@@ -22,7 +22,7 @@ def help
|
|
|
22
22
|
puts " / __ \\/ ____/ / | "
|
|
23
23
|
puts " / / / / /_ / /| | Framework "
|
|
24
24
|
puts "/ /_/ / __/ / ___ | Premium MVC "
|
|
25
|
-
puts "\\____/_/ /_/ |_| v4.
|
|
25
|
+
puts "\\____/_/ /_/ |_| v4.2.0 "
|
|
26
26
|
puts " "
|
|
27
27
|
puts "✨ One-For-All Framework CLI ✨"
|
|
28
28
|
puts "-----------------------------"
|
|
@@ -42,6 +42,9 @@ def help
|
|
|
42
42
|
puts " ofa db migrate-data TYPE [NAME] - Migrate data to another DB"
|
|
43
43
|
puts " ofa db migrate - Run database migrations"
|
|
44
44
|
puts " ofa migrate - Run database migrations (alias for db migrate)"
|
|
45
|
+
puts " ofa console - Start interactive REPL session"
|
|
46
|
+
puts " ofa doctor - Check system health (DB, config, gems)"
|
|
47
|
+
puts " ofa routes - List all registered routes"
|
|
45
48
|
puts " ofa run - Start the application server"
|
|
46
49
|
puts " ofa deploy - Deploy project to production"
|
|
47
50
|
puts "-----------------------------"
|
|
@@ -226,7 +229,7 @@ when 'init'
|
|
|
226
229
|
puts " / __ \\/ ____/ / | "
|
|
227
230
|
puts " / / / / /_ / /| | Framework "
|
|
228
231
|
puts "/ /_/ / __/ / ___ | Premium MVC "
|
|
229
|
-
puts "\\____/_/ /_/ |_| v4.
|
|
232
|
+
puts "\\____/_/ /_/ |_| v4.2.0 "
|
|
230
233
|
puts " "
|
|
231
234
|
puts "Initializing One-For-All project as '#{app_type}' in #{PROJECT_ROOT}..."
|
|
232
235
|
|
|
@@ -628,6 +631,111 @@ when 'db'
|
|
|
628
631
|
perform_db_migration(target_type, target_name)
|
|
629
632
|
end
|
|
630
633
|
|
|
634
|
+
when 'doctor'
|
|
635
|
+
puts "🩺 One-For-All Doctor - System Health Check"
|
|
636
|
+
puts "------------------------------------------"
|
|
637
|
+
|
|
638
|
+
# 1. Environment Check
|
|
639
|
+
print "Checking .env file... "
|
|
640
|
+
if File.exist?('.env')
|
|
641
|
+
puts "✅ Found."
|
|
642
|
+
env_content = File.read('.env')
|
|
643
|
+
if env_content.include?('DATABASE_URL')
|
|
644
|
+
puts " - DATABASE_URL: Defined"
|
|
645
|
+
end
|
|
646
|
+
else
|
|
647
|
+
puts "❌ Missing! Create a .env file based on .env.example."
|
|
648
|
+
end
|
|
649
|
+
|
|
650
|
+
# 2. Database Check
|
|
651
|
+
print "Checking Database connection... "
|
|
652
|
+
begin
|
|
653
|
+
Object.const_set(:APP_ROOT, PROJECT_ROOT) unless defined?(APP_ROOT)
|
|
654
|
+
ENV['EKS_ENV'] = 'test' # Silence some output
|
|
655
|
+
require File.join(FRAMEWORK_ROOT, 'config', 'boot')
|
|
656
|
+
if defined?(DB) && DB.test_connection
|
|
657
|
+
puts "✅ Connected (#{DB_CONFIG['adapter']})"
|
|
658
|
+
else
|
|
659
|
+
puts "❌ Failed!"
|
|
660
|
+
end
|
|
661
|
+
|
|
662
|
+
if defined?(MONGO_CLIENT)
|
|
663
|
+
print "Checking MongoDB connection... "
|
|
664
|
+
begin
|
|
665
|
+
MONGO_CLIENT.database_names
|
|
666
|
+
puts "✅ Connected"
|
|
667
|
+
rescue => e
|
|
668
|
+
puts "❌ Failed: #{e.message}"
|
|
669
|
+
end
|
|
670
|
+
end
|
|
671
|
+
rescue => e
|
|
672
|
+
puts "❌ Error during boot: #{e.message}"
|
|
673
|
+
end
|
|
674
|
+
|
|
675
|
+
# 3. Ruby Version
|
|
676
|
+
print "Checking Ruby version... "
|
|
677
|
+
puts "✅ #{RUBY_VERSION}"
|
|
678
|
+
|
|
679
|
+
# 4. Gems Check
|
|
680
|
+
print "Checking dependencies... "
|
|
681
|
+
if File.exist?('Gemfile.lock')
|
|
682
|
+
puts "✅ Gemfile.lock exists."
|
|
683
|
+
else
|
|
684
|
+
puts "⚠️ Gemfile.lock not found. Run 'bundle install'."
|
|
685
|
+
end
|
|
686
|
+
|
|
687
|
+
# 5. Features Config
|
|
688
|
+
print "Checking features.json... "
|
|
689
|
+
if File.exist?('config/features.json')
|
|
690
|
+
puts "✅ Found."
|
|
691
|
+
else
|
|
692
|
+
puts "❌ Missing! Run 'ofa init'."
|
|
693
|
+
end
|
|
694
|
+
|
|
695
|
+
puts "------------------------------------------"
|
|
696
|
+
puts "Doctor check complete! ✨"
|
|
697
|
+
|
|
698
|
+
when 'console'
|
|
699
|
+
ensure_initialized!
|
|
700
|
+
puts " "
|
|
701
|
+
puts " ____ _______ ___ "
|
|
702
|
+
puts " / __ \\/ ____/ / | "
|
|
703
|
+
puts " / / / / /_ / /| | Framework "
|
|
704
|
+
puts "/ /_/ / __/ / ___ | Console (REPL) "
|
|
705
|
+
puts "\\____/_/ /_/ |_| v4.2.0 "
|
|
706
|
+
puts " "
|
|
707
|
+
puts "✨ Loading environment... (Type 'exit' to quit)"
|
|
708
|
+
|
|
709
|
+
Object.const_set(:APP_ROOT, PROJECT_ROOT) unless defined?(APP_ROOT)
|
|
710
|
+
require File.join(FRAMEWORK_ROOT, 'config', 'boot')
|
|
711
|
+
|
|
712
|
+
require 'irb'
|
|
713
|
+
ARGV.clear
|
|
714
|
+
IRB.start
|
|
715
|
+
|
|
716
|
+
when 'routes'
|
|
717
|
+
ensure_initialized!
|
|
718
|
+
puts "🗺️ Registered Routes"
|
|
719
|
+
puts "--------------------------------------------------------"
|
|
720
|
+
printf "%-8s | %-40s\n", "Verb", "Path"
|
|
721
|
+
puts "--------------------------------------------------------"
|
|
722
|
+
|
|
723
|
+
Object.const_set(:APP_ROOT, PROJECT_ROOT) unless defined?(APP_ROOT)
|
|
724
|
+
ENV['EKS_ENV'] = 'test'
|
|
725
|
+
require File.join(FRAMEWORK_ROOT, 'config', 'boot')
|
|
726
|
+
|
|
727
|
+
if defined?(ROUTES)
|
|
728
|
+
routes_hash = ROUTES.instance_variable_get(:@routes)
|
|
729
|
+
routes_hash.each do |verb, list|
|
|
730
|
+
list.each do |r|
|
|
731
|
+
printf "%-8s | %-40s\n", verb, r[:path]
|
|
732
|
+
end
|
|
733
|
+
end
|
|
734
|
+
else
|
|
735
|
+
puts "❌ No routes found."
|
|
736
|
+
end
|
|
737
|
+
puts "--------------------------------------------------------"
|
|
738
|
+
|
|
631
739
|
when 'run'
|
|
632
740
|
ensure_initialized!
|
|
633
741
|
# Check for config.ru
|