You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So this will need some work. But I think it's a good base for you guys to work off of if you are interested.
I am currently working on a full cms integration with your guys nocodb. I think it has some good potential.
You guys mentioned you want to bring this to the general public in your readme. Well you gonna need a front end that doesn't work off of nocodb as data loss can be a serious thing. However your iframes and api direction is good.
setup-script.py
import subprocess
import os
import sys
import time
# Constants
LARAVEL_DIR = "./laravel"
NOCODB_DIR = "./nocodb"
def run_command(command):
try:
# If the command is 'composer', setting shell=True to use the system PATH
subprocess.run(command, check=True, shell=True)
except subprocess.CalledProcessError as e:
print(f"An error occurred: {e}")
sys.exit(1)
def configure_env_file():
print("Please enter the database details:")
db_host = input("Database Host (localhost or 127.0.0.1 for local) or 'localhost': ") or "localhost"
db_port = input("Database Port (usually 3306) or '3306': ") or "3306"
db_name = input("Database Name or 'noco_lara_cms': ") or "noco_lara_cms"
db_user = input("Database User or 'root': ") or "root"
db_password = input("Database Password or 'password': ") or "password"
env_example_path = os.path.join(LARAVEL_DIR, '.env.example')
env_path = os.path.join(LARAVEL_DIR, '.env')
with open(env_example_path, 'r') as file:
env_content = file.readlines()
with open(env_path, 'w') as file:
for line in env_content:
if 'DB_HOST=' in line:
file.write(f'DB_HOST={db_host}\n')
elif 'DB_PORT=' in line:
file.write(f'DB_PORT={db_port}\n')
elif 'DB_DATABASE=' in line:
file.write(f'DB_DATABASE={db_name}\n')
elif 'DB_USERNAME=' in line:
file.write(f'DB_USERNAME={db_user}\n')
elif 'DB_PASSWORD=' in line:
file.write(f'DB_PASSWORD={db_password}\n')
else:
file.write(line)
def setup_laravel():
print("Setting up Laravel...")
configure_env_file()
os.chdir(LARAVEL_DIR)
run_command("composer install")
run_command("composer require laravel/ui --dev")
run_command("php artisan ui bootstrap --auth")
run_command("npm install")
run_command("npm run build")
run_command("php artisan key:generate")
run_command("php artisan migrate")
os.chdir("..")
def setup_nocodb():
print("Setting up NocoDB...")
os.makedirs(NOCODB_DIR, exist_ok=True) # Create the directory if it doesn't exist
os.chdir(NOCODB_DIR)
run_command("npm install -g pm2") # Install pm2 globally without the period
run_command("npx create-nocodb-app .") # Set up NocoDB in the current directory
run_command("npm install") # Install dependencies
run_command("pm2 start index.js") # Start with pm2 correctly
os.chdir("..") # Go back to the parent directory
def main():
# Set up Laravel
setup_laravel()
# Set up NocoDB
setup_nocodb()
print("Setup complete! Your applications should be ready to use.")
if __name__ == "__main__":
main()
```import subprocess
import os
import sys
import time
# Constants
LARAVEL_DIR = "./laravel"
NOCODB_DIR = "./nocodb"
def run_command(command):
try:
# If the command is 'composer', setting shell=True to use the system PATH
subprocess.run(command, check=True, shell=True)
except subprocess.CalledProcessError as e:
print(f"An error occurred: {e}")
sys.exit(1)
def configure_env_file():
print("Please enter the database details:")
db_host = input("Database Host (localhost or 127.0.0.1 for local) or 'localhost': ") or "localhost"
db_port = input("Database Port (usually 3306) or '3306': ") or "3306"
db_name = input("Database Name or 'noco_lara_cms': ") or "noco_lara_cms"
db_user = input("Database User or 'root': ") or "root"
db_password = input("Database Password or 'password': ") or "password"
env_example_path = os.path.join(LARAVEL_DIR, '.env.example')
env_path = os.path.join(LARAVEL_DIR, '.env')
with open(env_example_path, 'r') as file:
env_content = file.readlines()
with open(env_path, 'w') as file:
for line in env_content:
if 'DB_HOST=' in line:
file.write(f'DB_HOST={db_host}\n')
elif 'DB_PORT=' in line:
file.write(f'DB_PORT={db_port}\n')
elif 'DB_DATABASE=' in line:
file.write(f'DB_DATABASE={db_name}\n')
elif 'DB_USERNAME=' in line:
file.write(f'DB_USERNAME={db_user}\n')
elif 'DB_PASSWORD=' in line:
file.write(f'DB_PASSWORD={db_password}\n')
else:
file.write(line)
def setup_laravel():
print("Setting up Laravel...")
configure_env_file()
os.chdir(LARAVEL_DIR)
run_command("composer install")
run_command("composer require laravel/ui --dev")
run_command("php artisan ui bootstrap --auth")
run_command("npm install")
run_command("npm run build")
run_command("php artisan key:generate")
run_command("php artisan migrate")
os.chdir("..")
def setup_nocodb():
print("Setting up NocoDB...")
os.makedirs(NOCODB_DIR, exist_ok=True) # Create the directory if it doesn't exist
os.chdir(NOCODB_DIR)
run_command("npm install -g pm2") # Install pm2 globally without the period
run_command("npx create-nocodb-app .") # Set up NocoDB in the current directory
run_command("npm install") # Install dependencies
run_command("pm2 start index.js") # Start with pm2 correctly
os.chdir("..") # Go back to the parent directory
def main():
# Set up Laravel
setup_laravel()
# Set up NocoDB
setup_nocodb()
print("Setup complete! Your applications should be ready to use.")
if __name__ == "__main__":
main()
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
So this will need some work. But I think it's a good base for you guys to work off of if you are interested.
I am currently working on a full cms integration with your guys nocodb. I think it has some good potential.
You guys mentioned you want to bring this to the general public in your readme. Well you gonna need a front end that doesn't work off of nocodb as data loss can be a serious thing. However your iframes and api direction is good.
setup-script.py
Beta Was this translation helpful? Give feedback.
All reactions