This is a phonebook API that allows users to manage contact details of individuals, including their full name, mobile number, work number, email, home address, and group ID. Users can perform CRUD operations (Create, Read, Update, Delete) on the contacts and assign them to specific groups.
- Clone the repository:
git clone <repository-url>
- Navigate to the project directory:
cd phonebook-api
- Install dependencies:
npm install
## Database Setup
This project uses SQL Server as the database. Before running the application, make sure you have SQL Server installed and create a new database for the phonebook API.
- Open SQL Server Management Studio (SSMS) and connect to your SQL Server instance.
- Create a new database:
CREATE DATABASE PhonebookDB;
- Rename the
.env.example
file to.env
. - Open the
.env
file and update the database connection details with your SQL Server configuration.
- Start the server:
npm start
- Access the API at:
https://localhost:8081
GET /contacts
: Get all contactsGET /contacts/:id
: Get contact details by IDPOST /contacts
: Create a new contactPUT /contacts/:id
: Update contact detailsDELETE /contacts/:id
: Delete a contactPOST /contacts/:id/groups
: Assign a contact to a groupGET /groups/:id/contacts
: Get contacts belonging to a specific group
- Node.js
- Express.js
- SQL Server
- Lewis Muthaura
- Evans Ngugi
- Calvin Shawn
- Ian Muriuki
- Judith Muthui
Its free licence
Contributions are welcome! Feel free to open an issue or submit a pull request.