Skip to content

refactor: update README files to reflect project name change from Qui… #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
May 19, 2025
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
bd74a2b
refactor: update README files to reflect project name change from Qui…
cubxxw May 18, 2025
03b230e
feat: enhance Google OAuth login functionality and update API documen…
cubxxw May 18, 2025
31deb86
chore: streamline GitHub Actions workflow for client generation
cubxxw May 18, 2025
586141c
chore: improve GitHub Actions workflow for client generation
cubxxw May 18, 2025
01f3c8b
chore: update GitHub Actions and refactor authentication logic
cubxxw May 18, 2025
c4e60a4
chore: update OpenAPI documentation and improve type safety
cubxxw May 19, 2025
4355212
chore: update GitHub Actions workflow for client generation
cubxxw May 19, 2025
c691874
chore: update database driver handling and improve test setup
cubxxw May 19, 2025
3bb7452
chore: enhance test database setup and improve error handling
cubxxw May 19, 2025
7c19111
chore: refactor imports to use custom client types
cubxxw May 19, 2025
0ecf48c
chore: remove deprecated Google OAuth and configuration files
cubxxw May 19, 2025
4a1a8b4
chore: update import statements for ItemPublic type consistency
cubxxw May 19, 2025
546d775
chore: compress OpenAPI JSON structure for improved readability
cubxxw May 19, 2025
5ec87f5
chore: remove lint-backend workflow and add symlink for pnpm-lock.yaml
cubxxw May 19, 2025
466642e
chore: enhance .env file generation logic in Makefile
cubxxw May 19, 2025
9aefe6f
chore: enhance boolean parsing and test mode detection in pre-start s…
cubxxw May 19, 2025
9455b35
chore: update GitHub Actions workflow to install pnpm and streamline …
cubxxw May 19, 2025
1666a96
chore: update GitHub Actions workflow to install pnpm in multiple dir…
cubxxw May 19, 2025
569e60a
chore: update GitHub Actions workflows for improved dependency manage…
cubxxw May 19, 2025
9e0302e
fix: update generate-client workflow to ensure proper commit handling
cubxxw May 19, 2025
c137d78
chore: reorder Makefile targets for improved build process
cubxxw May 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 16 additions & 37 deletions .github/workflows/generate-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,28 @@ name: Generate Client

on:
pull_request:
types:
- opened
- synchronize
push: # Also consider running on push to main/main to ensure consistency
branches:
- main # Or your default branch
types: [opened, synchronize]
push:
branches: [main]

permissions:
contents: write # Needed for pushing commits on same-repo events
contents: write

jobs:
generate-client:
runs-on: ubuntu-latest

steps:
# 1. Checkout Code - Single step handles both fork and same-repo PRs/pushes
- name: Checkout Code
uses: actions/checkout@v4
# Fetch depth 0 is needed for accurate diff/commit history if required elsewhere
# For pushing back, fetch the specific ref for same-repo PRs
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && github.head_ref || '' }}
# Use a PAT for same-repo events if you need to trigger other workflows
# Standard GITHUB_TOKEN is often sufficient for basic pushes
# token: ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && secrets.YOUR_PAT_OR_GITHUB_TOKEN || '' }}

# 2. Setup Environment
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9.9.0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
Expand All @@ -46,34 +37,27 @@ jobs:
with:
python-version: "3.10"

- name: Install uv (Python Package Installer)
uses: astral-sh/setup-uv@v1 # Use v1 for stable release
- name: Install uv
uses: astral-sh/setup-uv@v1
with:
# version: "0.4.15" # Specifying version is optional, can use latest stable
enable-cache: true

# 3. Install Dependencies
- name: Install Frontend Dependencies
run: pnpm install
working-directory: frontend

- name: Install Admin Dependencies
run: pnpm install
working-directory: admin

# 安装所有后端依赖项
- name: Install Backend Dependencies
run: |
uv sync
source .venv/bin/activate
pip install .
working-directory: backend

