Skip to content

Commit bd84a8b

Browse files
committed
feat: init code
1 parent c48d32e commit bd84a8b

File tree

267 files changed

+73231
-4207
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

267 files changed

+73231
-4207
lines changed

.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.next
2+
node_modules
3+
next.config.js

.eslintrc.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module.exports = {
2+
extends: ['next', 'eslint:recommended', 'plugin:@typescript-eslint/recommended'],
3+
parser: '@typescript-eslint/parser',
4+
plugins: ['@typescript-eslint'],
5+
6+
rules: {
7+
'no-duplicate-case': 'error',
8+
'no-duplicate-imports': 'error',
9+
'@next/next/no-img-element': 'off',
10+
'@typescript-eslint/no-empty-function': 'error',
11+
'padding-line-between-statements': [
12+
'warn',
13+
{ blankLine: 'always', prev: ['const', 'let', 'var'], next: '*' },
14+
{
15+
blankLine: 'any',
16+
prev: ['const', 'let', 'var'],
17+
next: ['const', 'let', 'var'],
18+
},
19+
{ blankLine: 'always', prev: 'import', next: '*' },
20+
{ blankLine: 'any', prev: 'import', next: 'import' },
21+
{ blankLine: 'always', prev: 'block-like', next: '*' },
22+
{ blankLine: 'always', prev: 'block', next: '*' },
23+
],
24+
},
25+
};

.github/FUNDING.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ko_fi: appflowy
2+
+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Bug Report
2+
description: Create a bug report to help us improve
3+
title: "[Bug] "
4+
body:
5+
- type: textarea
6+
id: desc
7+
attributes:
8+
label: Bug Description
9+
description: A clear and concise description of what the bug is
10+
validations:
11+
required: true
12+
- type: textarea
13+
id: reproduce
14+
attributes:
15+
label: How to Reproduce
16+
description: What steps can we take to reproduce this behavior?
17+
validations:
18+
required: true
19+
- type: textarea
20+
id: expected
21+
attributes:
22+
label: Expected Behavior
23+
description: A clear and concise description of what you expected to happen
24+
validations:
25+
required: true
26+
- type: input
27+
id: os
28+
attributes:
29+
label: Operating System
30+
description: What OS are you seeing this bug on?
31+
validations:
32+
required: true
33+
- type: input
34+
id: version
35+
attributes:
36+
label: AppFlowy Version(s)
37+
description: What version(s) of AppFlowy do you see this bug on?
38+
validations:
39+
required: true
40+
- type: textarea
41+
id: screenshots
42+
attributes:
43+
label: Screenshots
44+
description: If applicable, please add screenshots to help explain your problem
45+
- type: textarea
46+
id: context
47+
attributes:
48+
label: Additional Context
49+
description: Add any additonal context about the problem here
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Feature Request
2+
description: Suggest an idea for AppFlowy
3+
title: "[FR] "
4+
body:
5+
- type: textarea
6+
id: desc
7+
attributes:
8+
label: Description
9+
description: Describe your suggested feature and the main use cases
10+
validations:
11+
required: true
12+
13+
- type: textarea
14+
id: users
15+
attributes:
16+
label: Impact
17+
description: What types of users can benefit from using the suggested feature?
18+
validations:
19+
required: true
20+
21+
- type: textarea
22+
id: context
23+
attributes:
24+
label: Additional Context
25+
description: Add any additonal context about the feature here

