Create a basic dashboard using Angular Material and SCSS that allows managing a list of users.
ng new user-dashboard
cd user-dashboard
ng add @angular/material- Navigation Bar
- Create a simple Material toolbar with:
- Application title "User Dashboard"
- Theme toggle button (light/dark mode)
- User List
- Implement a Material table showing users with the following columns:
- Name
- Role (Admin/User)
- Actions (Edit/Delete buttons)
- Add a "Add User" button above the table
- User Form
- Create a dialog form for adding/editing users with:
- Name input (required)
- Email input (required, with email validation)
- Role select (Admin/User)
- Save & Cancel buttons
interface User {
id: number;
name: string;
email: string;
role: 'Admin' | 'User';
}
// Sample data
const SAMPLE_USERS: User[] = [
{
id: 1,
name: 'John Doe',
email: '[email protected]',
role: 'Admin'
},
{
id: 2,
name: 'Jane Smith',
email: '[email protected]',
role: 'User'
}
];import { MatToolbarModule } from '@angular/material/toolbar';
import { MatTableModule } from '@angular/material/table';
import { MatButtonModule } from '@angular/material/button';
import { MatDialogModule } from '@angular/material/dialog';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { MatSelectModule } from '@angular/material/select';
import { MatIconModule } from '@angular/material/icon';- Use variables for colors and spacing
- Make the table responsive
- Style the form fields consistently
Example SCSS structure:
// styles/_variables.scss
$primary-color: #3f51b5;
$spacing: (
small: 8px,
medium: 16px,
large: 24px
);
// Component styles
.user-dashboard {
padding: map-get($spacing, medium);
&__header {
margin-bottom: map-get($spacing, large);
}
&__table {
width: 100%;
overflow-x: auto;
}
}- Basic Requirements (40 points)
- Functioning navigation bar (10 points)
- Complete user table display (15 points)
- Working add/edit form (15 points)
- Angular Material Usage (30 points)
- Proper component implementation (15 points)
- Theme implementation (15 points)
- SCSS & Styling (20 points)
- Use of variables and proper organization (10 points)
- Responsive design (10 points)
- Code Quality (10 points)
- Clean, readable code
- Proper TypeScript usage
- Component organization
- Implementing form validation messages
- Adding loading states
- Adding sorting to the table
- Adding simple animations
- Create a new GitHub repository
- Push your code
- Include a README with:
- Setup instructions
- Features implemented
- Any additional notes
- Focus on completing the basic requirements first
- Keep the code clean and well-organized
- Comment your code where necessary
- Test your application's responsiveness