# 4. Run Generation Script with Error Handling
- name: Generate Client
# Use `uv run` to execute within the backend context if needed,
# or just run the script directly if VIRTUAL_ENV isn't strictly necessary
# for the script itself (it might just need python)
run: |
make generate-client || {
echo "❌ Failed to run generate-client.sh script."
Expand All @@ -87,17 +71,14 @@ jobs:
SENTRY_DSN: ""
POSTHOG_API_KEY: ""
POSTHOG_HOST: ""
# VIRTUAL_ENV might not be needed if uv sync --system is used
VIRTUAL_ENV: .venv

# 5. Configure Git User
- name: Configure Git User
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git config --global user.email "github-actions@github.com"
git config --global user.name "GitHub Actions"

# 6. Stage Generated Files
- name: Stage Generated Client Files
- name: Stage Generated Files
run: |
git add frontend/app/openapi-client
git add admin/src/client
Expand All @@ -110,18 +91,16 @@ jobs:
# Check if there are staged changes
if ! git diff --staged --quiet; then
echo "✅ Changes detected in generated client. Committing and pushing..."
# Pull before pushing to avoid conflicts
git pull --rebase origin ${{ github.head_ref || github.ref_name }}
# Pull before pushing to avoid conflicts if possible (optional)
git pull --ff-only origin ${{ github.head_ref || github.ref_name }}
git commit -m "ci: ✨ Autogenerate frontend client"
git push origin HEAD:${{ github.head_ref || github.ref_name }}
else
echo "✅ No changes detected in generated client."
fi
env:
# GITHUB_TOKEN has write permissions for same-repo events by default
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Use a PAT if you need to trigger subsequent workflows:
# GITHUB_TOKEN: ${{ secrets.YOUR_PAT_WITH_WRITE_ACCESS }}
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}

# 8. Handle Changes for Fork PRs (Warn, Don't Fail)
- name: Check for Uncommitted Changes (Fork PRs)
Expand All @@ -137,4 +116,4 @@ jobs:
# DO NOT exit 1 - Allow the workflow to continue
else
echo "✅ No changes detected in generated client."
fi
fi
5 changes: 5 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9.9.0
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
working-directory: frontend
Expand Down
148 changes: 140 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,142 @@ EXTENSION_DIR := $(ROOT_DIR)/extension
# Check if tools are installed
PNPM_EXISTS := $(shell command -v pnpm 2> /dev/null)
UV_EXISTS := $(shell command -v uv 2> /dev/null)
DOPPLER_EXISTS := $(shell command -v doppler 2> /dev/null)

# ==============================================================================
# ENV MANAGEMENT
# ==============================================================================

## env-init: Initialize all .env files by checking for their existence and creating if missing
.PHONY: env-init
env-init: check-root-env check-admin-env check-frontend-env check-extension-env

## check-doppler: Check if Doppler CLI is installed
.PHONY: check-doppler
check-doppler:
ifndef DOPPLER_EXISTS
@echo "===========> Doppler CLI is not installed. Please install it following the instructions at https://docs.doppler.com/docs/cli"
@echo "===========> For example: (curl -Ls --tlsv1.2 --proto \"=https\" --retry 3 https://cli.doppler.com/install.sh || wget -t 3 -qO- https://cli.doppler.com/install.sh) | sh"
@exit 1
endif
@echo "===========> Doppler CLI is installed"

## doppler-login-check: Check if user is logged in to Doppler
.PHONY: doppler-login-check
doppler-login-check: check-doppler
@if ! doppler configure > /dev/null 2>&1; then \
if [ -z "$$DOPPLER_TOKEN" ]; then \
echo "===========> You are not logged in to Doppler and DOPPLER_TOKEN is not set"; \
echo "===========> Please run 'doppler login' or set DOPPLER_TOKEN environment variable"; \
exit 1; \
else \
echo "===========> Using DOPPLER_TOKEN for authentication"; \
fi \
else \
echo "===========> Doppler authentication verified"; \
fi

## env-doppler: Generate .env from Doppler secrets
.PHONY: env-doppler
env-doppler: check-doppler doppler-login-check
@echo "===========> Setting up Doppler for nexus project with dev config"
@doppler setup --silent --project nexus --config dev
@echo "===========> Downloading secrets to .env file"
@doppler secrets download --no-file --format env > .env
@echo "===========> .env file generated from Doppler secrets"

## check-root-env: Check if root .env exists, copy from .env.example if not
.PHONY: check-root-env
check-root-env:
@if [ ! -f "$(ROOT_DIR)/.env" ]; then \
echo "===========> Root .env file not found, creating from .env.example"; \
cp "$(ROOT_DIR)/.env.example" "$(ROOT_DIR)/.env"; \
echo "===========> Consider running 'make env-doppler' to initialize with Doppler"; \
else \
echo "===========> Root .env file exists"; \
fi

