This is a simple Phonebook System that allows an admin to manage contacts stored in a PostgreSQL database. The system consists of two separate projects:
- API Project: Developed using .NET Core, applying the Onion Architecture.
- Web Project: Built with Angular 16, featuring a minimal yet functional UI.
- Add Contact: Admin can add new contacts.
- Remove Contact: Admin can delete existing contacts.
- Edit Contact: Admin can update contact details.
- Search Contact: Search by any part of the name, phone number, or email.
- List Contacts: Display all saved contacts from the database.
- .NET Core
- Entity Framework Core
- PostgreSQL
- Onion Architecture
- Angular 16
- Bootstrap (for styling)
- Angular Services for API communication
Method | Endpoint | Description |
---|---|---|
GET |
/api/contacts |
Get all contacts |
POST |
/api/contacts |
Add a new contact |
PUT |
/api/contacts/{id} |
Update a contact by ID |
DELETE |
/api/contacts/{id} |
Remove a contact by ID |
GET |
/api/contacts/search?query={value} |
Search contacts by name, phone, or email |
- Clone the repository.
- Navigate to the API project directory.
- Install dependencies:
dotnet restore
- Configure the PostgreSQL connection string in
appsettings.json
. - Apply database migrations:
dotnet ef database update
- Run the API:
dotnet run
- Navigate to the Web project directory.
- Install dependencies:
npm install
- Run the Angular application:
ng serve
- Open the browser and navigate to
http://localhost:4200
.
- Ensure PostgreSQL is running and accessible.
- Modify API base URL in the Angular project (
environment.ts
) if needed.