This is a sample backend project for the RealWorld specification written in Python using FastAPI, SQLAlchemy, Pydantic, and PostgreSQL as the database. Essentially, it's a blogging platform similar to Medium.
I don't plan on adding any frontend to this project, but you can see it in action using the demo frontend at https://demo.realworld.io/.
Thanks to Thinkster for creating the RealWorld specification and providing the original implementation
- User registration and authentication
- User profiles
- User follow/unfollow
- Create/update/delete articles
- Articles listing/feed
- Article comments
- Favorite/unfavorite articles
Clone the repository and install the dependencies:
git clone https://github.com/elias-ka/realworld.git
cd realworld
poetry install
Copy the .env.example
file to .env
and fill in the values:
cp .env.example .env
Create a PostgreSQL database and run the migrations:
poetry run alembic upgrade head
Run the server:
poetry run uvicorn realworld.main:app
To locally run the provided Postman collection against your backend, in the root folder execute:
./postman/run-api-tests.sh
For more details, see the script run-api-tests.sh.
The tests are copied from the original implementation.