Skip to content
EcoMute: A Bike-Sharing Backend

EcoMute: A Bike-Sharing Backend

EcoMute Core is the backend for a bike-sharing service: riders, bikes, stations, and rentals behind a documented API. The service grew over nine stages from a single endpoint to a tested application.

FastAPISQLAlchemyJWTpytestSQLite

15

routes

7

routers

4

data models

17

passing tests

Problem

Understanding the challenge and user needs

A rental system has to answer who the rider is, which bike is free, and where it sits, and it has to stay correct when several requests arrive at once.

Approach

Strategy and methods used to address the problem

Seven routers cover bikes, users, rentals, stations, administration, authentication, and predictions. Four data models persist through async SQLAlchemy, and JSON Web Tokens with hashed passwords protect the routes that change data.

The running service documents itself: every endpoint, grouped by router, with the lock marking routes that need a token.

The API surface

MethodPathPurpose
GET/bikes/List bikes
POST/bikes/Create a bike
GET/bikes/{bike_id}Bike detail
PUT/bikes/{bike_id}Update a bike
DELETE/bikes/{bike_id}Delete a bike
GET/users/List users
POST/users/Create a user
GET/users/{user_id}User detail
PUT/users/{user_id}Update a user
DELETE/users/{user_id}Delete a user
POST/rentals/Start a rental
POST/stations/Create a station (admin only)
GET/admin/statsFleet statistics
POST/tokenLog in for an access token
POST/predictEstimate trip duration

Final Solution

The final design and outcome

The final stage exposes 15 routes across seven routers and passes 17 automated tests covering both the API and the pricing logic.

The test suite covers listing and filtering bikes, role checks on station creation, login, prediction input, and pricing edge cases.

Impact & Validation

Results, learnings, and outcomes

EcoMute covers the full shape of a backend service in miniature: authentication, persistence, routing, and tests that hold the pieces to their contract.