Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MoMo Transaction REST API

What This Project Does

We built a REST API to manage Mobile Money transaction records from SMS data. It's written in pure Python (no Flask or Django) and includes all the CRUD endpoints with authentication. We also compared different data structure search methods to see which is faster.

Team & Who Did What

Teniola Adam Olaleye

  • Built the main API server with routing and all the HTTP handlers
  • Implemented PUT and DELETE endpoints - took a while to get the error codes right
  • Created the DSA comparison tool to benchmark linear search vs dictionary lookup
  • Helped debug issues across the project

Kevin Manzi

  • Parsed the XML transaction data and converted it to JSON
  • Designed the data structures we use for storing transactions
  • Implemented the GET endpoints (both list all and get by ID)

Michaella Kamikazi Karangwa

  • Created the authentication module with Basic Auth
  • Handled all the authorization header parsing
  • Wrote up security concerns (we know Basic Auth isn't perfect but it works for this)

Rajveer Singh Jolly

  • Built the POST endpoint for creating new transactions
  • Added validation to make sure bad data doesn't get in
  • Created all the test scripts so we could verify everything works

Kamunuga Mparaye

  • Wrote the API documentation with examples
  • Put together the README and setup instructions
  • Coordinated integration between all our parts

What You Need

  • Python 3.7+ (we tested on 3.10)
  • curl or Postman to test it

How to Run

  1. Get the code
git clone <repository-url>
cd momo-api-project
  1. That's it! No pip install needed - we only used Python's standard library

  2. Start the server

python api/server.py

Server runs on http://localhost:8000

  1. Try it out
# Get all transactions (you need to login)
curl -u admin:password http://localhost:8000/transactions

# Get one transaction
curl -u admin:password http://localhost:8000/transactions/1

# Add a new transaction
curl -u admin:password -X POST http://localhost:8000/transactions \
  -H "Content-Type: application/json" \
  -d '{"type":"Send Money","amount":5000,"sender":"250780000001","receiver":"250780000002"}'

Project Structure

momo-api-project/
├── api/
│   ├── server.py          # Main API server (Teniola)
│   └── auth.py            # Authentication logic (Michaella)
├── dsa/
│   ├── parser.py          # XML parsing (Kevin)
│   └── search_comparison.py  # DSA analysis (Teniola)
├── docs/
│   └── api_docs.md        # API documentation (Kamunuga)
├── data/
│   └── modified_sms_v2.xml   # Sample data
├── screenshots/
│   └── README.md          # Test screenshots guide
├── tests/
│   └── test_api.sh        # Test scripts (Rajveer)
└── README.md              # This file (Kamunuga)

Available Endpoints

  • GET /transactions - Get all transactions
  • GET /transactions/{id} - Get one specific transaction
  • POST /transactions - Create a new one
  • PUT /transactions/{id} - Update an existing transaction
  • DELETE /transactions/{id} - Remove a transaction

Check docs/api_docs.md for more details and examples.

Login Info

Username: admin
Password: password

Yeah we know Basic Auth isn't the most secure but it's fine for this project

Testing Performance

Want to see how much faster dictionary lookup is than linear search?

python dsa/search_comparison.py

Spoiler: dictionaries are WAY faster (like 30x)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages