To run the UI in development mode (make changes and see them reflected in the browser with hot reloading), follow these steps:
npm install
- Installs necessary dependencies.yarn start
- Starts the development server.yarn build
- Builds the app for production (optional).
Our frontend codebase is structured around React components and utilities designed to support dynamic and scalable web application development. Here's a quick overview:
- Components: Located in
frontend/src/components
, includes everything from layout wrappers to small atomic components. - Views: Components specific to application views are in
frontend/src/components/views
, categorized under directories likebuilder
,test
anddeploy
. - Utilities: Helper functions and utilities are in
frontend/src/components/utils
.
- Pages: Entry points for different routes are in
frontend/src/pages
. - Routing: Integrated with Gatsby for seamless page transitions and dynamic routing.
- Redux: Used for state management across the application, setup can be found in
frontend/src/store
.
- API Utilities: Functions to interact with the backend API are centralized in
frontend/src/components/api_utils.tsx
.
- Ant Design: Leveraged for UI components.
- TailwindCSS: For custom styling needs.
- Firebase: Utilized for authentication.
- Redux Persist: For persistent state management.
For a detailed view of each component and utility, refer to the respective files in the source directory.
- The app is built with Gatsby, providing fast setup and rich configurations. Learn more about setting up a Gatsby app here.
- Key files include
gatsby-config.js
,gatsby-node.js
,gatsby-browser.js
, andgatsby-ssr.js
.
- Styling is managed with TailwindCSS. A guide to integrating TailwindCSS with Gatsby is available here.
To add new pages:
- Create a new folder in
src/pages
. - Add an
index.tsx
file as the entry point. Use the content style fromsrc/pages/index.tsx
as a template.
The frontend expects the backend API to be available at http://localhost:8000/api/v1
.
- Refer to
.env.default
. - Copy this file and rename it to
.env.development
. - Set the variable values, particularly
GATSBY_API_URL
, which should behttp://localhost:8000/api/v1
for local development environments. - Set up Firebase Authentication and Firestore and update the src/firebase/firebaseConfig.json file with your Firebase project configuration.