Skip to content

LuckyRads/Mini-Shop-API

Repository files navigation

Prerequisites

  • Python 3
  • Flask
  • Flask SQL Alchemy
  • MariaDB
  • Docker (if database is ran in a container)

Project structure

  • ./init_app.py is the main application file
  • ./config.py contains all configuration properties
  • ./app contains application's source code
  • ./shop-api.postman_collection.json contains a Postman collection to test the REST API

Preparing the environment

  • Install Docker (used to host the database)
  • Install MariaDB docker run --name mariadb -e MYSQL_ROOT_PASSWORD=mypass -p 3306:3306 -d docker.io/library/mariadb:10.4
  • Install Python 3.8
  • Install Python pip
  • Install all pip packages listed in requirements.txt (pip install -r requirements.txt on Linux)
  • Install python3-mysqldb package if the server is ran on Linux
  • Create a DB schema

Running the server

  • In order to start the server, run the following command: python3 init_app.py
  • If server is started successfully, a message should appear, displaying Running on <...> (Press CTRL+C to quit)

API usage

  • Use the provided Postman collection for local API testing
  • Further API documentation is provided in Swaggerhub documentation

About

RS Challenge

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages