Skip to content

salimcodes/salim-blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Salim Blog API

A Simple Blog Service created with Fast API and Redis-OM

image

image

image

Overview video

Here's a short video that explains the project and how it uses Redis:

IMAGE ALT TEXT HERE

How it works

The blog is pretty simple. It has the following API's;

  • A GET method at the home page that displays the message Hello world, I am Salim from Africa!.

  • Two POST methods [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 GET method that retrieves the created blogs.

  • A PUT method that is capable of updating blogs.

  • A DELETE method that makes users able to delete blogs.

How the data is stored:

image

How the data is accessed:

Data is accessed using a pk i.e. a keyword that is assigned to each author.

image

How to run it locally?

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;

image

Step 6: Add a /docs path in the url tab as shown below;

image

Step 7: Enter the url http://127.0.0.1:8000/docs to run the app.

Prerequisites

  • A python interpreter
  • A code editor

Deployment

To make deploys work, you need to create free account on Redis Cloud

Google Cloud Run

To run on Google button, check here

Heroku

To deploy on Heroku button, check here

Netlify

To deploy on Netlify button, check here

Vercel

To deploy on Vercel button,check here

More Information about Redis Stack

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.

Getting Started

  1. Sign up for a free Redis Cloud account using this link and use the Redis Stack database in the cloud.
  2. Based on the language/framework you want to use, you will find the following client libraries:

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:

  1. Developer Hub - The main developer page for Redis, where you can find information on building using Redis with sample projects, guides, and tutorials.
  2. 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.
  3. Redis Rediscover - Provides use-cases for Redis as well as real-world examples and educational material
  4. 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
  5. Youtube Videos

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages