Skip to content

SoftUni/ContactBook

Repository files navigation

ContactBook C# App + RESTful API

Summary: ContactBook allows users to manage their own contact book! Create, edit, and delete contacts into your contact book. Fill in names, email, phone number and info and build your very own contact list!

  • Target platform: .NET 6
  • Seeded database with one user and three contacts
  • Default user credentials: [email protected] / guest

ContactBook Web App

The ASP.NET Core app "ContactBook" is an app for creating contacts.

  • Technologies: C#, ASP.NET Core, Entity Framework Core, ASP.NET Core Identity, NUnit
  • The app supports the following operations:
    • Home page (view contacts count + menu): /
    • View contacts: /Contacts/All
    • Create a new contact (name + email + phone number + comments): /Contacts/Create
    • Edit contact: /Contacts/Edit/:id
    • Delete contact: /Contacts/Delete/:id

ContactBook RESTful API

The following endpoints are supported:

  • GET /api - list all API endpoints
  • GET /api/contacts - list all contacts
  • GET /api/contacts/count - returns contacts count
  • GET /api/contacts/:id - returns a contact by given id
  • GET /api/contacts/search/:keyword - returns contacts by given keyword
  • POST /api/contacts/create - create a new (send a JSON object in the request body, e.g. `{ "first name": "Johnny", "last name": "Depp", "email": "[email protected]", "phone number": "+12298015369", "comments": "An American actor, producer, and musician. Best in 'Pirates of the Caribbean'" })
  • PUT /api/contacts/:id - edit contact by id (send a JSON object in the request body, holding all fields, e.g. { "first name": "Johnny", "last name": "Depp", "email": "[email protected]", "phone number": "+12298015369", "comments": "An American actor, producer, and musician. Best in 'Pirates of the Caribbean'" })
  • PATCH /api/contacts/:id - partially edit contact by id (send a JSON object in the request body, holding the fields to modify, e.g. { "email": "[email protected]", "phone number": "+12298015369" })
  • DELETE /api/contacts/:id - delete contact by id
  • GET /api/users - list all users
  • POST /api/users/login - logs in an existing user (send a JSON object in the request body, holding all fields, e.g. {"email": "[email protected]", "password": "guest"})
  • POST /api/users/register - registers a new user (send a JSON object in the request body, holding all fields, e.g. { "email": "[email protected]", "firstName": "someName", "lastName": "someLastName", "phoneNumber": "+192088877744", "password": "somePassword", "confirmPassword": "somePassword" })

Screenshots

home-page register-page login-page home-page-logged-in all-contacts create-contact edit-contact search-contacts