uvicorn api.main:app --host 0.0.0.0 --port 8818
-
Clone the repository:
git clone https://github.com/Nebula-Heroes/rs-api
-
Load environment variables from .env file:
export $(cat .env | xargs)
-
Build and run the Docker containers:
docker-compose up --build -d
This command will build the Docker image for the Luxey API and start the container.
- Access the API:
The API will be available at http://localhost:8818. You can use tools like cURL or Postman to make requests to the API endpoints.
-
Get article [Product]
GET /api/get_article?contentid={content_id}
Returns the article with the given id. Example: http://api.recsysproject.tech/api/get_article?content_id=2480569770059008227 Example: http://localhost:8818/api/get_article?content_id=2480569770059008227
-
Add user interaction [Product]
GET /api/interaction(user_id: str & event_type: str & content_id: str & session_id: str & user_agent: str & user_region: str & user_country: str
} Adds a user interaction to the database. Example: http://api.recsysproject.tech/api/interaction?user_id=29888888888&event_type=VIEW&content_id=4109618890343020064&session_id=7899999999999&user_agent=Mozilla%20SPAM%20LINH%20TINH&user_region=US&user_country=USA Example: http://localhost:8818/api/interaction?user_id=29888888888&event_type=VIEW&content_id=4109618890343020064&session_id=7899999999999&user_agent=Mozilla%20SPAM%20LINH%20TINH&user_region=US&user_country=USA
- Get homepage articles [home]
Returns the articles on the homepage. Example: http://api.recsysproject.tech/api/recommend_homepage_articles?user_id=-9150583489352258206 Example: http://localhost:8818/api/recommend_homepage_articles?user_id=-9150583489352258206
GET /api/recommend_homepage_articles?user_id={user_id}
- Get recommended articles (By Like button) [Product]
Returns the recommended articles for the user. Example: http://api.recsysproject.tech/api/recommend_liked_articles?content_id=2480569770059008227 Example: http://localhost:8818/api/recommend_liked_articles?content_id=2480569770059008227
GET /api/recommend_liked_articles?content_id={content_id}
- Get recommended articles (By follow button) [Product]
Returns the recommended articles for the user. Example: http://api.recsysproject.tech/api/recommend_followed_articles?author_person_id=-2979881261169775358 Example: http://localhost:8818/api/recommend_followed_articles?author_person_id=-2979881261169775358
GET /api/recommend_followed_articles?author_person_id={author_person_id}
- Get recommended articles (related articles) [Product]
Returns the recommended articles for the user. Example: http://api.recsysproject.tech/api/recommend_related_articles?userid=-9150583489352258206 Example: http://localhost:8818/api/recommend_related_articles?userid=-9150583489352258206
GET /api/recommend_related_articles?user_id={user_id}