Skip to content

mishrarohit10/blogAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Blogs API

This is a FastAPI-based API for managing blogs and users. It provides endpoints for creating, retrieving, updating, and deleting blogs, login 'authentication' as well as creating and retrieving users.

Lets get started

Installation

Clone the repository:

git clone <https://github.com/mishrarohit10/blogAPI>

Install the required dependencies:

    pip install -r requirements.txt

Usage

Run the API server:

    cd app
    uvicorn main:app --reload
Open your web browser and navigate to https://localhost:8000/docs to access the `Swagger UI`. This interactive documentation provides detailed information about the available endpoints and allows you to make requests directly.

Create User

Create user using User endpoint.
Then login throught the authorization icon by typing username and password
for testing purpose (username -> [email protected] ||  password -> hello)

Endpoints

Blog Endpoints

POST /blog - Create a new blog.
GET /get - Retrieve all blogs.
GET /getby/{id} - Retrieve a specific blog by ID.
DELETE /blogs/delete/{id} - Delete a blog by ID.
PUT /blog/{id} - Update a blog by ID.

User Endpoints

POST /user - Create a new user.
GET /user/{id} - Retrieve a user by ID.

Database

This API uses a SQL database to store blogs and users. The database connection details can be configured in the blogs/database.py file.

Security

The API uses password hashing to securely store user passwords. The hashing functionality is implemented in the blogs/hashing.py module.

Contributing

Contributions are welcome! If you find any issues or would like to suggest improvements, please open an issue or submit a pull request.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages