This technical challange was designed to test the skills/knowledge/experience that a Savannah Informatics Backend Developer should possess for the purposes of recruitment. It can also be used as a yardstick for training and improving existing backend developers.
The technical interview was built around a coding assignment that is designed to screen for the following basic skills:
- Experience in developing REST and GraphQL APIs in Python/Go
- Experience with a configuration management tool e.g. Chef, Puppet, Ansible etc
- Experience working with an infrastructure as code tool e.g. Terraform or Pulumi will be an advantage.
- Experience working with containers and container orchestration tools e.g. k8s
- Experience writing automated tests at all levels - unit, integration and acceptance testing
- Experience with CI/CD (any CI/CD platform)
They were particularly interested in:
- Testing + coverage + CI/CD
- HTTP and APIs e.g. REST
- OAuth2
- Web security e.g. XSS
- Logic / flow of thought
- Setting up a database
- Version control
They were particularly interested in:
- Create a simple Python or Go service.
- Design a simple customers and orders database (keep it simple)
- Add a REST or GraphQL API to input / upload customers and orders:
- Customers have simple details e.g., name and code.
- Orders have simple details e.g., item, amount, and time.
- Implement authentication and authorization via OpenID Connect
- When an order is added, send the customer an SMS alerting them (you can use the Africa’s Talking SMS gateway and sandbox)
- Write unit tests (with coverage checking) and set up CI + automated CD. You can deploy to any PAAS/FAAS/IAAS of your choice
- Write a README for the project and host it on your GitHub
Fot the technical screening test I decided to develop the service using Golang as my primary language and PostgreSQL as my database of choice.
- Create and manage customers
- Implement authentication and authorizatio
- Create and manage orders
- Record all order changes
- When an order is added, send the customer an SMS alerting them
Requirements for the software and other tools to work, build, test and push
- Golang
1.20.3
or newer versions - Gin
- PostgreSQL
- Gorm
- Docker
- JWT
- Github-Action
- Africa's Talking SMS Gateway
- Execute
docker pull postgres:12-alpine
to get the postgres image - Execute
docker run --name customer_order_service -p 5432:5432 -e POSTGRES_USER=abdulrahman -e POSTGRES_PASSWORD=secret -d postgres:12-alpine
to run the postgres container - Execute
docker logs customer_order_service
to see the logs - Execute
docker exec -it customer_order_service psql -U root
to connect to the postgres container and login asabdulrahman
user
The easiest way to get started with the rest api in your local environment is to clone it using git:
git clone https://github.com/AbdulrahmanDaud10/Savannah-Informatics-technical-backend-challange.git
Environment Variables
You need to configure environment variables for the rest api to work as expected.
Copy the content on .env_example to .env file:
cat .env_example > .env
The .env file should look like this:
# Database Configurations
DB_HOST = "127.0.0.1"
DB_PORT = "5432"
DB_USER = "abdulrahman"
DB_NAME = "customer_order_service"
DB_PASSWORD = ""
# Port for Application to listen and Server
LISTEN_ADDRESS = "127.0.0.1"
LISTEN_PORT = "3000"
# Africa's Talking Bulk SMS Configurations
BASE_LIVE_ENDPOINT = " "
BASE_SANDBOX_ENDPOINT = " "
API_KEY = " "
USERNAME = " "
You can change the values to your own preference.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/Savannah-Informatics-technical-backend-challange
) - Commit your Changes (
git commit -m 'Add some Amazing Feature'
) - Push to the Branch (
git push origin feature/Savannah-Informatics-technical-backend-challange.git
) - Open a Pull Request
Some of the articles I read to help me solve the technical challang:
Some of the few things that need improvement:
JWT
feature should be enhanced:- Africa's Talking SMS:
Post "": unsupported protocol scheme ""[GIN] 2023/09/19 - 17:21:05 | 200 | 988.168µs | 127.0.0.1 | POST "/api/messages/send-bulk-sms"
- GCP Golang Engine Configuration:
ERROR: (gcloud.app.deploy) User [dulisyke3015@gmail.com] does not have permission to access apps instance [silver-treat-399511] (or it may not exist): Read access to project 'silver-treat-399511' was denied: please check billing account associated and retry