Skip to content

Commit

Permalink
Merge pull request #294 from jeafreezy/fair-models
Browse files Browse the repository at this point in the history
Fair models
  • Loading branch information
omranlm authored Oct 21, 2024
2 parents cf5f679 + d877f93 commit 7fe9277
Show file tree
Hide file tree
Showing 182 changed files with 8,586 additions and 1,543 deletions.
2 changes: 1 addition & 1 deletion frontend/.vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
"mariusalchimavicius.json-to-ts",
"bradlc.vscode-tailwindcss"
]
}
}
8 changes: 4 additions & 4 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# fAIr Frontend

This project is a frontend web application built using **React 18**, **TypeScript**, and **Vite**. The app leverages modern libraries such as **@hotosm/ui**, **Shoelace**, and **Framer Motion** for UI components, and **React Router** for client-side routing.
This project is a frontend web application built using **React 18**, **TypeScript**, and **Vite**. The app leverages modern libraries such as **@hotosm/ui**, and **Shoelace** for UI components, and **React Router** for client-side routing.

## Table of Contents

Expand Down Expand Up @@ -60,6 +60,7 @@ Here's an overview of the folder structure:
│ ├── app/ # Contains the application routes and providers.
│ ├── assets/ # Static assets specific to the app (images, icons, etc.).
│ ├── components/ # Reusable components and layouts.
| |── features/ # Contains the main features of the application.
│ ├── hook/ # Reusable hooks.
│ ├── styles/ # Global styles.
│ ├── utils/ # Utility functions, application content and constants.
Expand Down Expand Up @@ -96,10 +97,9 @@ We use absolute imports (such as `@/components`, `@/hooks`, etc.), to make it ea

We use the `kebab-case` to name all files. This helps to keep your codebase consistent and easier to navigate.

#### Husky

We use the `husky` to trigger `eslint` and `prettier` configurations when committing code to the repository.
#### Architectural Decisions

See [the documentation](./docs/) for more information on the architectural decisions.

## Contributing

Expand Down
3 changes: 3 additions & 0 deletions frontend/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ In the `architecture` folder there are subfolders for each decision making. In e
2. [Styling Library Decision](./architecture/adr-choose-styling-library/adr1.md)
3. [Web mapping Library Decision](./architecture/adr-choose-webmap-library/adr1.md)
4. [Drawing Library Decision](./architecture/adr-choose-drawing-library/adr1.md)
5. [Package Manager Decision](./architecture/adr-choose-package-manager/adr1.md)
6. [Programming Language Decision](./architecture/adr-choose-language/adr1.md)
7. [Bundler Decision](./architecture/adr-choose-bundler/adr1.md)

## References

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ We are building the fAIr website that requires a responsive and customizable use
# Decision

We've chosen to use Shoelace because it meets all our key decision criteria and aligns with the future requirements of [HOT UI](https://github.com/hotosm/ui). This alignment ensures long-term compatibility and simplifies any potential migration to a different framework in the future, if needed.

# Status

Accepted.
Expand Down
28 changes: 0 additions & 28 deletions frontend/docs/index.md

This file was deleted.

8 changes: 7 additions & 1 deletion frontend/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import tseslint from "typescript-eslint";
export default tseslint.config(
{ ignores: ["dist"] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
extends: [
js.configs.recommended,
...tseslint.configs.recommended,
"plugin:@tanstack/eslint-plugin-query/recommended",
"plugin:tailwindcss/recommended",
],
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
Expand All @@ -16,6 +21,7 @@ export default tseslint.config(
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
"@tanstack/query": "@tanstack/query",
},
rules: {
...reactHooks.configs.recommended.rules,
Expand Down
48 changes: 26 additions & 22 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Favicon -->
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
<link rel="manifest" href="/site.webmanifest" />
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Favicon -->
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
<link rel="manifest" href="/site.webmanifest" />
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />
<!-- HOT OSM UI -->
<link
rel="stylesheet"
href="https://s3.amazonaws.com/hotosm-ui/latest/dist/style.css"
/>
<script
type="module"
src="https://s3.amazonaws.com/hotosm-ui/latest/dist/hotosm-ui.js"
></script>

<!-- HOT OSM UI -->
<link rel="stylesheet" href="https://s3.amazonaws.com/hotosm-ui/latest/dist/style.css" />
<script type="module" src="https://s3.amazonaws.com/hotosm-ui/latest/dist/hotosm-ui.js"></script>
<title>HOT fAIr</title>
</head>

<title>HOT fAIr</title>
</head>

<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>

</html>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
7 changes: 6 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@
},
"dependencies": {
"@shoelace-style/shoelace": "^2.16.0",
"@tanstack/react-query": "^5.59.0",
"@tanstack/react-query-devtools": "^5.59.0",
"@tanstack/react-table": "^8.20.5",
"axios": "^1.7.7",
"clsx": "^2.1.1",
"framer-motion": "^11.5.4",
"maplibre-gl": "^4.7.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-error-boundary": "^4.0.13",
Expand All @@ -23,6 +27,7 @@
},
"devDependencies": {
"@eslint/js": "^9.9.0",
"@tanstack/eslint-plugin-query": "^5.58.1",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
Expand All @@ -41,4 +46,4 @@
"vite": "^5.4.1",
"vite-tsconfig-paths": "^5.0.1"
}
}
}
Loading

0 comments on commit 7fe9277

Please sign in to comment.