Basic app that allows us to store contacts data. It's made up of a web client and a REST API made with Express on which we can execute CRUD operations. Data is stored in a JSON file,nevertheless a MongoDB model is already implemented.
You can consume the API using the web client, any REST client like Postman or curl using the endpoints described below. You can also use the requests in req.http
# Start the server
cd server
npm install
npm run dev
cd..
# Start the client
cd client
npm install
npm run dev
npm run test-json
- Node.js
- Express
- MongoDB
- Mocha and Chai for testing
- Zod for data validation
- Description: Retrieve all contacts.
- Request Type:
GET
- Query Parameters:
age
(Number): Filter contacts by age
- Response:
- Status Code: 200 OK
- Body: Array of contacts
- Description: Retrieve a specific contact by name.
- Request Type:
GET
- Parameters:
name
(String): Name of the contact
- Response:
- Status Code: 200 OK
- Body: Contact details
- Status Code: 404 Not Found (If the contact is not found)
- Description: Create a new contact.
- Request Type:
POST
- Body: Contact information
- Response:
- Status Code: 200 OK
- Body: New contact details
- Status Code: 400 Bad Request (If the request body is invalid)
- Description: Update a specific contact by name.
- Request Type:
PATCH
- Parameters:
name
(String): Name of the contact
- Body: Updated contact information
- Response:
- Status Code: 200 OK
- Body: Updated contact details
- Status Code: 400 Bad Request (If the request body is invalid)
- Status Code: 404 Not Found (If the contact is not found)
- Description: Delete a specific contact by name.
- Request Type:
DELETE
- **Parameters:**GitHub seems not to be displaying the header correctly: try adding a space after the hash
- Status Code: 200 OK
- Body: Deleted contact details
- Status Code: 404 Not Found (If the contact is not found)
- Complete tests
- Complete MongoDB integration
- Age as query parameter
- HTML, CSS and Vanilla JavaScript
- Edit Modal
- Delete button