Skip to content

Nkasi-e/instagram-influencer

Repository files navigation

INSTAGRAM INFLUENCER SEARCH PORTAL

build Coverage Status

Features

  • Users can create account with just email and password
  • Authenticated users can create profile, providing username, followers count and bio
  • One user is liable to have a single profile, that means a user cannot create multiple profiles
  • visitors can use the search endpoint to search text in username and bio, minimum followers count and maximum followers count
  • search result returns a list of profiles that meets the search criterial

API Documentation

API allows visitors to search for profile username and bio, and profile counts which can either be minimum or maximum followers count, and also allows only authorized users to create profile.

Models

Users

field data_type constraints validation
id Object required None
email string required unique, email must conform to email (example: [email protected])
password string required pasword must contain at least one uppercase, one lowercase, one number, and must be at least 8 characters
created_at timestamp automatically set None

Profile

field data_type constraints validation
id integer required None
username string required None
followers Integer required None
bio String(100) optional, default value set to None None
created_at timestamp required, automatically set None
owner_id Integer required, ForeignKey, Unique None

Home Page

  • Route: /
  • Method: GET
  • Header
    • Authorization: None
  • Response: Success
{
  "message": "Welcome to Instagram Influencer search portal"
}

Signup User

  • Route: /account/signup
  • Method: POST
  • Header
    • Authorization: None
  • Body:
{
  "email": "[email protected]",
  "password": "Password123"
}
  • Response: Success
{
  "id": 1,
  "email": "[email protected]",
  "created_at": "2023-02-05T15:29:24.712Z"
}

Login User

  • Route: /login
  • Method: POST
  • Body:
{
  "email": "[email protected]",
  "password": "Password123"
}
  • Response: Success
{
  "email":"[email protected]",
  "access_token": "accesstokenexample&8ofiwhb.fburu276r4ufhwu4.o82uy3rjlfwebj",
  "token_type": "Bearer"
}

Create Profile

  • Route: /profile
  • Method: POST
  • Header
    • Authorization: Bearer {token}
  • Body:
{
  "username": "string",
  "followers": 100,
  "bio": "I am a software developer"
}
  • Response: Success
{
  "username": "string",
  "followers": 100,
  "bio": "I am a software developer",
  "id": 1,
  "created_at": "2023-02-05T19:02:41.204Z",
  "owner": {
    "id": 1,
    "email": "[email protected]",
  }
}

Search Route

  • Route: /search

  • Method: GET

  • Header

    • Authorization: None
  • Body:

  • Response: Success

[
    {
    "username": "string",
    "followers": 100,
    "bio": "I am a software developer",
    "id": 1,
    "created_at": "2023-02-05T19:02:41.204Z",
    "owner": {
        "id": 1,
        "email": "[email protected]",
    }
    },

    {
    "username": "user",
    "followers": 10,
    "bio": "I am a devOps Engineer",
    "id": 2,
    "created_at": "2023-02-05T19:02:41.204Z",
    "owner": {
        "id": 2,
        "email": "[email protected]",
    }
    },

    {
    "username": "example",
    "followers": 100,
    "bio": "I am a Technical writer",
    "id": 3,
    "created_at": "2023-02-05T19:02:41.204Z",
    "owner": {
        "id": 3,
        "email": "[email protected]",
    }
    },
]

Search Route with query

  • Route: /search?text=Engineer&min_followers=100

  • Method: GET

  • Header

    • Authorization: None
  • Body:

  • Response: Success

[
    {
  "username": "string",
  "followers": 100,
  "bio": "I am a software developer",
  "id": 1,
  "created_at": "2023-02-05T19:02:41.204Z",
  "owner": {
    "id": 1,
    "email": "[email protected]",
  }
}
]

Getting Started

Prerequisites

In order to run this project locally, you would need to have the following installed on your local machine.

  • Python ^3.10,
  • PostgreSQL
  • Docker (Optional)

Installation

  • Clone this repository
git clone [https://github.com/Nkasi-e/instagram-influencer.git]
  • update env with .env.example.txt
  • Download all dependecies using pip install -r requirements.txt or poetry install that's if you have poetry installed already on your machine

to start up server

  • run uvicorn app.main:app --reload

to start up container in detached mode

  • run docker-compose -f decker-compose-dev.yml up -d

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published