π Frontend Overview
Hey, Inner Journey frontend creators! This document provides a high-level overview of Inner Journeyβs frontend β a React and TypeScript web application styled with Chakra UI. It connects to our backend via APIs, utilizes Firebase Authentication for user management, and is deployed on Firebase Hosting. Letβs craft a stunning user experience! π
ποΈ Architecture Overviewβ
Here's a breakdown of the core technologies and concepts used:
- Framework:
ReactwithTypeScriptfor building a robust and scalable user interface. - Styling:
Chakra UIprovides a library of accessible and composable components for consistent design. - Authentication:
Firebase Authenticationhandles secure user sign-up, login, and session management. - State Management:
React Contextis used for managing global application state, such as the user's authentication status. - Deployment:
Firebase Hostingensures fast and reliable delivery of the static frontend assets.
π File Structureβ
The project follows a standard structure for React applications:
Diagrammet visar huvudkatalogerna och konfigurationsfilerna i frontend-projektet.
π οΈ Key Responsibilitiesβ
The frontend is responsible for several key aspects of the user experience:
- User Interface (UI): Rendering all pages and interactive components for features like user onboarding, journal entries, AI coach interactions, and viewing coach profiles (e.g., the
/coachespage). - API Communication: Securely calling backend API endpoints (e.g.,
/onboarding/chat,/gemini/getActivation) to fetch and send data. - Authentication Flow: Managing the user login process, handling authentication tokens, and protecting routes using
Firebase Auth. - User Experience & Animations: Implementing smooth UI transitions and interactions, potentially using libraries like
Framer Motion(as seen on the/coachespage).
π Development and Deployment Workflowβ
- Local Setup:
- Clone the repository from Git.
- Install dependencies using
npm install. - Run the development server with
npm startfor live reloading.
- Deployment:
- Changes are pushed to the main branch on Git.
- A GitHub Actions workflow automatically builds the application.
- The built assets are deployed to
Firebase Hostingusing thefirebase deploy --only hostingcommand.
- API Proxy: During local development (
npm start), requests to/apiare proxied to the backend server (typicallyhttp://localhost:8080) as configured inpackage.json. In the production environment, the frontend calls the deployed backend URL directly.
For detailed code implementation and specific setup instructions, please refer to the frontend/ directory within the main GitHub repository.