|
| 1 | +# Pattern recognition WEB and API |
| 2 | + |
| 3 | +This is a full-stack project for the subject of pattern recognition. The project is split into 3 parts: |
| 4 | +- **backend** - API and DB for feature set creation/deletion and execution of exploratory data analysis using PCA and hierarchical clustering |
| 5 | +- **frontend** - Interface for hosting a SPA and a wrapper for various web requests done from the frontend |
| 6 | +- **nginx** - Reverse proxy and load balancer for the backend and frontend and serving static files (CSS/JS) |
| 7 | + |
| 8 | +For each part, there is a separate README file with more detailed information in the respective folder. |
| 9 | + |
| 10 | + |
| 11 | +## Running the code |
| 12 | + |
| 13 | +You can run the project by running the following command in the root of the project: |
| 14 | +``` |
| 15 | +docker compose build |
| 16 | +docker compose up -d |
| 17 | +``` |
| 18 | +To stop the project, run the following command in the root of the project: |
| 19 | +``` |
| 20 | +docker compose down |
| 21 | +``` |
| 22 | + |
| 23 | +The dashboard can be accessed on the following URL: [http://localhost:5000/recognition-web/v1/dashboard](http://localhost:5000/recognition-web/v1/dashboard) |
| 24 | + |
| 25 | + |
| 26 | +## Basic project architecture |
| 27 | + |
| 28 | +The project uses a microservices architecture with docker compose to run the services. It creates **4 containers** that are interconnected with **2 networks**. The containers are: |
| 29 | +- **db** - Postgres database for storing the feature sets (Network: __db-api__) |
| 30 | +- **recognition-api** - API for creating/deleting feature sets and running exploratory data analysis (Network: __db-api__, __api-nginx__) |
| 31 | +- **recognition-web** - SPA for the dashboard and a wrapper for the API requests (Network: __web-nginx__) |
| 32 | +- **recognition-nginx** - Reverse proxy and load balancer for the backend and frontend and serving static files (CSS/JS) (Network: __web-nginx__, __api-nginx__) |
| 33 | + |
| 34 | +## Dependencies used |
| 35 | + |
| 36 | +Bellow is a list of dependencies used in the project by each part of the project: |
| 37 | +- **Backend** (API and DB) |
| 38 | + - API (Docker image: python:3.11-alpine) |
| 39 | + - __Python__ (Version: >=3.9, <3.12) |
| 40 | + - __asyncio__ (Version: ^3.4.3) |
| 41 | + - __aiohttp__ (Version: ^3.8.1) |
| 42 | + - __asyncpg__ (Version: ^0.26.0) |
| 43 | + - __aiohttp-sqlalchemy__ (Version: ^0.34.0) |
| 44 | + - __SQLAlchemy__ (Version: ^1.4.39) |
| 45 | + - __numpy__ (Version: ^1.17.3) |
| 46 | + - __scikit-learn__ (Version: ^1.2.0) |
| 47 | + - __pytest__ (Version: ^6.2.5) |
| 48 | + - __pytest-asyncio__ (Version: ^0.16.0) |
| 49 | + - __testcontainers__ (Version: ^3.0.0) |
| 50 | + - DB (Docker image: postgres:15.1) |
| 51 | + - __Postgres__ (Version: 15.1) |
| 52 | + |
| 53 | +- **Frontend** (Docker image: python:3.11-alpine) |
| 54 | + - __Python__ (Version: >=3.9, <3.12) |
| 55 | + - __asyncio__ (Version: ^3.4.3) |
| 56 | + - __aiohttp__ (Version: ^3.8.1) |
| 57 | + |
| 58 | +- **Nginx** |
| 59 | + - __Nginx__ (Version: 1.23) |
| 60 | + |
| 61 | +## References |
| 62 | + |
| 63 | +[1] Markelle Kelly, Rachel Longjohn, Kolby Nottingham, The UCI Machine Learning Repository, https://archive.ics.uci.edu |
0 commit comments