Skip to content

Commit fe4bd63

Browse files
committed
feat(website): scaffold Next.js static site with / and /developers; CI builds Next and MkDocs to /docs and deploys to main
1 parent c240f38 commit fe4bd63

File tree

9 files changed

+233
-0
lines changed

9 files changed

+233
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Build and Deploy Website + Docs
2+
3+
on:
4+
push:
5+
branches: [ source ]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build-deploy:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout website (source branch)
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '20'
22+
23+
- name: Install and build Next.js static site
24+
run: |
25+
npm ci || npm install
26+
npm run build:static
27+
28+
- name: Checkout docs-site repo
29+
uses: actions/checkout@v4
30+
with:
31+
repository: BharatAddress/docs-site
32+
path: docs-site
33+
34+
- name: Setup Python for MkDocs
35+
uses: actions/setup-python@v5
36+
with:
37+
python-version: '3.11'
38+
39+
- name: Build MkDocs
40+
working-directory: docs-site
41+
run: |
42+
python -m pip install -U pip
43+
pip install -r requirements.txt
44+
mkdocs build --strict
45+
46+
- name: Stage docs under /docs
47+
run: |
48+
rm -rf out/docs
49+
mkdir -p out/docs
50+
cp -r docs-site/site/* out/docs/
51+
52+
- name: Deploy to main (Pages)
53+
uses: peaceiris/actions-gh-pages@v3
54+
with:
55+
github_token: ${{ secrets.GITHUB_TOKEN }}
56+
publish_branch: main
57+
publish_dir: ./out
58+
force_orphan: false
59+
keep_files: false
60+

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules/
2+
.next/
3+
out/
4+
dist/
5+
*.log
6+
*.cache
7+

app/developers/page.tsx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
export default function DevelopersPage() {
2+
return (
3+
<section>
4+
<h1>Developers</h1>
5+
<p>Get started building with Bharat Address.</p>
6+
7+
<h2>Repositories</h2>
8+
<ul>
9+
<li><a href="https://github.com/BharatAddress/api-server">api-server</a></li>
10+
<li><a href="https://github.com/BharatAddress/specs">specs</a></li>
11+
<li><a href="https://github.com/BharatAddress/clients">clients</a></li>
12+
<li><a href="https://github.com/BharatAddress/tools-validator">tools-validator</a></li>
13+
<li><a href="https://github.com/BharatAddress/tools-converters">tools-converters</a></li>
14+
<li><a href="https://github.com/BharatAddress/docs-site">docs-site</a></li>
15+
</ul>
16+
17+
<h2>Contributing</h2>
18+
<p>
19+
Read the <a href="https://github.com/BharatAddress/specs/blob/main/CONTRIBUTING.md">contributing guide</a> and our
20+
<a href="https://github.com/BharatAddress/specs/blob/main/CODE_OF_CONDUCT.md"> Code of Conduct</a>.
21+
</p>
22+
<p>
23+
Join by opening issues, discussions, or pull requests across the repos. We welcome contributions from municipalities,
24+
civic-tech groups, and developers.
25+
</p>
26+
27+
<h2>API Quickstart</h2>
28+
<pre>
29+
uvicorn main:app --reload
30+
# Then visit /collections/addresses/items
31+
</pre>
32+
33+
<h2>Docs</h2>
34+
<p>
35+
Full documentation is available at <a href="/docs/">/docs</a>.
36+
</p>
37+
</section>
38+
);
39+
}
40+

app/layout.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
export const metadata = {
2+
title: 'Bharat Address',
3+
description: 'Open-source specs, API, clients, and tools for Bharat Address',
4+
};
5+
6+
export default function RootLayout({ children }: { children: React.ReactNode }) {
7+
return (
8+
<html lang="en">
9+
<body style={{ fontFamily: 'system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Helvetica, Arial, sans-serif', margin: 0 }}>
10+
<header style={{ padding: '16px 24px', borderBottom: '1px solid #eee' }}>
11+
<a href="/" style={{ fontWeight: 700, fontSize: 18, color: '#111', textDecoration: 'none' }}>Bharat Address</a>
12+
<nav style={{ float: 'right' }}>
13+
<a href="/docs/" style={{ marginRight: 16 }}>Docs</a>
14+
<a href="/developers/" style={{ marginRight: 16 }}>Developers</a>
15+
<a href="https://github.com/BharatAddress" target="_blank" rel="noreferrer">GitHub</a>
16+
</nav>
17+
</header>
18+
<main style={{ maxWidth: 960, margin: '0 auto', padding: '40px 24px' }}>{children}</main>
19+
<footer style={{ borderTop: '1px solid #eee', padding: '16px 24px', textAlign: 'center', color: '#666' }}>
20+
© {new Date().getFullYear()} Bharat Address
21+
</footer>
22+
</body>
23+
</html>
24+
);
25+
}
26+

app/page.tsx

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
export default function HomePage() {
2+
return (
3+
<section>
4+
<h1 style={{ fontSize: 36, marginBottom: 12 }}>Bharat Address</h1>
5+
<p style={{ fontSize: 18, color: '#444', maxWidth: 740 }}>
6+
Open-source specifications, APIs, validator tools, and reference clients for a unified address ecosystem.
7+
</p>
8+
<div style={{ marginTop: 24 }}>
9+
<a href="/docs/" style={btn}>Read the Docs</a>
10+
<a href="/developers/" style={{ ...btn, marginLeft: 12, background: '#fff', color: '#0366d6', border: '1px solid #0366d6' }}>Developers</a>
11+
</div>
12+
<div style={{ marginTop: 40 }}>
13+
<h2>Key Projects</h2>
14+
<ul>
15+
<li><a href="https://github.com/BharatAddress/api-server">API Server</a> — FastAPI reference OGC API Features read API</li>
16+
<li><a href="https://github.com/BharatAddress/specs">Specs</a> — JSON Schema, OpenAPI, normative docs</li>
17+
<li><a href="https://github.com/BharatAddress/clients">Clients</a> — TypeScript and Python client SDKs</li>
18+
<li><a href="https://github.com/BharatAddress/tools-validator">Validator</a> — JSON Schema validator CLI</li>
19+
<li><a href="https://github.com/BharatAddress/tools-converters">Converters</a> — Import/convert utilities</li>
20+
</ul>
21+
</div>
22+
</section>
23+
);
24+
}
25+
26+
const btn: React.CSSProperties = {
27+
display: 'inline-block',
28+
background: '#0366d6',
29+
color: '#fff',
30+
padding: '10px 14px',
31+
borderRadius: 6,
32+
textDecoration: 'none',
33+
};
34+

next-env.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
/// <reference types="next/navigation-types/compat/navigation" />
4+
5+
// NOTE: This file should not be edited
6+
// see https://nextjs.org/docs/basic-features/typescript for more information.
7+

next.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/** @type {import('next').NextConfig} */
2+
const nextConfig = {
3+
output: 'export',
4+
images: { unoptimized: true },
5+
trailingSlash: true
6+
};
7+
8+
module.exports = nextConfig;
9+