## check-admin-env: Check if admin .env exists, copy from .env.example if not
.PHONY: check-admin-env
check-admin-env:
@if [ -d "$(ADMIN_DIR)" ]; then \
if [ ! -f "$(ADMIN_DIR)/.env" ]; then \
echo "===========> Admin .env file not found, creating from .env.example"; \
if [ -f "$(ADMIN_DIR)/.env.example" ]; then \
cp "$(ADMIN_DIR)/.env.example" "$(ADMIN_DIR)/.env"; \
else \
echo "VITE_API_URL=http://localhost:8000" > "$(ADMIN_DIR)/.env"; \
echo "NODE_ENV=development" >> "$(ADMIN_DIR)/.env"; \
fi; \
else \
echo "===========> Admin .env file exists"; \
fi; \
else \
echo "===========> Admin directory not found, skipping"; \
fi

## check-frontend-env: Check if frontend .env exists, copy from .env.example if not
.PHONY: check-frontend-env
check-frontend-env:
@if [ -d "$(FRONTEND_DIR)" ]; then \
if [ ! -f "$(FRONTEND_DIR)/.env" ]; then \
echo "===========> Frontend .env file not found, creating from .env.example"; \
if [ -f "$(FRONTEND_DIR)/.env.example" ]; then \
cp "$(FRONTEND_DIR)/.env.example" "$(FRONTEND_DIR)/.env"; \
else \
echo "# Backend API base URL" > "$(FRONTEND_DIR)/.env"; \
echo "NEXT_PUBLIC_API_URL=http://localhost:8000" >> "$(FRONTEND_DIR)/.env"; \
echo "" >> "$(FRONTEND_DIR)/.env"; \
echo "# OpenAPI generated file name (relative to the frontend directory)" >> "$(FRONTEND_DIR)/.env"; \
echo "OPENAPI_OUTPUT_FILE=openapi.json" >> "$(FRONTEND_DIR)/.env"; \
echo "" >> "$(FRONTEND_DIR)/.env"; \
echo "NODE_ENV=development" >> "$(FRONTEND_DIR)/.env"; \
fi; \
else \
echo "===========> Frontend .env file exists"; \
fi; \
else \
echo "===========> Frontend directory not found, skipping"; \
fi

## check-extension-env: Check if extension .env exists, copy from .env.example if not
.PHONY: check-extension-env
check-extension-env:
@if [ -d "$(EXTENSION_DIR)" ]; then \
if [ ! -f "$(EXTENSION_DIR)/.env" ]; then \
echo "===========> Extension .env file not found, creating from .env.example"; \
if [ -f "$(EXTENSION_DIR)/.env.example" ]; then \
cp "$(EXTENSION_DIR)/.env.example" "$(EXTENSION_DIR)/.env"; \
else \
echo "# Extension环境变量" > "$(EXTENSION_DIR)/.env"; \
echo "" >> "$(EXTENSION_DIR)/.env"; \
echo "# API服务器地址" >> "$(EXTENSION_DIR)/.env"; \
echo "PLASMO_PUBLIC_API_URL=http://localhost:8000" >> "$(EXTENSION_DIR)/.env"; \
echo "" >> "$(EXTENSION_DIR)/.env"; \
echo "# 前端地址" >> "$(EXTENSION_DIR)/.env"; \
echo "PLASMO_PUBLIC_FRONTEND_URL=http://localhost:3000" >> "$(EXTENSION_DIR)/.env"; \
fi; \
else \
echo "===========> Extension .env file exists"; \
fi; \
else \
echo "===========> Extension directory not found, skipping"; \
fi

# ==============================================================================
# PRIMARY TARGETS
# ==============================================================================

## all: Run all tests, linting, formatting and build all components
.PHONY: all
all: format lint generate-client backend-build frontend-build admin-build # test
all: env-init format lint generate-client backend-build frontend-build admin-build # test
@echo "===========> All checks and builds completed successfully"

## dev: Start development environment
.PHONY: dev
dev:
dev: env-init
@echo "===========> Starting development environment"
docker-compose up -d
docker compose up -d

## lint: Run linters on all components
.PHONY: lint
Expand Down Expand Up @@ -112,7 +233,7 @@ backend-all: backend-format backend-lint backend-test