.github/PULL_REQUEST_TEMPLATE.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!---
2+
Thank you for submitting a pull request to AppFlowy. The team will dedicate their best efforts to reviewing and approving your pull request. If you have any questions about the project or feedback for us, please join our [Discord](https://discord.gg/wdjWUXXhtw).
3+
-->
4+
5+
<!---
6+
If your pull request adds a new feature, please drag and drop a video into this section to showcase what you've done! If not, you may delete this section.
7+
-->
8+
9+
### Feature Preview
10+
11+
<!---
12+
List at least one issue here that this PR addresses. If it fixes the issue, please use the [fixes](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests) keyword to close the issue. For example:
13+
fixes https://github.com/AppFlowy-IO/AppFlowy/pull/2106
14+
-->
15+
16+
---
17+
18+
<!---
19+
Before you mark this PR ready for review, run through this checklist!
20+
-->
21+
22+
#### PR Checklist
23+
24+
- [ ] My code adheres to the [AppFlowy Style Guide](https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/software-contributions/submitting-code/style-guides)
25+
- [ ] I've listed at least one issue that this PR fixes in the description above.
26+
- [ ] I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
27+
- [ ] All existing tests are passing.

.github/workflows/commit_lint.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Commit messages lint
2+
on: [pull_request, push]
3+
4+
jobs:
5+
commitlint:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
with:
10+
fetch-depth: 0
11+
- uses: wagoid/commitlint-github-action@v4
12+

.github/workflows/deploy_dev.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Auto Deploy to Development
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
- main
8+
9+
jobs:
10+
deploy-develop:
11+
runs-on: ubuntu-latest
12+
13+
env:
14+
SSH_TARGET: 54.206.53.213
15+
NODE_ENV: production
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
21+
- name: Get current branch
22+
id: branch
23+
run: echo "::set-output name=branch::$(echo $GITHUB_REF | awk 'BEGIN{FS="/"} {print $3}')"
24+
25+
- name: Set up SSH
26+
run: |
27+
mkdir -p ~/.ssh
28+
echo "${{ secrets.SSH_KEY_DEV }}" | openssl rsa -out ~/.ssh/id_rsa.pem # set the SSH key into the ~/.ssh/id_rsa file
29+
chmod 600 ~/.ssh/id_rsa.pem # set the permissions
30+
ssh-keyscan "$SSH_TARGET" >> ~/.ssh/known_hosts # add the host to the known_hosts file
31+
chmod 644 ~/.ssh/known_hosts # set the permissions
32+
33+
- name: Deploy to EC2
34+
run: |
35+
ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa.pem admin@$SSH_TARGET "cd space/AppFlowy-Website && git fetch && git reset --hard origin/${{ steps.branch.outputs.branch }} && pnpm install && pnpm run build && node run-script.js" || { echo "Failed to execute the command"; exit 1; }
36+

.github/workflows/deploy_prod.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Manual Deploy to Production
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
branch:
7+
description: 'Branch to deploy'
8+
required: true
9+
default: 'main'
10+
options:
11+
main:
12+
description: 'Deploy the main branch'
13+
14+
jobs:
15+
deploy-main:
16+
runs-on: ubuntu-latest
17+
18+
env:
19+
SSH_TARGET: 54.206.53.213
20+
NODE_ENV: production
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v2
25+
26+
- name: Set up SSH
27+
run: |
28+
mkdir -p ~/.ssh
29+
echo "${{ secrets.SSH_KEY }}" | openssl rsa -out ~/.ssh/id_rsa.pem # set the SSH key into the ~/.ssh/id_rsa file
30+
chmod 600 ~/.ssh/id_rsa.pem # set the permissions
31+
ssh-keyscan "$SSH_TARGET" >> ~/.ssh/known_hosts # add the host to the known_hosts file
32+
chmod 644 ~/.ssh/known_hosts # set the permissions
33+
34+
- name: Deploy to EC2 (Main)
35+
run: |
36+
ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa.pem admin@$SSH_TARGET "cd space/AppFlowy-Website && git fetch && git reset --hard origin/${{ inputs.branch }} && pnpm install && pnpm run build && node run-script.js" || { echo "Failed to execute the command"; exit 1; }

.github/workflows/test.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Test
2+
on: [pull_request]
3+
4+
env:
5+
NODE_VERSION: "18.16.0"
6+
PNPM_VERSION: "8.5.0"
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout source code
18+
uses: actions/checkout@v2
19+
- name: setup node
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: ${{ env.NODE_VERSION }}
23+
- name: install dependencies
24+
run: |
25+
npm install -g pnpm@${{ env.PNPM_VERSION }}
26+
pnpm install
27+
pnpm run build
28+
- name: run lint
29+
run: |
30+
pnpm run lint
31+
- name: run tests
32+
run: |
33+
pnpm run start & sleep 10 && pnpm run test:headless
34+

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,7 @@ yarn-error.log*
3333
# typescript
3434
*.tsbuildinfo
3535
next-env.d.ts
36+
37+
cypress/videos
38+
39+
**/*.log

.idea/.gitignore

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/appflowy-website.iml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/jsLinters/eslint.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/prettier.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pnpm-lock.yaml
2+
node_modules
3+
.next

README.md

+31-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
1+
This is a [Next.js](https://nextjs.org/) project bootstrapped
2+
with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
23

34
## Getting Started
45

@@ -16,19 +17,39 @@ Open [http://localhost:3000](http://localhost:3000) with your browser to see the
1617

1718
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
1819

19-
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
20+
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and
21+
load Inter, a custom Google Font.
2022

21-
## Learn More
23+
## Deploy
2224

23-
To learn more about Next.js, take a look at the following resources:
25+
### Automatic Testing Environment Deployment
2426

25-
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
26-
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
27+
We have set up an automated deployment process for the testing environment. When code is merged into either the `main`
28+
or `develop` branch, the system automatically deploys the changes to the testing environment. You can find the
29+
deployment workflow configuration in `.github/workflows/deploy_dev.yml`.
2730

28-
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
31+
### Manual Production Environment Deployment
2932

30-
## Deploy on Vercel
33+
To deploy changes to the production environment, follow these steps:
3134

32-
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
35+
1. Visit the project's GitHub page.
36+
2. Navigate to the "Actions" tab.
37+
3. Click on "Manual Deploy to Production."
38+
4. Select "Run workflow" to initiate a manual deployment to the production environment.
3339

34-
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
40+
## Testing
41+
42+
Our testing framework of choice is Cypress. Comprehensive testing information will be provided in this section as the
43+
project progresses.
44+
45+
```bash
46+
pnpm run build
47+
pnpm run start
48+
49+
pnpm run test
50+
# or
51+
pnpm run test:headless
52+
```
53+
54+
Feel free to update this README with more details as the project evolves. If you have any questions or need further
55+
assistance, please don't hesitate to reach out. Happy coding!

0 commit comments

Comments
 (0)