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
61 changes: 0 additions & 61 deletions website/.angular-cli.json

This file was deleted.

18 changes: 18 additions & 0 deletions website/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
};
78 changes: 59 additions & 19 deletions website/README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,71 @@
**Important**: Please use a node 6.x version, preferably. There may be breaking changes if you use node 7+. We recommned using nvm to switch versions.
# Contacts App (React + TypeScript)

[![CircleCI Status](https://circleci.com/gh/testing-angular-applications/testing-angular-applications.svg?style=shield)](https://circleci.com/gh/testing-angular-applications/testing-angular-applications)
A contacts management application migrated from Angular to React with TypeScript.

# Contacts App Starter
## Tech Stack

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.5.0.
- **React 18** with TypeScript
- **Vite** for build tooling
- **React Router v6** for routing
- **MUI (Material UI) v5** for UI components
- **Vitest** + **React Testing Library** for testing

## Development server
## Getting Started

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
```bash
cd website
npm install
npm run dev
```

## Code scaffolding
The app runs at `http://localhost:5173`.

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
## Scripts

## Build
| Command | Description |
| --- | --- |
| `npm run dev` | Start development server |
| `npm run build` | Type-check and production build |
| `npm run preview` | Preview production build |
| `npm run lint` | Lint with ESLint |
| `npm run typecheck` | Run TypeScript type checking |
| `npm test` | Run tests with Vitest |
| `npm run test:watch` | Run tests in watch mode |

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
## Project Structure

## Running unit tests
```
src/
├── __tests__/ # Test files
├── components/ # React components
│ ├── ContactList.tsx
│ ├── ContactDetail.tsx
│ ├── ContactEdit.tsx
│ ├── ContactFeedDialog.tsx
│ ├── FavoriteIcon.tsx
│ ├── NewContact.tsx
│ └── PageNotFound.tsx
├── models/ # TypeScript interfaces
│ └── contact.ts
├── services/ # Data services
│ ├── contact.service.ts
│ ├── contact-feed.service.ts
│ └── mock-contacts.ts
├── utils/ # Utility functions
│ ├── phone-number.ts
│ └── validation.ts
├── App.tsx # Root component with routing
├── main.tsx # Entry point
└── index.css # Global styles
```

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Routes

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
| Path | Component | Description |
| --- | --- | --- |
| `/` | ContactList | Home / contact list |
| `/contacts` | ContactList | Contact list |
| `/contact/:id` | ContactDetail | View contact details |
| `/edit/:id` | ContactEdit | Edit a contact |
| `/add` | NewContact | Add a new contact |
| `*` | PageNotFound | 404 page |
6 changes: 0 additions & 6 deletions website/database.rules.json

This file was deleted.

11 changes: 0 additions & 11 deletions website/e2e/app.po.ts

This file was deleted.

14 changes: 0 additions & 14 deletions website/e2e/tsconfig.e2e.json

This file was deleted.

14 changes: 0 additions & 14 deletions website/firebase.json

This file was deleted.

15 changes: 15 additions & 0 deletions website/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Contacts App</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" />
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
28 changes: 0 additions & 28 deletions website/karma-ci.conf.js

This file was deleted.

33 changes: 0 additions & 33 deletions website/karma.conf.js

This file was deleted.

Loading