Junior FullStack Developer API Task
Junior FullStack Developer API Task
Adhering to software engineering best practices affects delivery and deployment by ensuring the final solution is reliable, efficient, and easy to maintain. It leads to a solution that is not only robust and production-ready but also aligns with industry standards, making it easier to integrate, scale, and extend as needed. This adherence promotes better collaboration, facilitates continuous improvement, and helps avoid technical debt .
The assignment emphasizes practices like using a standardized API with proper response codes and HTTP methods, following software development lifecycle (SDLC) guidelines, comprehensive documentation, and maintaining a clear Git commit history. These best practices are important as they ensure maintainability, scalability, and readability of the codebase, promote collaborative development efforts, and make the process efficient and transparent to all stakeholders involved .
The API should handle invalid inputs gracefully by validating input data and returning appropriate response codes and error messages. This robustness is critical for preventing unintentional system crashes or unpredictable behavior, thus ensuring reliability and maintaining trust with users by providing clear, actionable feedback when inputs do not meet expected criteria .
Storing package data in a PostgreSQL database requires considerations related to schema design, indexing for performance, transaction management for data integrity, and provisioning for scalability. Choosing PostgreSQL supports deployment by offering a robust, feature-rich relational database system known for reliability, scalability, and performance, thereby ensuring the deployed packages are efficiently managed and retrievable as needed .
The choice of storage layer, whether filesystem or object storage, impacts the underlying design and implementation of the package system's REST API in terms of how the data persistence and retrieval operations are handled. Different storage strategies require specific configuration through a flag in 'application.properties', which can be overridden by environment variables. This flexibility affects scalability, performance, and how data is managed internally, enabling customization to suit various deployment environments .
The deployment REST endpoint is responsible for accepting and handling uploaded files for deployment purposes. It specifically handles two types of files: 'package.rep', which is a binary file under the hood a .zip file containing compiled source code, and 'meta.json', a metafile providing additional package information such as name, version, author, and dependencies .
The 'meta.json' file must include fields such as 'name', 'version', 'author', and 'dependencies'. This information is critical as it provides the necessary metadata to identify the package, ensure version control, credit authorship, and handle dependencies during deployment. This structured data helps maintain package integrity and manage compatibility with other libraries and systems .
Deploying the Spring Boot application to a Docker container ensures consistency across different environments and simplifies deployment processes by packaging the application along with all dependencies. By providing it in a public repository, it ensures accessibility for testing and validation by the reviewing team, facilitating easier verification of the solution's robustness and alignment with the project criteria .
The implementation requires two separate Java libraries to support basic write and read operations for different storage strategies: 'filesystem' and 'object-storage'. These libraries must be deployed to a private maven repository at Repsy. The Spring Boot application uses these libraries, ensuring modular and scalable storage management. Integrating these libraries allows for a flexible and adaptable system architecture where storage strategies can be easily switched as per the deployment needs .
Providing only two REST endpoints simplifies the API design, focusing it specifically on the deployment and download functionalities. This approach reduces potential attack vectors and minimizes complexity, ensuring a clearer, more maintainable system. Designing them requires careful consideration of input validation, error handling, response times, and alignment with API guidelines to create a robust and efficient communication interface .