From c93505d7f07c255ff85ec99e5e034925facdf495 Mon Sep 17 00:00:00 2001 From: liquidrinu Date: Wed, 21 May 2025 02:14:45 +0200 Subject: [PATCH] fixed readme upstream --- README.md | 78 +++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 53 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 62823d9..3598aa6 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,26 @@ A full-stack application boilerplate with a React frontend and Node.js backend - [๐Ÿ“š Table of Contents](#-table-of-contents) - [๐Ÿ“ Project Structure](#-project-structure) - [โš™๏ธ Prerequisites](#๏ธ-prerequisites) - - [Development Setup](#development-setup) - - [Important Note: Database Must Run in Docker](#important-note-database-must-run-in-docker) - - [Running Services Separately (Recommended for Development)](#running-services-separately-recommended-for-development) - - [Terminal 1: Backend Service](#terminal-1-backend-service) + - [๐Ÿ’ป Development Setup](#-development-setup) + - [Alternate: Running Services in Separate Terminals](#alternate-running-services-in-separate-terminals) + - [๐Ÿ› ๏ธ Environment Setup](#๏ธ-environment-setup) +- [For Kubernetes, these are set in chart/values.yaml:](#for-kubernetes-these-are-set-in-chartvaluesyaml) +- [POSTGRES\_NAME=fusero-boilerplate-db](#postgres_namefusero-boilerplate-db) +- [POSTGRES\_HOSTNAME=postgres-service](#postgres_hostnamepostgres-service) +- [POSTGRES\_PORT=19095](#postgres_port19095) +- [POSTGRES\_USER=root](#postgres_userroot) +- [POSTGRES\_PASSWORD=root123](#postgres_passwordroot123) + - [๐Ÿš€ Production Deployment](#-production-deployment) + - [๐ŸŒ Frontend Routing in Production](#-frontend-routing-in-production) + - [๐Ÿ” HTTPS with Self-Signed Certificates](#-https-with-self-signed-certificates) + - [๐Ÿง  Development Best Practices](#-development-best-practices) + - [๐Ÿ“˜ API Documentation](#-api-documentation) + - [๐Ÿงฉ ChatGPT-Powered Endpoint Creation](#-chatgpt-powered-endpoint-creation) + - [๐Ÿงช Troubleshooting](#-troubleshooting) + - [๐Ÿค Contributing](#-contributing) + - [๐Ÿ“„ License](#-license) + - [Kubernetes Troubleshooting \& Redeployment Commands](#kubernetes-troubleshooting--redeployment-commands) + - [1. Rebuild the backend Docker image (after code/config changes)](#1-rebuild-the-backend-docker-image-after-codeconfig-changes) - [2. (If using a remote registry) Push the image](#2-if-using-a-remote-registry-push-the-image) - [3. Upgrade the Helm release with the latest values](#3-upgrade-the-helm-release-with-the-latest-values) - [4. Restart the backend deployment to pick up new images and env vars](#4-restart-the-backend-deployment-to-pick-up-new-images-and-env-vars) @@ -53,36 +69,48 @@ fusero-app-boilerplate/ ## โš™๏ธ Prerequisites -- Node.js (v20 or higher) -- npm (v9 or higher) -- Docker and Docker Compose +- Node.js (v20 or higher) +- npm (v9 or higher) +- Docker & Docker Compose - Git -## Development Setup +--- -### Important Note: Database Must Run in Docker -The PostgreSQL database must always run in Docker, regardless of your development setup choice. This ensures consistent database behavior across all environments. +## ๐Ÿ’ป Development Setup -To start the database: -```bash -docker-compose up db -``` +๐Ÿ—ƒ๏ธ PostgreSQL must run in Docker for consistent behavior. -### Running Services Separately (Recommended for Development) +Create volume and start the database: +docker volume create fusero-db-data +docker-compose up -d db -For better debugging experience, run the frontend and backend in separate terminal windows, while keeping the database in Docker: +Backend setup: +cd backend +cp .env.example .env +npm install +npm run migrate +npm run seed +npm run dev & +cd .. -1. **First, ensure the database is running in Docker** - ```bash - docker-compose up db - ``` +Frontend setup: +cd frontend +cp .env.example .env +npm install +npm run dev & +cd .. -2. **Then, in separate terminal windows:** +App is running: +Frontend โ†’ http://localhost:3000 +Backend โ†’ http://localhost:14000 -#### Terminal 1: Backend Service -```bash -cd backend -npm install +--- + +### Alternate: Running Services in Separate Terminals + +Terminal 1 (backend): +cd backend +npm install npm run dev Terminal 2 (frontend):