Odoo Synchronization Backend - #14
Open
karamih wants to merge 10 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Odoo Synchronization Backend
Summary
This pull request provides the foundation of an Odoo synchronization service built with FastAPI, PostgreSQL, SQLAlchemy, Alembic, Docker, Nginx, and uv.
The project was designed using a layered architecture with a strong emphasis on maintainability, separation of concerns, and future extensibility. Rather than tightly coupling business logic with database or external integrations, responsibilities are separated into dedicated layers (API, Services, Repositories, Adapters, Models, Database, Schemas, etc.), making the codebase easier to extend and test.
Architecture Decisions
The project follows a layered architecture:
This separation allows each layer to have a single responsibility and keeps business logic independent from infrastructure details.
Infrastructure
The project is fully Dockerized.
Current services include:
Health checks have been configured for all services, and all application configuration is managed through environment variables.
Seed Module
A dedicated seed module has been implemented separately from the backend.
The seed communicates with Odoo via XML-RPC and automatically populates the ERP with sample data, including:
Keeping the seed isolated from the backend allows data generation and testing without coupling it to the application itself.
A dedicated README is included inside the
seeddirectory describing how to execute it.Database
The following database components have been implemented:
Implemented entities:
Repository classes have also been created to isolate database access from business logic.
Running the Project
Start all services:
Before running the seed:
Then execute the seed module following the instructions documented in:
Development Commands
All backend development commands are executed inside the backend container using uv.
Examples:
Create migration:
Apply migrations:
docker compose exec backend uv run alembic upgrade headRun the test suite:
docker compose exec backend uv run pytestTests
Repository tests have been started as part of the project structure.
The testing infrastructure has been prepared using pytest and is intended to be expanded alongside the service layer implementation.
Known Limitations
Due to the available implementation time, the following planned components were not completed:
However, the project architecture has been prepared specifically to accommodate these features without requiring significant structural changes.
Final Notes
The primary objective of this implementation was to establish a clean, scalable, and maintainable foundation for the synchronization service.
Although not every planned feature has been implemented, the project already includes the complete infrastructure setup, Dockerized environment, database layer, migration system, repository abstraction, automatic Odoo data seeding, and the architectural structure required for future development.