The Artisan Platform is a web application designed to connect artisans with customers, providing a space to showcase and sell handcrafted products. It aims to empower artisans by providing tools for managing their online presence and facilitating transactions.
The project follows a layered architecture:
- Presentation Layer: Handles HTTP requests and responses, including controllers and DTOs.
- Application Layer: Contains the business logic of the application, implemented through services.
- Domain Layer: Represents the core business objects and rules, using models/entities.
- Infrastructure Layer: Manages data persistence and external system interactions, using repositories and database models.
Key design patterns include the Repository pattern for data access abstraction and Data Transfer Objects (DTOs) for data transfer between layers.
- Programming Language: Python
- Web Framework: Flask
- API Framework: Flask-RESTx
- Database: MySQL, PostgreSQL, SQLite (for testing)
- ORM: SQLAlchemy
- Data Validation: Pydantic
- Database Migrations: Alembic
- CI/CD: GitHub Actions
- Security Testing: OWASP ZAP
-
Clone the repository:
git clone <repository_url> cd artisan-platform
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
-
On Windows:
venv\Scripts\activate
-
On macOS and Linux:
source venv/bin/activate
-
-
Install dependencies:
pip install -r requirements.txt
-
Configure environment variables:
- Create a
.envfile based on.env.example. - Set the necessary environment variables, such as
FLASK_SECRET_KEYandDATABASE_URL.
- Create a
This backend project utilizes Alembic for managing database schema migrations. See more details in the Alembic README.
This project uses GitHub Actions for automated CI/CD. The configuration files are located in the .github/workflows directory. These workflows automate the following:
- Running tests on each pull request.
- Deploying the application to staging/production environments upon merging to specific branches.
This project incorporates security testing using OWASP ZAP (Zed Attack Proxy). This tool helps identify vulnerabilities in the application. Details on how to run and interpret the security scans can be found in the Security Testing Documentation (example path, create if needed).
-
Run the application:
flask run
-
Run tests:
pytest
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Follow the project's coding conventions.
- Submit a pull request.