Giter Club home page Giter Club logo

ecommerce-project's Introduction

Ecommerce Project

This is an ecommerce project that provides a backend API for managing users, addresses, products, and orders. It is built using FastAPI, SQLAlchemy, and Alembic.

Getting Started

Prerequisites

  • Python 3.9 or higher
  • PostgreSQL database (or any other supported by SQLAlchemy)

Installation

  1. Clone the repository:

    git clone https://github.com/nfonjeannoel/ecommerce-project.git
    cd ecommerce-project
  2. Create a virtual environment and activate it:

    python3 -m venv venv
    source venv/bin/activate
  3. Install the dependencies:

    pip install -r requirements.txt
  4. Set up the database:

    • Create a PostgreSQL database.

    • Configure the database connection URL in the .env file:

      DATABASE_URL=postgresql://user:password@localhost:5432/database_name
    • Apply the initial database migration:

      alembic upgrade head
  5. Start the server:

    uvicorn main:app --reload

    The API will be available at http://localhost:8000.

Project Structure

  • app/: Contains the main FastAPI application code.
  • alembic/: Contains the Alembic migration scripts.
  • models.py: Defines the database models using SQLAlchemy ORM.
  • schemas.py: Defines the Pydantic schemas for request/response validation.
  • database.py: Provides the database connection and session management.
  • main.py: Entrypoint for the FastAPI application.

Database Migration

This project uses Alembic for database migration management. The migration scripts can be found in the alembic/versions/ directory. To create a new migration script after making changes to the models, run:

alembic revision --autogenerate -m "description"

To apply the migrations:

alembic upgrade head

For more information on using Alembic, refer to the Alembic documentation.

Contributing

Contributions are welcome! If you find any issues or want to add new features, feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for more information.


Feel free to modify and expand the `README.md` file based on your project's specific details and requirements.

ecommerce-project's People

Contributors

nfonjeannoel 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.