Initial React/TypeScript frontend setup
This commit is contained in:
commit
aab2c02c2e
7 changed files with 110 additions and 0 deletions
3
.env.example
Normal file
3
.env.example
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
VITE_API_BASE_URL=http://localhost:8080
|
||||||
|
VITE_AUTH_ISSUER=https://auth.nexus.local
|
||||||
|
VITE_SENTRY_DSN=
|
||||||
7
.gitignore
vendored
Normal file
7
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
node_modules/
|
||||||
|
dist/
|
||||||
|
.env.local
|
||||||
|
.env.*.local
|
||||||
|
*.log
|
||||||
|
.DS_Store
|
||||||
|
coverage/
|
||||||
27
README.md
Normal file
27
README.md
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
# nexus/frontend
|
||||||
|
|
||||||
|
Nexus web frontend. Built with React + TypeScript + Vite.
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
npm install
|
||||||
|
npm run dev # dev server on http://localhost:5173
|
||||||
|
npm run build # production build to dist/
|
||||||
|
npm run test # unit tests (vitest)
|
||||||
|
npm run lint # eslint + tsc
|
||||||
|
|
||||||
|
## Structure
|
||||||
|
|
||||||
|
```
|
||||||
|
src/
|
||||||
|
components/ — reusable UI components
|
||||||
|
pages/ — route-level page components
|
||||||
|
hooks/ — custom React hooks
|
||||||
|
api/ — API client and types
|
||||||
|
styles/ — global styles and design tokens
|
||||||
|
utils/ — pure utility functions
|
||||||
|
```
|
||||||
|
|
||||||
|
## Environment variables
|
||||||
|
|
||||||
|
Copy `.env.example` to `.env.local` for local development.
|
||||||
28
package.json
Normal file
28
package.json
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
{
|
||||||
|
"name": "nexus-frontend",
|
||||||
|
"version": "1.4.0",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "vite",
|
||||||
|
"build": "tsc && vite build",
|
||||||
|
"preview": "vite preview",
|
||||||
|
"test": "vitest",
|
||||||
|
"lint": "eslint src --ext .ts,.tsx && tsc --noEmit"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"react": "^18.3.0",
|
||||||
|
"react-dom": "^18.3.0",
|
||||||
|
"react-router-dom": "^6.22.0",
|
||||||
|
"@tanstack/react-query": "^5.28.0",
|
||||||
|
"axios": "^1.6.8"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/react": "^18.3.0",
|
||||||
|
"@types/react-dom": "^18.3.0",
|
||||||
|
"@vitejs/plugin-react": "^4.2.1",
|
||||||
|
"typescript": "^5.4.3",
|
||||||
|
"vite": "^5.2.6",
|
||||||
|
"vitest": "^1.4.0",
|
||||||
|
"eslint": "^8.57.0",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^7.4.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
21
src/styles/tokens.css
Normal file
21
src/styles/tokens.css
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
:root {
|
||||||
|
--color-primary: #0055cc;
|
||||||
|
--color-primary-hover: #003d99;
|
||||||
|
--color-surface: #f8f9fa;
|
||||||
|
--color-surface-raised: #ffffff;
|
||||||
|
--color-border: #dee2e6;
|
||||||
|
--color-text: #212529;
|
||||||
|
--color-text-muted: #6c757d;
|
||||||
|
--color-error: #dc3545;
|
||||||
|
--color-success: #198754;
|
||||||
|
|
||||||
|
--font-sans: 'Inter', system-ui, sans-serif;
|
||||||
|
--font-mono: 'JetBrains Mono', 'Fira Code', monospace;
|
||||||
|
|
||||||
|
--radius-sm: 4px;
|
||||||
|
--radius-md: 8px;
|
||||||
|
--radius-lg: 16px;
|
||||||
|
|
||||||
|
--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
|
||||||
|
--shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
|
||||||
|
}
|
||||||
13
tsconfig.json
Normal file
13
tsconfig.json
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ES2020",
|
||||||
|
"lib": ["ES2020", "DOM"],
|
||||||
|
"module": "ESNext",
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
"jsx": "react-jsx",
|
||||||
|
"strict": true,
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"noUnusedParameters": true
|
||||||
|
},
|
||||||
|
"include": ["src"]
|
||||||
|
}
|
||||||
11
vite.config.ts
Normal file
11
vite.config.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
import { defineConfig } from 'vite';
|
||||||
|
import react from '@vitejs/plugin-react';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [react()],
|
||||||
|
server: {
|
||||||
|
proxy: {
|
||||||
|
'/api': 'http://localhost:8080',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
Loading…
Reference in a new issue