How shashikira02/triply works
Project Overview
• Triply is a travel website offering dynamic pages such as Landing, Adventures, Adventure Details, and Reservations.
• It leverages HTML, CSS, and JavaScript on the frontend, while the backend is built on Node.js using Express.js.
• The frontend and backend are developed and run independently, with the frontend fetching data from the backend’s REST API.
• User preferences are maintained using localStorage, and the responsive design is handled primarily through Bootstrap.
Main System Components
a. Frontend:
• Frontend as a stand-alone client application.
• Internal structure:
• Pages and Modules: Separate modules for each page (Landing, Adventures, Adventure Details, and Reservations), which control and render the views.
• Assets: HTML files, CSS styles, and JavaScript modules in the “frontend” directory.
• Configuration: The “conf” folder (with index.js) where the backend endpoint (BackendPoint) is set.
• Testing: A suite of tests in the __tests__ directory.
b. Backend:
• Backend as a Node.js/Express.js server application.
• That the backend contains:
• server.js: The core server file defining API endpoints.
• db.json: A JSON file acting as either a lightweight datastore for reservations and adventure data.
• random_data.js: Likely a script to generate or manipulate sample backend data.
c. Media and Other Assets:
• Images and video (e.g., Triply.mp4) that support the frontend and provide multimedia content.
• The repository also includes standard configuration files (package.json, .gitignore, etc.) which are not part of the runtime architecture but are important for project setup.
Data Flow and Interactions
• Within the frontend, indicate that modules are handling different aspects of the user session and page rendering (e.g., filters for the adventures page, reservation form submissions).
• That the backend responds with data which might be stored temporarily in localStorage on the client side to persist user preferences.
Architectural Patterns and Design Principles
• Separation of Concerns: Clearly separate concerns between the backend (data processing/API handling) and the frontend (presentation/UI logic).
• MVC-like Structure (at a basic level): Although not a strict MVC, the modules in the frontend manage the view logic while the backend acts as a controller and access layer for the data.
• RESTful Communication: Emphasize that the frontend communicates with the backend over REST APIs.
Relevant Technologies
• Frontend: HTML, CSS, JavaScript (with Bootstrap for responsive design), localStorage for persistence.
• Backend: Node.js as the runtime, Express.js as the framework for API creation.
• Deployment: Frontend is hosted on Netlify/Vercel, and the backend is deployed on Render.