This is a simple CRM (Customer Relationship Management) application built using Go. It provides RESTful APIs for managing customer data, including creating, retrieving, updating, and deleting customer records.
- Register new customers.
- Retrieve all customers.
- Retrieve a single customer by ID.
- Update customer information.
- Delete customer records.
CRM/ ├── cmd/ │ └── main.go ├── internal/ │ ├── handlers/ │ │ └── customer.go │ ├── models/ │ │ └── customer.go │ └── routes/ │ └── router.go ├── go.mod ├── go.sum └── README.md
-
Clone the repository:
git clone https://github.com/Mohrip/CRM.git
-
CD to this path: CRM/cmd
-
Run the application: go run main.go
-
The server will start and be accessible at
http://localhost:8080
.
1- Retrieve All Customers: GET http://localhost:8080/customers
2- Create a New Customer: POST http://localhost:8080/customers
- Request Body: { "name": "Alice Johnson", "role": "Manager", "email": "[email protected]", "phone": "123456789", "contacted": true }
3- Retrieve a Customer by ID: GET http://localhost:8080/customers/{id}
4- Update a Customer: PUT http://localhost:8080/customers/{id}
- Request Body: { "name": "Alice Updated", "role": "CEO", "email": "[email protected]", "phone": "987654321", "contacted": false }
5- Delete a Customer by ID: DELETE http://localhost:8080/customers/{id}
When using the POST method to create a new customer, send the following JSON body without an ID field, as it will be uniquely generated by the application.
Example of body request: { "name": " delete3312", "role": "XXX", "email": "[email protected]", "phone": "000001", "contacted": false }
1- Go Programming Language https://go.dev/ 2- Gorilla Mux https://github.com/gorilla/mux 3- JSON Encoding/Decoding in Go https://pkg.go.dev/encoding/json 4- Udacity Go Programming Course
This project is licensed under the MIT License.