Desunovu / ariadne-react-store

This is an educational project focused on developing an online store appication using Ariadne, SQLAlchemy and React. Manages products, orders, user authentication, and more. Please be aware that the project may not strictly adhere to the best coding practices and application architecture.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Online store development using Ariadne, React and PostgreSQL

This repository contains the backend and frontend applications of an educational online store project. It provides functionalities for managing products, users, cart, orders, authentication, and related operations.

demo_homepage.png

Detailed demo screenshots

Technologies and Tools

The project uses the following technologies and tools:

  • Programming Languages: Python, JS
  • Backend frameworks/libs: Ariadne, Flask, SQLAlchemy, MinIO
  • Frontend framework: React
  • Database: PostgreSQL
  • File Storage: MinIO
  • API type: GraphQL API
  • Containerization: Docker

Requirements

To run this application, the following requirements must be met:

  • Python 3.10 or higher
  • Docker and Docker Compose (if running the application using Docker)

Installation and Usage

To install and run the application in development mode, follow these steps:

Cloning the Repository and Configuring Environment Variables

  1. Clone the repository: git clone https://github.com/Desunovu/graphql-store-backend.git.
  2. Rename ./backend/.env.example to ./backend/.env

Now, run the application using one of the following methods:

Running with Docker

  1. Edit the ./backend/.env file, specifying the device connection address for the MINIO_ENDPOINT (the address must be accessible to the frontend user)
  2. Execute the command docker-compose --profile full up --build to deploy the entire application, including the required services.

Running the Back-end application in Manual Mode

    • Option 1: Deploy the postgres and minio services using docker-compose --profile dev up -d.
    • Option 2: Deploy and configure postgres and minio services independently.
  1. Edit the ./backend/.env file, specifying the connection address for the MINIO_ENDPOINT and POSTGRES_HOST variables.
  2. Install the dependencies: pip install -r requirements.txt.
  3. Set the FLASK_APP environment variable to the main package name store_backend.py.
  4. Run the application: flask run.

GraphQL API

The API provides the following mutations:

  • createUser: Register a new user.
  • updateUser: Update user information.
  • uploadAvatar: Upload a user's avatar
  • deleteUser: Delete a user.
  • assignAdmin: Assign admin role to a user.
  • addProduct: Add a new product.
  • updateProduct: Update product information.
  • deleteProduct: Delete a product.
  • addCategory: Create a new category.
  • removeCategory: Remove a category.
  • addReview: Leave or update a review.
  • removeReview: Delete a review.
  • createOrder: Create a new order.
  • updateOrderStatus: Update the status of an order.
  • addProductToFavorites: Add a product to favorites.
  • removeProductFromFavorites: Remove a product from favorites.
  • createCharacteristic: Create a new characteristic.
  • deleteCharacteristic: Delete a characteristic.
  • addProductToCart: Add a product to the shopping cart.
  • removeProductFromCart: Remove a product from the shopping cart.
  • setProductCharacteristicValue: Set a value for a product characteristic.

And the following queries:

  • loginUser: Obtain an authorization token.
  • getUser: Get user information.
  • getUsers: Get a list of users.
  • getProduct: Get product information.
  • getProducts: Get a list of products.
  • getCart: Get cart information.
  • getCategories: Get a list of categories.
  • getOrders: Get a list of orders.
  • getFavoriteProducts: Get a list of favorite products.
  • getCharacteristics: Get a list of available characteristics.

About

This is an educational project focused on developing an online store appication using Ariadne, SQLAlchemy and React. Manages products, orders, user authentication, and more. Please be aware that the project may not strictly adhere to the best coding practices and application architecture.


Languages

Language:Python 50.8%Language:JavaScript 47.5%Language:HTML 0.8%Language:CSS 0.4%Language:Dockerfile 0.3%Language:Mako 0.2%Language:Shell 0.0%