|
| 1 | +# Street Support Platform Web |
1 | 2 |
|
2 | | -# Street Support Network – Website Rebuild |
3 | | - |
| 3 | +This is the public-facing platform for the Street Support Network. It helps people find local services, share information, and collaborate across the homelessness sector. |
4 | 4 |
|
5 | | -This is the future-proof rebuild of the Street Support Network website. |
| 5 | +## 🚀 Tech Stack |
6 | 6 |
|
7 | | -It provides a modular, maintainable platform to help people experiencing or at risk of homelessness find the support they need. The platform is being rebuilt from the ground up using modern technologies, with a focus on accessibility, sustainability, and long-term maintainability. |
8 | | - |
9 | | ---- |
10 | | - |
11 | | -## 🔧 Core Principles |
12 | | - |
13 | | -This project is built with the following principles in mind: |
14 | | - |
15 | | -- ✅ **Test-Driven Development (TDD)** |
16 | | - Write unit, integration, and end-to-end tests from the beginning. CI pipelines enforce test passing before deployment. |
17 | | - |
18 | | -- ✅ **Mobile-First and Fully Responsive** |
19 | | - Tailwind CSS is used with a mobile-first approach. Layouts scale cleanly with `sm:`, `md:`, `lg:` breakpoints. |
20 | | - |
21 | | -- ✅ **Built for the Future** |
22 | | - Uses modern frameworks and tools, avoids deprecated libraries, and prioritises code readability and modularity. |
23 | | - |
24 | | -- ✅ **Accessible and Inclusive** |
25 | | - Meets WCAG 2.1 AA. All pages use semantic HTML, keyboard navigation, appropriate contrast, and alt text. |
26 | | - |
27 | | -- ✅ **Data-Driven and Impact-Measurable** |
28 | | - Designed to surface insights on usage, service access, and verification timelines through GA4 and event tagging. |
29 | | - |
30 | | ---- |
31 | | - |
32 | | -## 🗂️ Branch Strategy |
33 | | - |
34 | | -- `main` – Production-ready, deployable code only |
35 | | -- `staging` – Active development branch. All new features and fixes should branch from here and merge back into staging. |
36 | | - |
37 | | ---- |
38 | | - |
39 | | -## 🚀 Getting Started Locally |
| 7 | +- Next.js 15 |
| 8 | +- React 18 |
| 9 | +- TypeScript |
| 10 | +- Tailwind CSS 4 |
| 11 | +- Jest + React Testing Library |
| 12 | +- JSON-based mock data (used for local development until full CMS/API integration) |
| 13 | +- GitHub Actions (CI) |
| 14 | +- PowerShell scripts (for development on Windows) |
40 | 15 |
|
41 | | -### 1. Fork This Repository |
42 | | -Use the **Fork** button on GitHub. |
| 16 | +## 🧪 Testing |
43 | 17 |
|
44 | | -### 2. Clone Your Fork |
45 | | -```bash |
46 | | -git clone https://github.com/<your-username>/streetsupport-platform-web.git |
47 | | -cd streetsupport-platform-web |
48 | | -``` |
| 18 | +This project uses **Jest** and **React Testing Library** for unit and integration tests. |
49 | 19 |
|
50 | | -### 3. Set Up Upstream Remote |
51 | | -```bash |
52 | | -git remote add upstream https://github.com/streetsupport/streetsupport-platform-web.git |
53 | | -``` |
| 20 | +### Running Tests |
54 | 21 |
|
55 | | -### 4. Install Dependencies |
56 | 22 | ```bash |
57 | | -npm install |
| 23 | +npm run test |
58 | 24 | ``` |
59 | 25 |
|
60 | | -### 5. Run the Development Server |
61 | | -```bash |
62 | | -npm run dev |
63 | | -``` |
| 26 | +### Test Setup Highlights |
64 | 27 |
|
65 | | -Visit: |
66 | | -``` |
67 | | -http://localhost:3000 |
68 | | -``` |
| 28 | +- Babel is configured via `babel.config.json` (not `.js` due to Jest limitations). |
| 29 | +- Module path aliases (e.g. `@/components/...`) are resolved using `moduleNameMapper` in `jest.config.cjs`. |
| 30 | +- Geolocation and other browser APIs are stubbed or guarded for compatibility. |
| 31 | +- The `__mocks__` directory includes mocks for modules like `leaflet` and `react-leaflet`. |
69 | 32 |
|
70 | | ---- |
| 33 | +All tests must pass before merging any pull request into `staging` or `main`. |
71 | 34 |
|
72 | | -## 🔄 Keeping Your Fork Up to Date |
| 35 | +## 🧱 Admin CMS |
73 | 36 |
|
74 | | -```bash |
75 | | -git fetch upstream |
76 | | -git checkout staging |
77 | | -git merge upstream/staging |
78 | | -git push origin staging |
79 | | -``` |
| 37 | +The admin CMS is developed in a separate repository: |
| 38 | +[streetsupport-platform-admin](https://github.com/streetsupport/streetsupport-platform-admin) |
80 | 39 |
|
81 | | ---- |
| 40 | +This manages all partner organisation data and connects to the public platform via API. |
82 | 41 |
|
83 | | -## ✅ Deployment |
| 42 | +## 📂 Local Development |
84 | 43 |
|
85 | | -Deployment is automated via CI/CD: |
| 44 | +Mock service data is stored in `data/service-providers.json` and is used by the Find Help search feature. |
86 | 45 |
|
87 | | -- `main` → Production |
88 | | -- `staging` → Staging environment |
89 | | -- Preview deployments are created for every PR |
| 46 | +To run the project locally: |
90 | 47 |
|
91 | | ---- |
92 | | - |
93 | | -## ⚙️ Contribution Workflow |
94 | | - |
95 | | -1. **Branch from `staging`** |
96 | | -```bash |
97 | | -git checkout -b feature/your-feature-name |
98 | | -``` |
99 | | - |
100 | | -2. **Commit Clearly** |
101 | 48 | ```bash |
102 | | -git commit -m "feat: add filter panel" |
103 | | -``` |
104 | | - |
105 | | -3. **Push and Open PR** |
106 | | -Target: `streetsupport/streetsupport-platform-web → staging` |
107 | | - |
108 | | -4. **Review and Merge** |
109 | | -Reviewed PRs are merged into staging before release to main. |
110 | | - |
111 | | ---- |
112 | | - |
113 | | -## 🛠 Tech Stack |
114 | | - |
115 | | -- [Next.js](https://nextjs.org/) (App Router, v15+) |
116 | | -- TypeScript |
117 | | -- Tailwind CSS |
118 | | -- Node.js |
119 | | -- Azure Static Web Apps (planned) |
120 | | -- Google Maps API |
121 | | -- GA4 |
122 | | -- WatsonX Virtual Assistant |
123 | | -- JSON-based mock data (temporary until CMS integration) |
124 | | - |
125 | | ---- |
126 | | - |
127 | | -## 📁 Project Structure |
128 | | - |
129 | | -``` |
130 | | -/src |
131 | | - /app |
132 | | - /api ← Route handlers for mock data (get-services, get-categories) |
133 | | - /[pages] ← Next.js pages and layouts |
134 | | - /components ← UI and layout components (modular) |
135 | | - /data ← Mock data in JSON format |
136 | | - /styles ← Tailwind and legacy SCSS files (migrating gradually) |
137 | | -
|
138 | | -tailwind.config.js ← Design tokens and theme overrides |
139 | | -postcss.config.js ← Tailwind + PostCSS setup |
| 49 | +npm install |
| 50 | +npm run dev |
140 | 51 | ``` |
141 | 52 |
|
142 | | ---- |
143 | | - |
144 | | -## 📊 Data Model (Temporary) |
| 53 | +## 🧭 Project Structure |
145 | 54 |
|
146 | | -Data is currently stored as JSON in `/src/data/`: |
| 55 | +- `src/components/` – UI components |
| 56 | +- `src/contexts/` – React context providers (e.g. `LocationContext`) |
| 57 | +- `src/data/` – local JSON data sources for mock services and locations |
| 58 | +- `src/pages/` – Next.js pages and routing |
| 59 | +- `__mocks__/` – mocks for external libraries used in test environment |
147 | 60 |
|
148 | | -- `locations.json` |
149 | | -- `client-groups.json` |
150 | | -- `service-categories.json` |
151 | | -- `service-providers.json` |
| 61 | +## 🔄 Git Workflow |
152 | 62 |
|
153 | | -Each service provider includes: |
154 | | -- A nested list of services |
155 | | -- A linked category and subcategory |
156 | | -- Postcode, opening hours, and client group support |
157 | | -- Geolocation (latitude, longitude) for map use |
| 63 | +See the project instructions for the full GitHub workflow. In short: |
158 | 64 |
|
159 | | -Eventually, this will be replaced by dynamic data from the Street Support Network API or CMS. |
| 65 | +- Create a new feature branch from `staging` |
| 66 | +- Work on that branch |
| 67 | +- Create a PR into `streetsupport/streetsupport-platform-web` `staging` |
| 68 | +- Merge once tests pass |
| 69 | +- Then open a PR from `staging` to `main` |
| 70 | +- Finally, sync your fork’s `staging` with upstream |
160 | 71 |
|
161 | 72 | --- |
162 | 73 |
|
163 | | -## 👥 User Roles (Future CMS) |
164 | | - |
165 | | -- **Super Administrator**: Full access |
166 | | -- **Location Administrator**: Manage content in assigned area(s) |
167 | | -- **Organisation Administrator**: Manage their organisation’s data |
168 | | -- **SWEP Administrator**: Control SWEP info and banner visibility |
169 | | -- **Volunteer Administrator**: Read-only access for data comparison |
170 | | - |
171 | | ---- |
172 | | - |
173 | | -## 📄 License |
174 | | - |
175 | | -MIT |
176 | | - |
177 | | ---- |
178 | | - |
179 | | -## 🧑💻 Maintainers |
180 | | - |
181 | | -- [James Cross](https://github.com/James-Cross) |
| 74 | +For full developer instructions and context, see the `rebuild-docs.docx` or ask for clarification before making assumptions. |
0 commit comments