## backend: Start backend development server
.PHONY: backend
backend: check-uv backend-install
backend: check-uv backend-install env-init
@echo "===========> Starting backend development server"
@source backend/.venv/bin/activate && \
cd $(BACKEND_DIR) && fastapi dev app/main.py
Expand Down Expand Up @@ -184,7 +305,7 @@ backend-migration:
.PHONY: backend-db-shell
backend-db-shell:
@echo "===========> Connecting to database"
@docker-compose exec db psql -U postgres -d app || \
@docker compose exec db psql -U postgres -d app || \
psql "$(shell cd $(BACKEND_DIR) && python -c "from app.core.config import settings; print(settings.SQLALCHEMY_DATABASE_URI)")"

# ==============================================================================
Expand All @@ -198,7 +319,7 @@ frontend-all: frontend-format frontend-lint frontend-test

## frontend: Start frontend development server
.PHONY: frontend
frontend: check-pnpm frontend-install
frontend: check-pnpm frontend-install check-frontend-env
@echo "===========> Starting frontend development server"
@if [ -d "$(FRONTEND_DIR)" ] && [ -f "$(FRONTEND_DIR)/package.json" ]; then \
cd $(FRONTEND_DIR) && unset http_proxy https_proxy && $(PNPM) run dev; \
Expand Down Expand Up @@ -286,7 +407,7 @@ admin-all: admin-format admin-lint admin-test

## admin: Start admin development server
.PHONY: admin
admin: check-pnpm admin-install
admin: check-pnpm admin-install check-admin-env
@echo "===========> Starting admin development server"
@cd $(ADMIN_DIR) && $(PNPM) run dev

Expand Down Expand Up @@ -409,7 +530,7 @@ extension-all: extension-build extension-package extension-test

## extension: Start extension development
.PHONY: extension
extension: check-pnpm
extension: check-pnpm check-extension-env
@echo "===========> Starting browser extension in development mode"
@cd $(EXTENSION_DIR) && $(PNPM) run dev

Expand Down Expand Up @@ -492,6 +613,9 @@ help: Makefile
@printf "\033[1;34m┌─ PRIMARY COMMANDS ───────────────────────────────────────────────────┐\033[0m\n"
@grep -E '^## (all:|dev:|lint:|test:|format:|clean:)' $(MAKEFILE_LIST) | awk -F':' '{printf " \033[1;37m%-25s\033[0m %s\n", $$1, $$2}' | sed -e 's/^##//'

@printf "\n\033[1;34m┌─ ENV MANAGEMENT ────────────────────────────────────────────────────┐\033[0m\n"
@grep -E '^## (env|check-doppler|doppler)' $(MAKEFILE_LIST) | awk -F':' '{printf " \033[1;37m%-25s\033[0m %s\n", $$1, $$2}' | sed -e 's/^##//'

@printf "\n\033[1;34m┌─ BACKEND COMMANDS ──────────────────────────────────────────────────┐\033[0m\n"
@grep -E '^## backend' $(MAKEFILE_LIST) | awk -F':' '{printf " \033[1;37m%-25s\033[0m %s\n", $$1, $$2}' | sed -e 's/^##//'

Expand Down Expand Up @@ -522,6 +646,14 @@ help: Makefile
# DEVELOPMENT TOOLS
# ==============================================================================

## setup: Quick setup the whole project (recommended first command for new users)
.PHONY: setup
setup: env-init install-tools
@echo "===========> Setting up environment completed"
@echo "===========> Run 'make dev' to start all services in Docker"
@echo "===========> Or you can run individual components with 'make backend', 'make frontend', etc."
@echo "===========> Note: For better environment variables, run 'make env-doppler' if you have Doppler access"

## install-tools: Install development tools
.PHONY: install-tools
install-tools: install-python-tools install-js-tools
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# QuickForge AI
# nexus

<div align="center">

![QuickForge AI](https://images.shields.io/badge/QuickForge-AI-blue)
![nexus](https://images.shields.io/badge/QuickForge-AI-blue)
![FastAPI](https://images.shields.io/badge/FastAPI-0.104.0-green)
![TypeScript](https://images.shields.io/badge/TypeScript-5.2.2-blue)
![License](https://images.shields.io/badge/license-MIT-brightgreen)
Expand Down Expand Up @@ -283,7 +283,7 @@ This template is optimized for use with Cursor:

### AI Integration Development

QuickForge AI makes it simple to integrate various AI services:
nexus makes it simple to integrate various AI services:

- Pre-configured connectors for popular AI APIs
- Example implementations for common AI patterns
Expand Down
Loading
Loading