How osamhack2021/app_gamelike_gamelike works
Project Type and Purpose
• From the README, note that “GameLike” is a platform designed to help users (in this case, military personnel) set goals and complete quests in a game-like fashion.
• It is a full-stack application: the backend (using Node.js, Express, and MySQL) manages data, authentication (via Passport strategies), and API endpoints, while the front-end (using React.js/React Native, Redux, and TypeScript) provides interactive mobile (and possibly web) interfaces.
• Docker and docker-compose files indicate a containerized deployment and separation between development and production environments.
File Structure
• APP(BE): The backend code contains directories for models (data definitions using a schema-like approach), passport configurations (authentication strategies with local and Kakao integration), and routes (segregating API endpoints for users, quests, posts, authentication, and more). View templates (HTML files for error, join, main, etc.) suggest server-side rendering or error pages.
• APP(FE): The front-end is mainly structured around React Native. There are separate configurations/files for Android and iOS (with separate directories for each), as well as web-specific files (App.web.tsx, index.web.js). In addition, Redux store configuration, components (for Home, Quest, Level, etc.), assets (images and fonts), and configuration files indicate how business logic is segmented within a modern front-end framework.
• CLOUD(BE): This mirrors the backend’s containerization setup, holding its own Dockerfiles and docker-compose files for managing production deployment, likely interacting with infrastructure like a MySQL instance.
• Additional files (like docker-compose.yaml, Dockerfile.dev, ip.ts, webpack.config.js) show integration and build steps to containerize and deploy the application.
Main Components and Their Relationships
a. Front-end (APP(FE)):
• Mobile Platform: React Native based components for Android and iOS are provided with navigation, user interactions (screens for login, home, quest operations, etc.), and state management via Redux.
• Web: There are web-specific entry points (e.g., App.web.tsx) indicating a responsive design for browsers.
• Assets: Fonts, images, and styles, along with bundled JavaScript (babel and webpack configs) assist in rendering a cohesive UI.
b. Back-end (APP(BE)):
• API Layer: Express server (app.js) with a clear routing structure (routes folder) handling authentication, user management, quest operations, and page rendering.
• Data Layer: Models (using files like post.js, quest.js, user.js, etc.) map the business logic to the database operations. There is a clear separation of concerns following an MVC-like pattern.
• Authentication: Passport module configuration (including strategies for Kakao and local) manages secure access.
c. Infrastructure and Deployment:
• Dockerization: Dockerfiles (.dockerignore, docker-compose.yaml, docker-entrypoint.sh in both APP(BE) and CLOUD(BE)) denote containerized deployment. This shows that both local development and cloud environments are considered.
• MySQL Database: Although not explicitly seen as a separate folder, the README mentions MySQL – so include a database component that interacts with the back-end models.
• External Services: API calls made by the front-end (using axios) to backend endpoints, and container orchestration between cloud and local deployments.
Architectural Patterns and Technologies
• MVC and API-driven Design: The separation between models, views (server-side templates), and routes in the back-end, and the Redux-managed state separation in the front-end.
• Containerization: Use of Docker and docker-compose for deployment.
• Tech Stack Labels: Node.js and Express for the server, React Native (and React.js) for the client, and MySQL as the database.
• The data flow moves from user actions in front-end components that trigger API requests to the backend, interact with models (and MySQL), then return responses that update state (Redux store).