A Simple Blog Service created with Fast API and Redis-OM
Here's a short video that explains the project and how it uses Redis:
The blog is pretty simple. It has the following API's;
-
A
GETmethod at the home page that displays the messageHello world, I am Salim from Africa!. -
Two
POSTmethods [to create authors and blogs respectively] that users can use to create a new blog and register as an author.
The author method collects the pk, first name, last name, email address, bio of the author and the date the author joined. The schema is shown below.
"pk": "string",
"first_name": "string",
"last_name": "string",
"email": "string",
"bio": "string",
"date_joined": "2022-08-24T16:59:09.222111"
-
A
GETmethod that retrieves the created blogs. -
A
PUTmethod that is capable of updating blogs. -
A
DELETEmethod that makes users able to delete blogs.
Data is accessed using a pk i.e. a keyword that is assigned to each author.
Step 1: Clone the repository locally to a location of your choice.
Step 2: Create and activate a virtual environment.
For windows
$ python -m venv env
$ cd env\Scripts\activate
For MacOS
$ python3 -m venv env
$ source env/bin/activate
Step 3: Install all the needed dependencies in the virtual environment
pip install -r requirements.txt
Step 4: Go to the blog directory and run the server
$ cd blog
$ uvicorn main:app --reload
Step 5: Navigate to http://127.0.0.1:8000 in your browser.
This returns the home page below;
Step 6: Add a /docs path in the url tab as shown below;
Step 7: Enter the url http://127.0.0.1:8000/docs to run the app.
- A python interpreter
- A code editor
To make deploys work, you need to create free account on Redis Cloud
To run on Google button, check here
To deploy on Heroku button, check here
To deploy on Netlify button, check here
To deploy on Vercel button,check here
Here some resources to help you quickly get started using Redis Stack. If you still have questions, feel free to ask them in the Redis Discord or on Twitter.
- Sign up for a free Redis Cloud account using this link and use the Redis Stack database in the cloud.
- Based on the language/framework you want to use, you will find the following client libraries:
- Redis OM .NET (C#)
- Watch this getting started video
- Follow this getting started guide
- Redis OM Node (JS)
- Watch this getting started video
- Follow this getting started guide
- Redis OM Python
- Watch this getting started video
- Follow this getting started guide
- Redis OM Spring (Java)
- Watch this getting started video
- Follow this getting started guide
- Redis OM .NET (C#)
The above videos and guides should be enough to get you started in your desired language/framework. From there you can expand and develop your app. Use the resources below to help guide you further:
- Developer Hub - The main developer page for Redis, where you can find information on building using Redis with sample projects, guides, and tutorials.
- Redis Stack getting started page - Lists all the Redis Stack features. From there you can find relevant docs and tutorials for all the capabilities of Redis Stack.
- Redis Rediscover - Provides use-cases for Redis as well as real-world examples and educational material
- RedisInsight - Desktop GUI tool - Use this to connect to Redis to visually see the data. It also has a CLI inside it that lets you send Redis CLI commands. It also has a profiler so you can see commands that are run on your Redis instance in real-time
- Youtube Videos
- Official Redis Youtube channel
- Redis Stack videos - Help you get started modeling data, using Redis OM, and exploring Redis Stack
- Redis Stack Real-Time Stock App from Ahmad Bazzi
- Build a Fullstack Next.js app with Fireship.io
- Microservices with Redis Course by Scalable Scripts on freeCodeCamp