package.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "bharataddress-website",
3+
"private": true,
4+
"version": "0.1.0",
5+
"scripts": {
6+
"dev": "next dev",
7+
"build": "next build",
8+
"export": "next export",
9+
"start": "next start",
10+
"build:static": "next build && next export"
11+
},
12+
"dependencies": {
13+
"next": "^15.0.0",
14+
"react": "^18.3.1",
15+
"react-dom": "^18.3.1"
16+
},
17+
"devDependencies": {
18+
"typescript": "^5.5.4",
19+
"@types/node": "^20.14.11",
20+
"@types/react": "^18.3.3",
21+
"@types/react-dom": "^18.3.0"
22+
}
23+
}
24+

tsconfig.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES2020",
4+
"lib": ["dom", "dom.iterable", "es2020"],
5+
"allowJs": false,
6+
"skipLibCheck": true,
7+
"strict": true,
8+
"noEmit": true,
9+
"esModuleInterop": true,
10+
"module": "esnext",
11+
"moduleResolution": "bundler",
12+
"resolveJsonModule": true,
13+
"isolatedModules": true,
14+
"jsx": "preserve",
15+
"incremental": true,
16+
"plugins": [{ "name": "next" }]
17+
},
18+
"include": [
19+
"next-env.d.ts",
20+
"**/*.ts",
21+
"**/*.tsx",
22+
".next/types/**/*.ts"
23+
],
24+
"exclude": ["node_modules"]
25+
}
26+

0 commit comments

Comments
 (0)