Skip to content

It is a seashell management app built using Python. CRUD operations are implemented following clean-architecture. Here, FastAPI, SQLalchemy, and SQLite is used for the execution of the app.

Notifications You must be signed in to change notification settings

SamiraAfrin/Seashells-Management

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Seashells-Management

Project Description

It is a seashell management app built using Python. CRUD operations are implemented following clean-architecture. Here, FastAPI, SQLalchemy, and SQLite is used for the execution of the app.

How to start

Follow the following steps to start the web application.

  1. Clone the repository to your destination.
  2. Use pipenv to install necessary packages and set up a virtual environment.
  3. Run source venv/bin/active to activate the virtual environment
  4. Run python main.py to start the server.
  5. Run pytest to run the test cases

API Documentation

  1. POST
{
  "name": "Seashell_1",
  "collection_at": "2025-01-30T15:00:00",
  "description": "This is collected from cox'z bazar",
  "species": "snail",
  "image": "seashell.png"
}
  • Response:
    201
{
    "message": "Seashell created successfully",
    "data": {
        "id": 126,
        "created_at": "2025-02-01T13:07:03",
        "updated_at": "2025-02-01T13:07:03",
        "collected_at": "2025-01-30T15:00:00",
        "name": "Seashell_1",
        "species": "snail",
        "description": "This is collected from cox'z bazar",
        "image_url": "static/images/seashell_images/seashell.png"
    }
}
  • Example Payload:
{
  "collection_at": "2025-01-30T15:00:00",
  "description": "This is collected from cox'z bazar",
  "species": "snail",
  "image": "seashell.png"
}
  • Response:
    422
{
    "detail": [
        {
            "type": "missing",
            "loc": [
                "body",
                "name"
            ],
            "msg": "Field required",
            "input": null
        }
    ]
}
  1. PATCH
{
  "name": "Seashell_updated",
  "collection_at": "2025-01-30T15:00:00",
  "description": "This is collected from cox'z bazar",
  "species": "snail",
  "image": "seashell.png"
}
  • Responses:
    200
{
    "message": "Seashell updated successfully",
    "data": {
        "id": 127,
        "created_at": "2025-02-01T13:08:14",
        "updated_at": "2025-02-01T13:08:45",
        "collected_at": "2025-01-30T15:00:00",
        "name": "Seashell_updated",
        "species": "snail",
        "description": "This is collected from cox'z bazar",
        "image_url": "static/images/seashell_images/seashell.png"
    }
}

404

{
    "detail": "Seashell not found"
}
  1. GET
{
    "message": "Seashell retrived successfully",
    "data": {
        "id": 127,
        "created_at": "2025-02-01T13:08:14",
        "updated_at": "2025-02-01T13:08:45",
        "collected_at": "2025-01-30T15:00:00",
        "name": "Seashell_updated",
        "species": "snail",
        "description": "This is collected from cox'z bazar",
        "image_url": "static/images/seashell_images/seashell.png"
    }
}

404

{
    "detail": "Seashell not found"
}
  1. GET
{
    "message": "Seashells retrived successfully",
    "data": [
        {
            "id": 1,
            "created_at": "2025-02-01T00:54:51",
            "updated_at": "2025-02-01T10:18:23",
            "collected_at": "2024-02-01T14:30:45",
            "name": "Updated_Seashell",
            "species": "snail",
            "description": "This is collected from cox'z bazar",
            "image_url": "static/images/seashell_images/seashell.png"
        },
        {
            "id": 2,
            "created_at": "2025-02-01T09:40:19",
            "updated_at": "2025-02-01T09:40:19",
            "collected_at": "2024-02-01T14:30:45",
            "name": "Test Seashell",
            "species": "snail",
            "description": "This is collected from cox'z bazar",
            "image_url": "static/images/seashell_images/seashell.png"
        },
        {
            "id": 3,
            "created_at": "2025-02-01T09:56:07",
            "updated_at": "2025-02-01T09:56:07",
            "collected_at": "2024-02-01T14:30:45",
            "name": "Test Seashell",
            "species": "snail",
            "description": "This is collected from cox'z bazar",
            "image_url": "static/images/seashell_images/image.png"
        },
        ......
      
    ]
}
  1. DELETE
{
    "message": "Seashell deleted successfully",
    "data": {
        "id": 127,
        "created_at": "2025-02-01T13:08:14",
        "updated_at": "2025-02-01T13:08:45",
        "collected_at": "2025-01-30T15:00:00",
        "name": "Seashell_updated",
        "species": "snail",
        "description": "This is collected from cox'z bazar",
        "image_url": "static/images/seashell_images/seashell.png"
    }
}

404

{
    "detail": "Seashell not found"
}

About

It is a seashell management app built using Python. CRUD operations are implemented following clean-architecture. Here, FastAPI, SQLalchemy, and SQLite is used for the execution of the app.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages