LogoLogo
  • AppFlowy
    • ⭐Start here
      • Welcome to AppFlowy Docs
      • How to get help
      • Install AppFlowy
    • 🛠️Installation
      • 🖥️System Requirements
      • 💿Installation methods
        • Mac / Windows / Linux Packages
          • Installing on Linux
            • Installing & Setting up Flutter on Linux from Source
        • Docker
    • 🌱Community
      • 🤙Get in contact
      • 📔AppFlowy Mentorship Program
        • Program Guidance
        • Proposal Template
        • Pull Request Template
        • Mentorship 2023
          • Mentee Projects
            • Calendar View for AppFlowy Database
            • Custom Themes
            • Shortcuts and Customized Hotkeys for AppFlowy
            • Table
            • ⭐Favorites
            • Code Block
            • Outlines
            • Importers
            • AI Writers
            • Templates
          • Project Ideas
      • ✍️Write for AppFlowy
        • 📃Drafts
          • [Draft] Use Case: Software Engineer
          • [Draft] Use Case: High School Students
          • [Draft] How to add a new property to appflowy database
      • 🍂Hacktoberfest
    • 🛣️Roadmap
    • 🌋Product
      • 💽Data Storage
      • 🎨Customize and Style Content
      • ⏮️Duplicate, Delete, and Restore
      • 💎Databases
        • 🔢Database Properties
        • 🗃️Manage Properties
      • Ⓜ️Markdown
      • ⌨️Shortcuts
      • 🪄AppFlowy AI
      • 🦙AppFlowy Local AI - Ollama
      • 🎨Themes
      • ☁️AppFlowy Cloud
      • 🧩AppFlowy Plugins
        • Table-view Databases
        • Kanban Board
        • Calendar
        • Auto Generator
        • Smart Edit
        • Code Blocks
        • Math Equations
        • Cover
        • Emoji
  • Documentation
    • 💎Software Contributions
      • 🟢Get started
      • 💀Architecture
        • Frontend
          • Tauri
            • 🗺️CodeMap
          • Web
            • 🌟Design Philosophy
          • Flutter
            • 🗺️Project Structure: CodeMap
            • 🧮Grid
            • ⚙️Setting
          • Inter-Process Communication
          • User
            • User Data
            • Events & Notifications
          • Folder
            • Events & Notifications
          • Document
          • Database View
            • Events & Notifications
            • Grid
            • Calendar
            • Kanban Board
        • Backend
          • Initialize
          • Events
          • Delta(WIP)
          • Profiling
          • Database
        • Domain Driven Design
        • Proposals
      • 🏗️Conventions
        • 🔤Naming Conventions
        • ⌨️Code Conventions
          • 🐦Flutter
        • 🐙Git Conventions
      • 💛Submitting Code
        • 🏦Setting Up Your Repositories
        • ⤴️Submitting your first Pull Request
      • 🤟Coding Standards and Practices
        • 👽Rust Backend
    • 🚀AppFlowy
      • 👾How to contribute to AppFlowy
      • 🏗️Building from Source
        • 🌳Flutter Setup
          • 🐧Building on Linux
          • 🍎Building on macOS
          • 🪟Building on Windows
        • 🌐Web Setup
        • 📡Tauri Setup
      • ☁️Debugging with AppFlowy Cloud
      • 🔁Debugging in VS Code
      • ☎️Translate AppFlowy
      • ❓Troubleshooting
      • 👮‍♀️Licenses
    • 🏍️AppFlowy Editor
      • ⌨️How to Implement Markdown Syntax To Style Text In AppFlowy Editor
      • 🧩How to Create a Plugin for AppFlowy Editor
      • 👮‍♀️Licenses
    • ☁️AppFlowy Cloud
      • 🌈Architecture
      • ☀️Deployment
  • Guides
    • Sync Desktop and Mobile
    • Self-Hosting AppFlowy
      • ☁️Self-hosting AppFlowy with AppFlowy Cloud
      • 🆓Self-hosting AppFlowy for free Using Supabase
    • Import From Notion
  • Blog Highlights
    • 🔮Demystifying AppFlowy Editor's Codebase
  • Handbook
    • Core values
