Description
A simple Instagram Influencer search portal built with Fastapi.
How to run locally
- Download this repo or run:
$ git clone https://www.github.com/kayprogrammer/instagram-influencers/
In the root directory:
- Create a virtual environment
$ python3 -m venv env
- Activate environment
$ source env/bin/activate
- Install dependencies
$ pip3 install -r requirements.txt
-
Create a file
.env
and copy all variables from the.env.example
to the file. You can create a new database locally with pgadmin and input the details to the respected variables in the.env
file like this...- SECRET_KEY=any_unique_random_string
- POSTGRES_USER=your_postgres_username
- POSTGRES_PASSWORD=your_postgres_password
- POSTGRES_DB=your_postgres_database_name
- PG_HOST=localhost
- PG_PORT=5432
-
Start the server
$ uvicorn setup.main:app --reload
Test Coverage
- Auth routes
$ pytest apps/auth/tests.py --disable-warnings
- Influencers routes
$ pytest apps/influencers/tests.py --disable-warnings
With Docker + Makefile
- Change the value of POSTGRES_DB in
.env
file from localhost to postgres-db - Run command below to build container
$ docker compose up --build -d --remove-orphans
OR
$ make build
- Run command below to view logs
$ docker compose logs
OR
$ make show-logs
Test Coverage
- Auth routes
$ docker compose exec api pytest apps/auth/tests.py --disable-warnings
OR
$ make test-auth
- Influencers routes
$ docker compose exec api pytest apps/influencers/tests.py --disable-warnings
OR
$ make test-influencers
Endpoints
-
Docs
- Swagger:
/docs
- Swagger:
-
Auth
- Register:
/api/v1/auth/register
- Login:
/api/v1/auth/login
- Refresh token:
/api/v1/auth/refresh
- Logout:
/api/v1/auth/logout
- Register:
-
Influencers
- Provide details:
/api/v1/influencers/provide-details
- Search:
/api/v1/influencers/search
- Provide details: