Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
dist
.env
.env.local
*.log
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:20-alpine AS build
WORKDIR /app
COPY package.json ./
RUN npm install
COPY . .
RUN npm run build

FROM node:20-alpine AS serve
RUN npm install -g serve
WORKDIR /app
COPY --from=build /app/dist ./dist
EXPOSE 5173
CMD ["serve", "-s", "dist", "-l", "5173"]
14 changes: 14 additions & 0 deletions QA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
app_type: spa
coverage_applies: false
coverage_source: null
coverage_threshold: 0
coverage_tool: none
install_steps:
- npm install
lint_tool: none
notes: Verify that the App component renders and displays the text 'Hi' as expected.
stack: TypeScript/React+Vite
test_files:
- src/App.test.tsx
test_runner: npx vitest run
workspace: /tmp/forge-repos/website-with-a-single-page-that-shows-hi-e61f5b88
61 changes: 24 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,40 @@
# Phalanx Showcase
# Hi SPA

Apps and features built entirely by Phalanx — no human wrote the code.
A minimal single-page React application that displays "Hi".

> Each directory is a standalone project generated by `/phalanx build` from a single prompt.
## Stack

---
- React 18
- TypeScript
- Vite 5
- Vitest + React Testing Library

## How it works
## Getting Started

1. Run `/phalanx build "<feature description>"` in Slack
2. Phalanx plans, builds, reviews, tests, and opens a PR against this repo
3. You approve the merge
4. The generated code lands here

---

## Projects

| Project | Prompt | Status |
|---------|--------|--------|
| `hello-world/` | `Add a GET /hello endpoint that returns Hello World!` | In progress |

---
```bash
npm install
npm run dev
```

## Running a project locally
Open http://localhost:5173 in your browser.

Each project includes its own `README.md` with setup instructions. Generally:
## Running Tests

```bash
cd <project-name>
# follow the project README
npm test
```

---
## Building for Production

## Adding this repo as a build target

In your Phalanx project config (`configs/team.yaml`), set:

```yaml
showcase_repo: https://github.com/usephalanx/showcase
```bash
npm run build
npm run preview
```

The Release agent will open PRs against this repo when a run completes.
## Docker

---

## Links
```bash
docker compose up --build
```

- Main product: [usephalanx/phalanx](https://github.com/usephalanx/phalanx)
- Website: [usephalanx.com](https://usephalanx.com)
- X: [@usephalanx](https://x.com/usephalanx)
Navigate to http://localhost:5173.
39 changes: 27 additions & 12 deletions RUNNING.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,48 @@
# Running the Todo API
# Running Instructions

## TEAM_BRIEF
stack: TypeScript/React+Vite
test_runner: npx vitest run
lint_tool: none
coverage_tool: none
coverage_threshold: 0
coverage_applies: false

## Prerequisites

- Python 3.10 or later
- Node.js >= 18
- npm >= 9

## Install dependencies
## Install Dependencies

```bash
pip install fastapi uvicorn pydantic
npm install
```

For running the test suite you will also need:
## Run Development Server

```bash
pip install httpx pytest
npm run dev
```

## Start the server
Open http://localhost:5173.

## Run Tests

```bash
uvicorn main:app --reload --host 0.0.0.0 --port 8000
npm test
```

The API will be available at <http://localhost:8000>.
## Build for Production

Interactive docs are served at <http://localhost:8000/docs>.
```bash
npm run build
```

## Run the tests
## Docker

```bash
pytest tests/
docker compose up --build
```

Navigate to http://localhost:5173.
24 changes: 5 additions & 19 deletions SETUP.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
# Setup Instructions
# Setup

## Install Dependencies
After cloning the repository, run the following commands to generate lock files and install dependencies:

```bash
pip install -r requirements.txt
npm install
```

## Install Test Dependencies
This will generate `package-lock.json` and populate `node_modules/`.

```bash
pip install pytest httpx
```

## Run Tests

```bash
pytest tests/ -v
```

## Run the Application

```bash
uvicorn main:app --reload
```
Do NOT commit `package-lock.json`, `node_modules/`, or `dist/` — they are in `.gitignore`.
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: "3.8"
services:
app:
build: .
ports:
- "5173:5173"
12 changes: 12 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Hi SPA</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
27 changes: 27 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "hi-spa",
"private": true,
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"test": "vitest run"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^6.1.4",
"@testing-library/react": "^14.1.2",
"@types/react": "^18.2.43",
"@types/react-dom": "^18.2.17",
"@vitejs/plugin-react": "^4.2.1",
"jsdom": "^23.0.1",
"typescript": "^5.3.3",
"vite": "^5.0.8",
"vitest": "^1.1.0"
}
}
10 changes: 10 additions & 0 deletions src/App.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { render, screen } from '@testing-library/react';
import { describe, it, expect } from 'vitest';
import App from './App';

describe('App', () => {
it('renders Hi text', () => {
render(<App />);
expect(screen.getByText('Hi')).toBeDefined();
});
});
10 changes: 10 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* Main application component.
*
* Renders a simple page displaying the text "Hi".
*/
function App(): JSX.Element {
return <div>Hi</div>;
}

export default App;
9 changes: 9 additions & 0 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';

ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
</React.StrictMode>,
);
1 change: 1 addition & 0 deletions src/setupTests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '@testing-library/jest-dom';
1 change: 1 addition & 0 deletions src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
20 changes: 20 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"]
}
11 changes: 11 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

export default defineConfig({
plugins: [react()],
test: {
globals: true,
environment: 'jsdom',
setupFiles: [],
},
} as import('vitest/config').UserConfig);