Powered by GitBook
On this page
  • 🌟 Introduction
  • 🛠 Getting Started
  • 🧪 Running Tests
  • 🔄 Development Workflow
  • 🚀 Production Deployment

Was this helpful?

Edit on GitHub
  1. Documentation
  2. AppFlowy
  3. Building from Source

Web Setup

PreviousBuilding on WindowsNextTauri Setup

Last updated 4 months ago

Was this helpful?

🌟 Introduction

Welcome to the AppFlowy Web project! This project aims to bring the powerful features of AppFlowy to the web. Whether you're a developer looking to contribute or a user eager to try out the latest features, this guide will help you get started.

AppFlowy Web is built with the following technologies:

  • React: A JavaScript library for building user interfaces.

  • TypeScript: A typed superset of JavaScript that compiles to plain JavaScript.

  • Bun: A fast all-in-one JavaScript runtime.

  • Nginx: A high-performance web server.

  • Docker: A platform to develop, ship, and run applications in containers.

Let's dive in and get the project up and running! 🚀

🛠 Getting Started

Prerequisites

Before you begin, make sure you have the following installed on your system:

Clone the Repository

First, clone the repository to your local machine:

git clone https://github.com/AppFlowy-IO/AppFlowy-Web.git

Install Dependencies

Install the required dependencies using pnpm:

## ensure you have pnpm installed, if not run the following command
# npm install -g [email protected]

pnpm install

Configure Environment Variables

Create a .env file in the root of the project and add the following environment variables:

AF_BASE_URL=http://localhost:8080
AF_GOTRUE_URL=http://localhost:9999
AF_WS_URL=ws://localhost:8080/ws/v1

Start the Development Server

To start the development server, run the following command:

pnpm run dev

Usage

  1. Create a .env file in the root of the project and add the following environment variables:

AF_WS_URL=wss://test.appflowy.cloud/ws/v1
AF_BASE_URL=https://beta.appflowy.cloud
AF_GOTRUE_URL=https://beta.appflowy.cloud/gotrue

🚀 Building for Production(Optional)

if you want to run the production build, use the following commands

pnpm run build
pnpm run start

This will start the application in development mode. Open http://localhost:3000 to view it in the browser.

🧪 Running Tests

Unit Tests

We use Jest for running unit tests. To run the tests, use the following command:

pnpm run test:unit

This will execute all the unit tests in the project and provide a summary of the results. ✅

Components Tests

We use Cypress for end-to-end testing. To run the Cypress tests, use the following command:

pnpm run cypress:open

This will open the Cypress Test Runner where you can run your end-to-end tests. 🧪

Alternatively, to run Cypress tests in the headless mode, use:

pnpm run test:components

Both commands will provide detailed test results and generate a code coverage report.

🔄 Development Workflow

Linting

To maintain code quality, we use ESLint. To run the linter and fix any linting errors, use the following command:

pnpm run lint

🚀 Production Deployment

Our production deployment process is automated using GitHub Actions. The process involves:

  1. Setting up an AWS EC2 instance: We use an EC2 instance to host the application.

  2. Installing Docker and Docker Compose: Docker is installed on the AWS instance.

  3. Configuring SSH Access: SSH access is set up with a user and password.

  4. Preparing Project Configuration: We configure Dockerfile, nginx.conf, and server.cjs in the web project.

  5. Using GitHub Actions: We use the easingthemes/ssh-deploy@main action to deploy the project to the remote server.

The deployment steps include building the Docker image and running the Docker container with the necessary port mappings:

docker build -t appflowy-web-app .
docker rm -f appflowy-web-app || true
docker run -d -p 80:80 -p 443:443 --name appflowy-web-app appflowy-web-app

(v18.6.0) 🌳

(package manager) 📦

(testing framework) 🃏

(end-to-end testing) 🧪

Install CORS Unblock extension in your browser to bypass CORS issues.

Open to view the application in your browser.

The Web server runs on Bun. For more details about Bun, please refer to the .

🚀
🏗️
🌐
Node.js
pnpm
Jest
Cypress
Chrome
http://localhost:3000
Bun documentation