Git Product home page Git Product logo

turbotale's Introduction

Turbo-Tale

Description

This Turbo-Tale is a FastAPI-based web service designed to provide a backend for blog applications. It offers a range of functionalities including user authentication, creating, editing, and retrieving blog posts, and user management.

API Docs:

image

image

Running the API Locally

To run the API locally, follow these steps:

Prerequisites

  • Python 3.9
  • pip (Python package manager)

Setup and Installation

  1. Clone the Repository

    git clone https://github.com/Addy-codes/TurboTale.git
    cd blog-api
    
  2. Set Up a Virtual Environment

    • For Windows:
      python -m venv my_venv
      .\my_venv\Scripts\activate
      
    • For Unix or MacOS:
      python3 -m venv venv
      source venv/bin/activate
      
  3. Install Dependencies

    pip install -r requirements.txt
    
  4. Environment Variables Create a .env file in the root directory and add the following:

    MONGO_USERNAME=your_username
    MONGO_PASSWORD=your_password
    
  5. Run the Application

    uvicorn app.main:app --reload
    

    The API will be available at http://localhost:8000. You can access the API documentation at http://localhost:8000/docs.

Running with Docker

To run the API using Docker Compose, follow these steps:

  1. Build and Run with Docker Compose

    docker-compose up -d --build
    
  2. Access the Application The API will be available at http://localhost:8000, and you can visit the API documentation at http://localhost:8000/docs.

Deployed API

The API is deployed on Render and can be accessed at https://turbotale.onrender.com/.

To test the API and view its documentation, visit https://turbotale.onrender.com/docs.

API Endpoints

General

  • GET /
    • Description: Root endpoint that provides a welcome message.

Authentication

  • POST /register

    • Description: Register a new user.
  • POST /login

    • Description: Authenticate a user and return a token.

Blog Routes

  • POST /blog

    • Description: Create a new blog post.
  • GET /blogs

    • Description: Retrieve all blog posts with pagination.
    • Query Parameters:
      • page_no: Page number (integer, greater than or equal to 1).
      • records_per_page: Number of blog posts per page (integer, up to 100).
  • GET /blog/{blog_id}

    • Description: Retrieve a specific blog post by ID.
    • Path Parameters:
      • blog_id: Blog post ID.
  • PATCH /blog/{blog_id}

    • Description: Update a specific blog post by ID.
    • Path Parameters:
      • blog_id: Blog post ID.
  • DELETE /blog/{blog_id}

    • Description: Delete a specific blog post by ID.
    • Path Parameters:
      • blog_id: Blog post ID.
  • GET /dashboard

    • Description: Retrieve blog posts that match the criteria of the current user.
    • Query Parameters:
      • page_no: Page number (integer, greater than or equal to 1).
      • records_per_page: Number of blog posts per page (integer, up to 100).

User Routes

  • PUT /updateUser/

    • Description: Update user information.
  • PATCH /update-tags

    • Description: Update user's tags.

turbotale's People

Contributors

addy-codes avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.