This application is a micro-blog with very basic features such as posting feed and follow a friend. My goal is to use it as an example project to test out various ideas and architectures in web backend development including
- Design abstraction layers and APIs
- Distributed cache
- NoSQL
- Database sharding etc
The features of this simple microblog application includes
- Create a new user
- Follow/unfollow users
- Post a feed
- View friends' feeds ordered by timeline
This is the spec of end-user APIs for this microblog application. All endpoints would return JSON-formatted data. For POST requests, the parameter is passed as JSON in request body.
A User
object has the following attributes
- id
- username
- password
- bio
Fetch a user by its id
Create a new user with the following args
- username
- password
- bio (optional)
Both username
and email
needs be unique
Get a list of users that follow specific user
Get a list of users that specific user is following
Follow another user with other-id
Unfollow another user with other-id
Fetch feeds from specific user
Fetch friend feeds for specific user
Fetch a specific feed
Post a new feed
- user_id
- content
mbref is abbreviate for micro-blog reference model. This is a naive implementation used as a baseline for other implementations.
It has a very typical 3-layer architecture
mbref.models
, model layer implemented with SQLAlchemymbref.logic
, application logic layermbref.www.api
, restful API implementing micro-blog API spec
I also wrote a client mbref.client
to make restful API calls. And all tests in mbref.test
are testing against restful API by using this client. The client and its tests only cares about the API, but not implementation details. Thus, they could be reused by other implementations.
For security reasons, some of config files that contains AWS credentials or DB passwords are encrypted.