Prerequisites
Before you begin, ensure you have the following installed on your system:Node.js & npm
Version 14.x or higher for running the Angular frontend
Angular CLI
Version 14.2.1 for Angular development commands
.NET 6.0 SDK
Required for building and running the .NET Core API
SQL Server
LocalDB or SQL Server instance for data storage
The project uses SQL Server LocalDB by default. If you’re using a different SQL Server instance, you’ll need to update the connection string in
appsettings.json.Installation
Set Up the Database
The project uses Entity Framework Core migrations. Navigate to the API directory and apply the migrations:This will create the
LockerDb database with the necessary tables.Configure the Backend
Review and update the connection string if needed in
appsettings.json:For SQL Server instances other than LocalDB, update the server address accordingly. For example:
"server=localhost;database=LockerDb;Trusted_Connection=true"Run the Backend API
From the API directory, start the .NET Core API:The API will start on
https://localhost:7281 by default.Verify API is Running
Navigate to
https://localhost:7281/swagger to access the Swagger UI and verify all endpoints are available.Install Frontend Dependencies
Open a new terminal window and navigate to the Angular frontend directory:This will install all required Angular 14 dependencies including:
- Angular core packages (v14.0.0)
- RxJS for reactive programming
- Angular CLI build tools
Configure the Frontend
The Angular service is pre-configured to connect to the API at
https://localhost:7281.If you’re running the API on a different port, update the baseUrl in src/app/service/lockers.service.ts:Your First Locker
Now that both the backend and frontend are running, let’s create your first locker:Access the Dashboard
Open your browser and navigate to
http://localhost:4200/. You’ll see the Locker Management dashboard with a form on the left and the locker grid on the right.Create a New Locker
Fill in the form with the following information:
- Locker No: A unique identifier (e.g., “A-101”)
- Size: A numeric value (e.g., 2 for medium)
- Location: Building or area (e.g., “Building A - Floor 1”)
- Employee No: Leave empty for an available locker, or enter an employee ID (e.g., “EMP001”)
Empty lockers will appear with a green background, while occupied lockers (with an employee number) will have a blue background.
View the Locker Card
Your new locker will appear in the grid as a card showing:
- Locker number
- Location
- Employee ID (if assigned)
- Color-coded status (green = empty, blue = occupied)
Update a Locker
Click on the locker number in the grid to populate the form with its data. Modify any field and click Save to update.
API Endpoints
The system exposes the following RESTful endpoints:Business Rules
The API enforces the following business rules:Unique Constraints
- Each locker number must be unique
- Each employee can only be assigned to one locker
- Empty employee numbers are allowed (represents available lockers)
Data Model
The TypeScript model on the frontend matches the C# model on the backend:Troubleshooting
Database connection errors
Database connection errors
If you see connection errors, verify that:
- SQL Server LocalDB is installed and running
- The connection string in
appsettings.jsonis correct - You’ve run
dotnet ef database updateto create the database
CORS errors in the browser
CORS errors in the browser
The API is configured with CORS to allow all origins in development:Make sure the API is running when you start the Angular app.
API not available at localhost:7281
API not available at localhost:7281
The port is configured in
launchSettings.json. If you need to change it, update both the API configuration and the baseUrl in the Angular service.Angular build errors
Angular build errors
Ensure you have the correct versions:
- Node.js 14.x or higher
- Angular CLI 14.2.1
Next Steps
Explore the API
Dive deep into the API endpoints and integration options
Features Overview
Learn about dashboard features and locker management
Database Schema
Understand the data structure and migrations
Architecture
Learn about the system architecture
Employee Tracking
Learn how employee assignments work
Locker Management
Understand locker creation and updates
API Models
Explore the data models and schemas
This quick start guide gets you running locally. For production deployments, you’ll need to configure proper authentication, update CORS policies, and use a production-grade SQL Server instance.