Lamb is a fictional software as a service for managing customer experience. It provides an efficient way to improve your customers' journey through your company's services.
This repository implements just a piece of software of what could be the solution described above. It is the implementation of an API for consulting an extract that contains information about the transactions of commentaries left by customers.
- Python >= 3.10
- FastAPI
- SQLAlchemy
- PostgreSQL
- Poetry
- Pytest
- Docker
- Docker-compose
- GitHub Actions
To run this project locally, you need to have installed all the tools listed above that were used. To facilitate this dull setup process, I made a script using GNU make
So, if you already have it installed on your computer, the repository contains a Makefile
with a script setting up the project step by step.
Before running the scripts, make sure you already have it installed:
- GNU make
- Docker
- Docker-compose
To install the project dependencies, you just need to write the following command in your terminal:
$ git clone https://github.com/cenciati/lamb-ddd-clean-arch-solid.git
$ cd lamb-ddd-clean-arch-solid/
$ make setup
Now the API should be working on http://localhost:8000/api/v1/
In case you want to remove everything that was installed, you can write the following command:
$ make clean
Once you've downloaded the source code, you can also run the API locally by typing:
$ make run_api_local
Request commentary POST /extract/:
{
"content": "Nothing to complain about.",
"rating": 8,
"tags": [
{
"id": 1,
"name": "Support",
"sentiment": 1,
"subtag": false
}
],
"customer_id": "d5ec36c3-fe23-484d-8358-32aec747d42a",
"instance_slug": "lamb",
"journey_slug": "app",
"automatic": false
}
Response commentary GET /extract/{comment_id}/:
{
"data": [
{
"id": "c3543ffe-31d7-4d4c-9bdd-098c0fac2b22",
"content": "Nothing to complain about.",
"rating": {
"score": 8,
"detractor": false
},
"tags": [
{
"id": 1,
"name": "Support",
"sentiment": 1,
"subtag": false
}
],
"customer_id": "d5ec36c3-fe23-484d-8358-32aec747d42a",
"instance_slug": {
"name": "lamb"
},
"journey_slug": {
"name": "app"
},
"automatic": false,
"experience_date": "2022-09-12T17:45:39.980237"
}
]
}
Request user POST /users/:
{
"email": "johndoe@mail.com",
"password": "bananas2000",
"instance_slug": "lamb"
}
Response customer GET /customers/id/{customer_id}:
{
"data": [
{
"id": "d5ec36c3-fe23-484d-8358-32aec747d42a",
"full_name": "John Doe",
"email": "johndoe@mail.com",
"cpf": {
"number": "01234567890"
}
}
]
}
- Increase test coverage
- Improve error handling by using
notification pattern
- Implement
JWT
authentication - Code an e-mail provider
- Deployment to the cloud