How shpota/skmz works
Main Components
• Backend Server: This is located in the /server directory. It includes sub-components such as:
‣ GraphQL API (under the gql folder) implemented with gqlgen.
‣ Database access (under the db folder) for MongoDB, with an initialization script (mongo.init).
‣ CORS middleware (under the cors folder) to manage cross-origin requests.
‣ Models and server startup logic (in the model directory and server.go).
• Frontend Application: Found in the /webapp directory, it is a React-based project that includes public HTML files and a source folder (src) with components for programmers, skills, and search functionality.
• Database: MongoDB serves as the backend database, which is initialized with test records via the provided docker-compose-dev configuration.
• Docker Infrastructure: Dockerfile, docker-compose.yml, and docker-compose-dev.yml illustrate that the project is containerized for both production and development modes.
Relationships and Interactions
• The Frontend (React UI) communicates with the Backend (GraphQL API) via HTTP (and likely WebSocket if subscriptions are used, though not explicitly mentioned).
• The Backend processes incoming GraphQL queries, performs business logic, and interacts with MongoDB to access or update programmer data.
• External clients (developers) or tools can also interact with the GraphQL Playground (accessible via the backend) to test queries.
• Docker Compose setups tie all these components together, facilitating local development and production deployment.
Important Architectural Patterns and Design Principles
• Separation of Concerns: Clear split between frontend and backend codebases.
• API-Driven Architecture: Backend exposes a GraphQL endpoint (with a defined schema in schema.graphql) to serve data requests.
• Containerization: The use of Docker ensures consistent and reproducible environments.
• Modular Design: Inside the server, the code is organized in dedicated folders (for CORS, DB, GraphQL resolvers) indicating adherence to modular coding practices.
• Automated Testing: The presence of *_test.go files suggests an emphasis on code tests for backend logic.