├── .firebase
└── hosting.YnVpbGQ.cache
├── .firebaserc
├── .github
├── ISSUE_TEMPLATE.md
└── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
├── .gitignore
├── .snyk
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── PULL_REQUEST_TEMPLATE.md
├── README.cn.md
├── README.md
├── _config.yml
├── book.json
├── codecov.yml
├── docs
├── README.md
├── SUMMARY.md
├── _config.yml
├── app
│ ├── configure
│ │ ├── development.env
│ │ └── production.env
│ ├── firestore.png
│ ├── firestore2.png
│ ├── layer-1.png
│ ├── layer-2.png
│ ├── layer-3.png
│ ├── layer-4.png
│ ├── layer-5.png
│ ├── layer-6.png
│ ├── layer.png
│ ├── logo.png
│ └── multi-device.png
├── layers.md
├── layers
│ ├── actions.md
│ ├── api.md
│ ├── components.md
│ ├── constants.md
│ ├── reducers.md
│ ├── store.md
│ └── tests.md
└── motivation.md
├── firebase.json
├── index.d.ts
├── package-lock.json
├── package.json
├── public
├── favicon.ico
├── images
│ └── flags.png
└── index.html
├── server.js
├── src
├── api
│ ├── CommentAPI.ts
│ ├── CommonAPI.ts
│ ├── FileAPI.ts
│ ├── PostAPI.ts
│ └── StringAPI.ts
├── assets
│ ├── fonts
│ │ ├── Flaticon.eot
│ │ ├── Flaticon.ttf
│ │ └── Flaticon.woff
│ └── images
│ │ └── Flaticon.svg
├── components
│ ├── circle
│ │ ├── CircleComponent.tsx
│ │ ├── ICircleComponentProps.ts
│ │ ├── ICircleComponentState.ts
│ │ └── index.ts
│ ├── comment
│ │ ├── CommentComponent.tsx
│ │ ├── ICommentComponentProps.ts
│ │ ├── ICommentComponentState.ts
│ │ └── index.ts
│ ├── commentGroup
│ │ ├── CommentGroupComponent.tsx
│ │ ├── ICommentGroupComponentProps.ts
│ │ ├── ICommentGroupComponentState.ts
│ │ └── index.ts
│ ├── commentList
│ │ ├── CommentListComponent.tsx
│ │ ├── ICommentListComponentProps.ts
│ │ ├── ICommentListComponentState.ts
│ │ └── index.ts
│ ├── editProfile
│ │ ├── EditProfileComponent.tsx
│ │ ├── IEditProfileComponentProps.ts
│ │ ├── IEditProfileComponentState.ts
│ │ └── index.ts
│ ├── findPeople
│ │ ├── FindPeopleComponent.tsx
│ │ ├── IFindPeopleComponentProps.ts
│ │ ├── IFindPeopleComponentState.ts
│ │ └── index.ts
│ ├── followers
│ │ ├── FollowersComponent.tsx
│ │ ├── IFollowersComponentProps.ts
│ │ ├── IFollowersComponentState.ts
│ │ └── index.ts
│ ├── following
│ │ ├── FollowingComponent.tsx
│ │ ├── IFollowingComponentProps.ts
│ │ ├── IFollowingComponentState.ts
│ │ └── index.ts
│ ├── homeHeader
│ │ ├── HomeHeaderComponent.tsx
│ │ ├── IHomeHeaderComponentProps.ts
│ │ ├── IHomeHeaderComponentState.ts
│ │ └── index.ts
│ ├── imageGallery
│ │ ├── IImageGalleryComponentProps.ts
│ │ ├── IImageGalleryComponentState.ts
│ │ ├── ImageGalleryComponent.tsx
│ │ └── index.ts
│ ├── img
│ │ ├── IImgComponentProps.ts
│ │ ├── IImgComponentState.ts
│ │ ├── ImgComponent.tsx
│ │ └── index.ts
│ ├── imgCover
│ │ ├── IImgCoverComponentProps.ts
│ │ ├── IImgCoverComponentState.ts
│ │ ├── ImgCoverComponent.tsx
│ │ └── index.ts
│ ├── masterLoading
│ │ ├── IMasterLoadingComponentProps.ts
│ │ ├── IMasterLoadingComponentState.ts
│ │ ├── MasterLoadingComponent.tsx
│ │ └── index.ts
│ ├── notify
│ │ ├── INotifyComponentProps.ts
│ │ ├── INotifyComponentState.ts
│ │ ├── NotifyComponent.tsx
│ │ └── index.ts
│ ├── notifyItem
│ │ ├── INotifyItemComponentProps.ts
│ │ ├── INotifyItemComponentState.ts
│ │ ├── NotifyItemComponent.tsx
│ │ └── index.ts
│ ├── post
│ │ ├── IPostComponentProps.ts
│ │ ├── IPostComponentState.ts
│ │ ├── PostComponent.tsx
│ │ └── index.ts
│ ├── postWrite
│ │ ├── IPostWriteComponentProps.ts
│ │ ├── IPostWriteComponentState.ts
│ │ ├── PostWriteComponent.tsx
│ │ └── index.ts
│ ├── profileHeader
│ │ ├── IProfileHeaderComponentProps.ts
│ │ ├── IProfileHeaderComponentState.ts
│ │ ├── ProfileHeaderComponent.tsx
│ │ └── index.ts
│ ├── sendFeedback
│ │ ├── ISendFeedbackComponentProps.ts
│ │ ├── ISendFeedbackComponentState.ts
│ │ ├── SendFeedbackComponent.tsx
│ │ └── index.ts
│ ├── shareDialog
│ │ ├── IShareDialogComponentProps.ts
│ │ ├── IShareDialogComponentState.ts
│ │ ├── ShareDialogComponent.tsx
│ │ └── index.ts
│ ├── sidebar
│ │ ├── ISidebarComponentProps.ts
│ │ ├── ISidebarComponentState.ts
│ │ ├── SidebarComponent.tsx
│ │ └── index.ts
│ ├── sidebarContent
│ │ ├── ISidebarContentComponentProps.ts
│ │ ├── ISidebarContentComponentState.ts
│ │ ├── SidebarContentComponent.tsx
│ │ └── index.ts
│ ├── sidebarMain
│ │ ├── ISidebarMainComponentProps.ts
│ │ ├── ISidebarMainComponentState.ts
│ │ ├── SidebarMainComponent.tsx
│ │ └── index.ts
│ ├── userAvatar
│ │ ├── IUserAvatarComponentProps.ts
│ │ ├── IUserAvatarComponentState.ts
│ │ ├── UserAvatarComponent.tsx
│ │ └── index.ts
│ ├── userBox
│ │ ├── IUserBoxComponentProps.ts
│ │ ├── IUserBoxComponentState.ts
│ │ ├── UserBoxComponent.tsx
│ │ └── index.ts
│ ├── userBoxList
│ │ ├── IUserBoxListComponentProps.ts
│ │ ├── IUserBoxListComponentState.ts
│ │ ├── UserBoxListComponent.tsx
│ │ └── index.ts
│ └── yourCircles
│ │ ├── IYourCirclesComponentProps.ts
│ │ ├── IYourCirclesComponentState.ts
│ │ ├── YourCirclesComponent.tsx
│ │ └── index.ts
├── config
│ ├── environment.dev.ts
│ ├── environment.prod.ts
│ └── index.ts
├── constants
│ ├── authorizeActionType.ts
│ ├── circleActionType.ts
│ ├── commentActionType.ts
│ ├── globalActionType.ts
│ ├── imageGalleryActionType.ts
│ ├── notificationActionType.ts
│ ├── postActionType.ts
│ ├── serverActionType.ts
│ ├── serverRequestType.ts
│ ├── userActionType.ts
│ └── voteActionType.ts
├── containers
│ ├── emailVerification
│ │ ├── EmailVerificationComponent.tsx
│ │ ├── IEmailVerificationComponentProps.ts
│ │ ├── IEmailVerificationComponentState.ts
│ │ └── index.ts
│ ├── home
│ │ ├── HomeComponent.tsx
│ │ ├── IHomeComponentProps.ts
│ │ ├── IHomeComponentState.ts
│ │ └── index.ts
│ ├── login
│ │ ├── ILoginComponentProps.ts
│ │ ├── ILoginComponentState.ts
│ │ ├── LoginComponent.tsx
│ │ └── index.ts
│ ├── master
│ │ ├── IMasterComponentProps.ts
│ │ ├── IMasterComponentState.ts
│ │ ├── MasterComponent.tsx
│ │ └── index.ts
│ ├── people
│ │ ├── IPeopleComponentProps.ts
│ │ ├── IPeopleComponentState.ts
│ │ ├── PeopleComponent.tsx
│ │ └── index.ts
│ ├── postPage
│ │ ├── IPostPageComponentProps.ts
│ │ ├── IPostPageComponentState.ts
│ │ ├── PostPageComponent.tsx
│ │ └── index.ts
│ ├── profile
│ │ ├── IProfileComponentProps.ts
│ │ ├── IProfileComponentState.ts
│ │ ├── ProfileComponent.tsx
│ │ ├── dialogTitle
│ │ │ ├── DialogTitleComponent.tsx
│ │ │ ├── IDialogTitleComponentProps.ts
│ │ │ ├── IDialogTitleComponentState.ts
│ │ │ └── index.ts
│ │ └── index.ts
│ ├── resetPassword
│ │ ├── IResetPasswordComponentProps.ts
│ │ ├── IResetPasswordComponentState.ts
│ │ ├── ResetPasswordComponent.tsx
│ │ └── index.ts
│ ├── setting
│ │ ├── ISettingComponentProps.ts
│ │ ├── ISettingComponentState.ts
│ │ ├── SettingComponent.tsx
│ │ └── index.ts
│ ├── signup
│ │ ├── ISignupComponentProps.ts
│ │ ├── ISignupComponentState.ts
│ │ ├── SignupComponent.tsx
│ │ └── index.ts
│ └── stream
│ │ ├── IStreamComponentProps.ts
│ │ ├── IStreamComponentState.ts
│ │ ├── StreamComponent.tsx
│ │ └── index.ts
├── core
│ ├── domain
│ │ ├── authorize
│ │ │ ├── index.ts
│ │ │ ├── loginUser.ts
│ │ │ ├── oauthType.ts
│ │ │ └── registerUserResult.ts
│ │ ├── circles
│ │ │ ├── circle.ts
│ │ │ ├── index.ts
│ │ │ └── userTie.ts
│ │ ├── comments
│ │ │ ├── comment.ts
│ │ │ └── index.ts
│ │ ├── common
│ │ │ ├── baseDomain.ts
│ │ │ ├── feed.ts
│ │ │ ├── feedType.ts
│ │ │ ├── index.ts
│ │ │ └── socialError.ts
│ │ ├── graphs
│ │ │ ├── graph.ts
│ │ │ └── index.ts
│ │ ├── imageGallery
│ │ │ ├── image.ts
│ │ │ └── index.ts
│ │ ├── notifications
│ │ │ ├── index.ts
│ │ │ └── notification.ts
│ │ ├── posts
│ │ │ ├── index.ts
│ │ │ └── post.ts
│ │ ├── users
│ │ │ ├── index.ts
│ │ │ ├── profile.ts
│ │ │ ├── user.ts
│ │ │ └── userProvider.ts
│ │ └── votes
│ │ │ ├── index.ts
│ │ │ └── vote.ts
│ ├── environment.ts
│ ├── factories
│ │ ├── IServiceProvider.ts
│ │ ├── index.ts
│ │ └── serviceProvide.ts
│ ├── services
│ │ ├── authorize
│ │ │ ├── IAuthorizeService.ts
│ │ │ └── index.ts
│ │ ├── circles
│ │ │ ├── ICircleService.ts
│ │ │ ├── IUserTieService.ts
│ │ │ └── index.ts
│ │ ├── comments
│ │ │ ├── ICommentService.ts
│ │ │ └── index.ts
│ │ ├── common
│ │ │ ├── ICommonService.ts
│ │ │ └── index.ts
│ │ ├── files
│ │ │ ├── IStorageService.ts
│ │ │ └── index.ts
│ │ ├── imageGallery
│ │ │ ├── IImageGalleryService.ts
│ │ │ └── index.ts
│ │ ├── index.ts
│ │ ├── notifications
│ │ │ ├── INotificationService.ts
│ │ │ └── index.ts
│ │ ├── posts
│ │ │ ├── IPostService.ts
│ │ │ └── index.ts
│ │ ├── users
│ │ │ ├── IUserService.ts
│ │ │ └── index.ts
│ │ └── votes
│ │ │ ├── IVoteService.ts
│ │ │ └── index.ts
│ └── socialProviderTypes.ts
├── data
│ └── firestoreClient
│ │ ├── dependecyRegisterar.ts
│ │ ├── firestoreClientTypes.ts
│ │ ├── index.ts
│ │ └── services
│ │ ├── authorize
│ │ ├── AuthorizeService.ts
│ │ └── index.ts
│ │ ├── circles
│ │ ├── CircleService.ts
│ │ ├── UserTieService.ts
│ │ └── index.ts
│ │ ├── comments
│ │ ├── CommentService.ts
│ │ └── index.ts
│ │ ├── common
│ │ ├── CommonService.ts
│ │ └── index.ts
│ │ ├── files
│ │ ├── StorageService.ts
│ │ └── index.ts
│ │ ├── graphs
│ │ ├── GraphService.ts
│ │ ├── IGraphService.ts
│ │ └── index.ts
│ │ ├── imageGallery
│ │ ├── ImageGalleryService.ts
│ │ └── index.ts
│ │ ├── index.ts
│ │ ├── notifications
│ │ ├── index.ts
│ │ └── notificationService.ts
│ │ ├── posts
│ │ ├── PostService.ts
│ │ └── index.ts
│ │ ├── users
│ │ ├── UserService.ts
│ │ └── index.ts
│ │ └── votes
│ │ ├── VoteService.ts
│ │ └── index.ts
├── index.tsx
├── layouts
│ ├── appInput
│ │ ├── AppInputComponent.tsx
│ │ ├── IAppInputComponentProps.ts
│ │ ├── IAppInputComponentState.ts
│ │ └── index.ts
│ ├── dialogTitle
│ │ ├── DialogTitleComponent.tsx
│ │ ├── IDialogTitleComponentProps.ts
│ │ ├── IDialogTitleComponentState.ts
│ │ └── index.ts
│ ├── iconButtonElement
│ │ ├── IconButtonElementComponent.tsx
│ │ └── index.ts
│ └── loadMoreProgress
│ │ ├── LoadMoreProgressComponent.tsx
│ │ └── index.ts
├── locale
│ ├── ch.json
│ ├── en.json
│ └── es.json
├── models
│ ├── comments
│ │ └── commentTypes.ts
│ ├── files
│ │ ├── fileResult.ts
│ │ └── index.ts
│ ├── server
│ │ ├── index.ts
│ │ └── serverRequestModel.ts
│ └── users
│ │ ├── index.ts
│ │ └── userRegisterModel.ts
├── registerServiceWorker.js
├── registerServiceWorker.ts
├── routes
│ ├── HomeRouter.tsx
│ ├── IRoute.ts
│ ├── IRouterProps.ts
│ ├── MasterRouter.tsx
│ ├── PrivateRoute.tsx
│ ├── PublicRoute.tsx
│ └── index.ts
├── socialEngine.ts
├── store
│ ├── actions
│ │ ├── authorizeActions.ts
│ │ ├── circleActions.ts
│ │ ├── commentActions.ts
│ │ ├── globalActions.ts
│ │ ├── imageGalleryActions.ts
│ │ ├── index.ts
│ │ ├── localeActions.ts
│ │ ├── notifyActions.ts
│ │ ├── postActions.ts
│ │ ├── serverActions.ts
│ │ ├── serverRequestStatusType.ts
│ │ ├── userActions.ts
│ │ └── voteActions.ts
│ ├── configureStore.dev.ts
│ ├── configureStore.prod.ts
│ ├── configureStore.ts
│ ├── devTools.tsx
│ ├── reducers
│ │ ├── authorize
│ │ │ ├── AuthorizeState.ts
│ │ │ ├── IAuthorizeAction.ts
│ │ │ ├── authorizeReducer.ts
│ │ │ ├── authorizeSelector.ts
│ │ │ └── index.ts
│ │ ├── circles
│ │ │ ├── CircleState.ts
│ │ │ ├── ICircleAction.ts
│ │ │ ├── circleReducer.ts
│ │ │ └── index.ts
│ │ ├── comments
│ │ │ ├── CommentState.ts
│ │ │ ├── ICommentAction.ts
│ │ │ ├── commentReducer.ts
│ │ │ └── index.ts
│ │ ├── global
│ │ │ ├── GlobalState.ts
│ │ │ ├── IGlobalAction.ts
│ │ │ ├── globalReducer.ts
│ │ │ └── index.ts
│ │ ├── imageGallery
│ │ │ ├── IImageGalleryAction.ts
│ │ │ ├── ImageGalleryState.ts
│ │ │ ├── imageGalleryReducer.ts
│ │ │ └── index.ts
│ │ ├── index.ts
│ │ ├── locale
│ │ │ └── langugeType.ts
│ │ ├── notifications
│ │ │ ├── INotificationAction.ts
│ │ │ ├── NotificationState.ts
│ │ │ ├── index.ts
│ │ │ └── notificationReducer.ts
│ │ ├── posts
│ │ │ ├── IPostAction.ts
│ │ │ ├── PostState.ts
│ │ │ ├── index.ts
│ │ │ ├── postReducer.ts
│ │ │ └── postSelector.ts
│ │ ├── rootReducer.ts
│ │ ├── server
│ │ │ ├── IServerAction.ts
│ │ │ ├── ServerState.ts
│ │ │ ├── index.ts
│ │ │ └── serverReducer.ts
│ │ ├── users
│ │ │ ├── IUserAction.ts
│ │ │ ├── UserState.ts
│ │ │ ├── index.ts
│ │ │ └── userReducer.ts
│ │ └── votes
│ │ │ ├── IVoteAction.ts
│ │ │ ├── VoteState.ts
│ │ │ ├── index.ts
│ │ │ └── voteReducer.ts
│ └── sagas
│ │ ├── commentSaga.ts
│ │ ├── localeSaga.ts
│ │ └── rootSaga.ts
├── styles
│ ├── app.css
│ ├── app.scss
│ ├── base
│ │ ├── _animate.scss
│ │ ├── _flaticon.scss
│ │ ├── _grid.scss
│ │ ├── _icon.scss
│ │ └── _variables.scss
│ └── components
│ │ ├── _blog.scss
│ │ ├── _comment.scss
│ │ ├── _global.scss
│ │ ├── _home.scss
│ │ ├── _homeHeader.scss
│ │ ├── _imageGallery.scss
│ │ ├── _login.scss
│ │ ├── _master.scss
│ │ ├── _masterLoading.scss
│ │ ├── _people.scss
│ │ ├── _post.scss
│ │ ├── _postWrite.scss
│ │ ├── _profile.scss
│ │ ├── _sendFeedback.scss
│ │ ├── _settings.scss
│ │ ├── _sidebar.scss
│ │ ├── _signup.scss
│ │ └── _userBox.scss
├── tests
│ └── app.test.ts
└── typings
│ ├── react-day-picker.d.ts
│ ├── react-linkif.d.ts
│ ├── react-loadable.d.ts
│ ├── react-parallax.ts
│ ├── react-share.ts
│ └── react-string-replace.d.ts
├── tsconfig.json
├── tsconfig.prod.json
└── tslint.json
/.firebaserc:
--------------------------------------------------------------------------------
1 | {
2 | "projects": {
3 | "default": "test-4515a"
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
2 | ### Steps
3 |
4 | ### Expected Result
5 |
6 | ### Actual Result
7 |
8 | ### Version
9 | x.y.z
10 |
11 | ### Testcase
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 |
5 | ---
6 |
7 | **Describe the bug**
8 | A clear and concise description of what the bug is.
9 |
10 | **To Reproduce**
11 | Steps to reproduce the behavior:
12 | 1. Go to '...'
13 | 2. Click on '....'
14 | 3. Scroll down to '....'
15 | 4. See error
16 |
17 | **Expected behavior**
18 | A clear and concise description of what you expected to happen.
19 |
20 | **Screenshots**
21 | If applicable, add screenshots to help explain your problem.
22 |
23 | **Desktop (please complete the following information):**
24 | - OS: [e.g. iOS]
25 | - Browser [e.g. chrome, safari]
26 | - Version [e.g. 22]
27 |
28 | **Smartphone (please complete the following information):**
29 | - Device: [e.g. iPhone6]
30 | - OS: [e.g. iOS8.1]
31 | - Browser [e.g. stock browser, safari]
32 | - Version [e.g. 22]
33 |
34 | **Additional context**
35 | Add any other context about the problem here.
36 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 |
5 | ---
6 |
7 | **Is your feature request related to a problem? Please describe.**
8 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9 |
10 | **Describe the solution you'd like**
11 | A clear and concise description of what you want to happen.
12 |
13 | **Describe alternatives you've considered**
14 | A clear and concise description of any alternative solutions or features you've considered.
15 |
16 | **Additional context**
17 | Add any other context or screenshots about the feature request here.
18 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 |
6 | # testing
7 | /coverage
8 |
9 | # production
10 | /build
11 |
12 | # misc
13 | .DS_Store
14 | .env.local
15 | .env.development.local
16 | .env.test.local
17 | .env.production.local
18 |
19 | npm-debug.log*
20 | yarn-debug.log*
21 | yarn-error.log*
22 |
23 | .vscode/
24 | src/data/awsClient
25 | src/components/AWS.tsx
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Amir Movahedi
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ### Your checklist for this pull request
2 | 🚨Please review the [guidelines for contributing](../CONTRIBUTING.md) to this repository.
3 |
4 | - [ ] Make sure you are requesting to **pull a topic/feature/bugfix branch** (right side). Don't request your master!
5 | - [ ] Make sure you are making a pull request against the **canary branch** (left side). Also you should start *your branch* off *our canary*.
6 | - [ ] Check the commit's or even all commits' message styles matches our requested structure.
7 | - [ ] Check your code additions will fail neither code linting checks nor unit test.
8 |
9 | ### Description
10 | Please describe your pull request.
11 |
12 | 💔Thank you!
13 |
--------------------------------------------------------------------------------
/README.cn.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | React Social Network :rocket: Version NEXT! :rocket:
10 |
11 |
12 | [](https://gitter.im/react-social-network/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
13 |
14 | React Social Network是一个open source 项目,利用React强大的javascript库来构建用户界面。在这个项目中,我用社交网络为个例子来显示 react/react components 的一些试功能。这个项目的结构使帮助 开发人员能够根据自己的想法和环境发展他们自己项目。
15 |
16 |
17 |
18 |
19 |
20 |
21 | ## 🌟新升级
22 | React Social Network正在发展基于redux-saga,但我们在 v0.5分支中保留了React Social Network的redux-thunk版本。 ❤️我们非常感谢任何贡献。
23 |
24 | > 有关更多信息,请参阅CHANGELOG及相关问题
25 |
26 | 这个项目遵守“贡献者公约”行为准则。通过参与,您应该支持此代码。请向amir.gholzam@live.com报告不可接受的行为。
27 |
28 | ## 在开始之前
29 | 首先,这是一个React社交网络模板,其目的是找到通过React找到社交网络等大型项目的最佳方式。我们已经了解一些技术和算法对我们项目可以带来更好解决方案。请用这些想法来实现这个项目,如果你觉得你有更好的解决方案,我们非常高兴和感谢你的贡献。
30 |
31 | - 您是React的新手,你正在寻找一些想法,用一些基本的东西来启动React项目。您也是React Semantic UI的粉丝。我建议您从React Blog Project开始。
32 |
33 |
34 | - 您是具有React基础知识(在React Blog Project中提供)的您.您是社交网络项目,Material-UI的粉丝。你是喜欢JS / JSX的人。我建议您试试js-react-social-tutorial项目。
35 |
36 |
37 | - 你是纯Redux的粉丝,redux-thunk,TypeScript,InversifyJS IOC container,你对js-react-social-tutorial中的东西有足够的了解。React社交网络版本0.5.0分支可能是您
38 | 要找到的地方。
39 |
40 |
41 | - 你处于React的高手,你喜欢学习有关React的高级技术,比如Async Component / Lazy loading,redux-saga和其他超酷的东西,我们很高兴你到达这里。我们继续前进
42 |
43 | ## 例子
44 | [Love Open Social](https://love-social.firebaseapp.com)
45 |
46 | ## 所需的知识
47 |
48 | 我建议您在使用React Social Network之前了解React。 React社交网络由React components 构建,因此了解React如何适应Web发展非常重要。
49 |
50 | (如果您不熟悉Single Page Applications(SPA)的概念,请在阅读之前先到此处进行快速介绍。
51 |
52 | ## 中文的支持 🇨🇳🌏
53 | - [梁国辉](https://github.com/HuyQLuong)
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-cayman
2 | markdown: kramdown
--------------------------------------------------------------------------------
/book.json:
--------------------------------------------------------------------------------
1 | {
2 | "root": "./docs",
3 | "plugins": [ "theme-api" ],
4 | "pluginsConfig": {
5 | "theme-api": {
6 | "languages": [
7 | {
8 | "lang": "js",
9 | "name": "JavaScript",
10 | "default": true
11 | }
12 | ]
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/codecov.yml:
--------------------------------------------------------------------------------
1 | coverage:
2 | status:
3 | patch:
4 | default:
5 | threshold: 0.0%
6 | comment: false
7 |
--------------------------------------------------------------------------------
/docs/SUMMARY.md:
--------------------------------------------------------------------------------
1 | # Summary
2 |
3 | * [Readme](README.md)
4 | * [Motivation](motivation.md)
5 |
6 | ## Layers
7 |
8 | * [Overview](layers.md)
9 | * [Components](layers/components.md)
10 | * [API](layers/api.md)
11 | * [Actions](layers/actions.md)
12 | * [Reducers](layers/reducers.md)
13 | * [Store](layers/store.md)
14 | * [Constants](layers/constants.md)
15 | * [Tests](layers/tests.md)
16 |
--------------------------------------------------------------------------------
/docs/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-slate
--------------------------------------------------------------------------------
/docs/app/configure/development.env:
--------------------------------------------------------------------------------
1 | API_KEY=AIzsdfyDi-7MRiJNqGsdfg7WXuTyqsdMtpRjRFhOwD8
2 | AUTH_DOMAIN=test-6bdc1.firebaseapp.com
3 | DATABASE_URL=https://test-6bdc1.firebaseio.com
4 | PROJECT_ID=test-6bdc1
5 | STORAGE_BUCKET=test-6bdc1.appspot.com
6 | MESSAGING_SENDER_ID=416549341075
7 | PORT= 4000
--------------------------------------------------------------------------------
/docs/app/configure/production.env:
--------------------------------------------------------------------------------
1 | API_KEY=[API_KEY]
2 | AUTH_DOMAIN=[PROJECT_ID].firebaseapp.com
3 | DATABASE_URL=https://[DATABASE_NAME].firebaseio.com
4 | PROJECT_ID=[PROJECT_ID]
5 | STORAGE_BUCKET=[BUCKET].appspot.com
6 | MESSAGING_SENDER_ID=[SENDER_ID]HOST_URL
7 |
--------------------------------------------------------------------------------
/docs/app/firestore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/red-gold/react-social-network/04e0f4dcfb8fec1c1a4c18efb5ae02b5679f8451/docs/app/firestore.png
--------------------------------------------------------------------------------
/docs/app/firestore2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/red-gold/react-social-network/04e0f4dcfb8fec1c1a4c18efb5ae02b5679f8451/docs/app/firestore2.png
--------------------------------------------------------------------------------
/docs/app/layer-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/red-gold/react-social-network/04e0f4dcfb8fec1c1a4c18efb5ae02b5679f8451/docs/app/layer-1.png
--------------------------------------------------------------------------------
/docs/app/layer-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/red-gold/react-social-network/04e0f4dcfb8fec1c1a4c18efb5ae02b5679f8451/docs/app/layer-2.png
--------------------------------------------------------------------------------
/docs/app/layer-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/red-gold/react-social-network/04e0f4dcfb8fec1c1a4c18efb5ae02b5679f8451/docs/app/layer-3.png
--------------------------------------------------------------------------------
/docs/app/layer-4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/red-gold/react-social-network/04e0f4dcfb8fec1c1a4c18efb5ae02b5679f8451/docs/app/layer-4.png
--------------------------------------------------------------------------------
/docs/app/layer-5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/red-gold/react-social-network/04e0f4dcfb8fec1c1a4c18efb5ae02b5679f8451/docs/app/layer-5.png
--------------------------------------------------------------------------------
/docs/app/layer-6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/red-gold/react-social-network/04e0f4dcfb8fec1c1a4c18efb5ae02b5679f8451/docs/app/layer-6.png
--------------------------------------------------------------------------------
/docs/app/layer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/red-gold/react-social-network/04e0f4dcfb8fec1c1a4c18efb5ae02b5679f8451/docs/app/layer.png
--------------------------------------------------------------------------------
/docs/app/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/red-gold/react-social-network/04e0f4dcfb8fec1c1a4c18efb5ae02b5679f8451/docs/app/logo.png
--------------------------------------------------------------------------------
/docs/app/multi-device.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/red-gold/react-social-network/04e0f4dcfb8fec1c1a4c18efb5ae02b5679f8451/docs/app/multi-device.png
--------------------------------------------------------------------------------
/docs/layers.md:
--------------------------------------------------------------------------------
1 | # Layers
2 |
3 |
4 |
5 | ## Supporting multiple data platforms.
6 | With dependency injection and new structure we have tried to support variety of data platforms such as Google Cloud Firebase, AWS, Azure or using backend such as ASP.NET, PHP, JAVA, etc.
7 |
8 |
9 |
10 | ## Easy and fast to scale in structure
11 | Layers are organized in the way we have easy and less changes for adding/removing features. It could be integrated with server side too. As a result we are faster in developing in both side.
12 | ### Core
13 | - The infrastructure,
14 | - Providing interfaces for services
15 | - Domain
16 | ### Data
17 | * Firebase Data Client
18 | * AWS Data Client
19 | * Azure Data Client
20 | * ASP.NET Data Client
21 | * PHP Data Client
22 | ### Components
23 |
24 |
25 | ## Integrating and reusability in both mobile and web app
26 | With new structure we are able to develop the mobile app in parallel with web app **only** with changing `Components` layer. It means we can keep `Core`, `Data` layers, `Actions`, `Reducers`, etc. What we have high reusability and fast in producing the products.
27 |
28 |
29 |
--------------------------------------------------------------------------------
/docs/layers/api.md:
--------------------------------------------------------------------------------
1 | # API
2 |
3 | Is a decoupled layer of interfaces to data and/or functionality of one or more components.
4 |
--------------------------------------------------------------------------------
/docs/layers/components.md:
--------------------------------------------------------------------------------
1 | # Components
2 |
3 | This layer include [React components](https://facebook.github.io/react/docs/react-component.html) that let you split the UI into independent, reusable pieces, and think about each piece in isolation.
4 |
--------------------------------------------------------------------------------
/docs/layers/constants.md:
--------------------------------------------------------------------------------
1 | # Constatnts
2 |
3 | This layer is responsible for setting constant virables, such as action type names for redux actions. Actions must have a type property that indicates the type of action being performed. Types should typically be defined as string constants.
4 |
--------------------------------------------------------------------------------
/docs/layers/reducers.md:
--------------------------------------------------------------------------------
1 | # Reducers
2 |
3 | This layer is included reducers of entities. [Reducers](http://redux.js.org/docs/basics/Reducers.html) specify how the application's state changes in response.
4 |
5 | ## authorizeReducer
6 |
7 | This reducer is responsible to change user authorization state on reducer.
8 |
9 | ## circleReducer
10 |
11 | This reducer is responsible to change user's circle state on reducer, insert/update/delete circle and insert/update/delete follower/following.
12 |
13 | ## commentReducer
14 |
15 | This reducer is responsible to change user comment state on reducer, insert/update/delete comment.
16 |
17 | ## fileReducer
18 |
19 | This reducer is responsible to change files state on reducer.
20 |
21 | ## globalReducer
22 |
23 | This reducer is responsible to change global states on reducer. Like changing loding visibility or notification text.
24 |
25 | ## imageGalleryReducer
26 |
27 | This reducer is responsible to change images state on reducer, insert/update/delete image and cache image's url.
28 |
29 | ## imageUploaderReducer
30 |
31 | This reducer is responsible to change user upload state on reducer.
32 |
33 | ## notifyReducer
34 |
35 | This reducer is responsible to change user notification state on reducer, insert/update/delete notificaion and change seen state for notification.
36 |
37 | ## postReducer
38 |
39 | This reducer is responsible to change user post state on reducer, insert/update/delete post.
40 |
41 | ## userReducer
42 |
43 | This reducer is responsible to change user information state on reducer, insert/update/delete user information.
44 |
45 | ## voteReducer
46 |
47 | This reducer is responsible to change user vote state on reducer. insert/update/delete vote.
--------------------------------------------------------------------------------
/docs/layers/store.md:
--------------------------------------------------------------------------------
1 | # Store
2 |
3 | This layer is responsible for configuring of redux store, such as setting reducers and midelwares. A [store](http://redux.js.org/docs/api/Store.html) holds the whole state tree of your application.
4 |
--------------------------------------------------------------------------------
/docs/layers/tests.md:
--------------------------------------------------------------------------------
1 | # Tests
2 |
3 | This layer is responsible to test each layer of application. Each test file name follow `[file-name].test.jsx` pattern for naming. We use [expect](https://github.com/mjackson/expect) to write assertion for each test case. We use [Karma](https://karma-runner.github.io/1.0/index.html) to run our tests. We use [Mocha](https://mochajs.org/) which tests run serially, allowing for flexible and accurate reporting, while mapping uncaught exceptions to the correct test cases.
4 |
5 | ## Test Actions
6 |
7 | ## Test Reducers
8 |
9 | ## Test Components
10 |
11 | ## Test API
--------------------------------------------------------------------------------
/docs/motivation.md:
--------------------------------------------------------------------------------
1 | # Motivation
2 |
3 | In this project we follow [loosely coupled](https://en.wikipedia.org/wiki/Loose_coupling) system principle with the idea each part of this project be independent from others. For example if you want to use [frontend](https://en.wikipedia.org/wiki/Front_and_back_ends) you are not depend on [backend](https://en.wikipedia.org/wiki/Front_and_back_ends) as you can use Firbase so easy which we have provided in this project. You also can use any kind of backend such as php, python, javascript and etc, completely independent of frontend or you can use [ASP.NET Core 2](https://docs.microsoft.com/en-us/dotnet/core/) backend that we provided in this project.
4 | As my target in this project, I've intended to build a social network with features of new and powerful web technologies such as [React](https://facebook.github.io/react/) as a front-end tool in [React Social Network](https://github.com/Qolzam/react-social-network) project and build a powerful backend by [ASP.NET Core 2](https://docs.microsoft.com/en-us/dotnet/core/) with its cool new features in [ASP.NET Core Social Network](https://github.com/Qolzam/aspnet-core-social-network). I also use [React Native](https://facebook.github.io/react-native/) to build a powerful mobile social app in [React Mobile Social](https://github.com/Qolzam/react-mobile-social). All cool new features are providing as an open source project under MIT LICENSE and it's so great ;).
--------------------------------------------------------------------------------
/firebase.json:
--------------------------------------------------------------------------------
1 | {
2 | "hosting": {
3 | "public": "build",
4 | "headers": [
5 | {
6 | "source": "**/*.@(eot|otf|ttf|ttc|woff|font.css)",
7 | "headers": [
8 | {
9 | "key": "Access-Control-Allow-Origin",
10 | "value": "*"
11 | }
12 | ]
13 | },
14 | {
15 | "source": "**/*.@(jpg|jpeg|gif|png)",
16 | "headers": [
17 | {
18 | "key": "Cache-Control",
19 | "value": "max-age=7200"
20 | }
21 | ]
22 | },
23 | {
24 | "source": "**/*.js",
25 | "headers": [
26 | {
27 | "key": "Cache-Control",
28 | "value": "no-cache"
29 | }
30 | ]
31 | }
32 | ],
33 | "rewrites": [
34 | {
35 | "source": "/favicon.ico",
36 | "destination": "/favicon.ico"
37 | },
38 | {
39 | "source": "**",
40 | "destination": "/index.html"
41 | }
42 | ]
43 | }
44 | }
--------------------------------------------------------------------------------
/index.d.ts:
--------------------------------------------------------------------------------
1 | declare module 'redux-offline'
2 | declare module 'redux-offline/lib/defaults'
3 | declare module 'redux-offline-immutable-config'
4 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/red-gold/react-social-network/04e0f4dcfb8fec1c1a4c18efb5ae02b5679f8451/public/favicon.ico
--------------------------------------------------------------------------------
/public/images/flags.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/red-gold/react-social-network/04e0f4dcfb8fec1c1a4c18efb5ae02b5679f8451/public/images/flags.png
--------------------------------------------------------------------------------
/server.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var morgan = require('morgan');
3 | var path = require('path');
4 | var webpack = require('webpack');
5 | var webpackConfig = require('./webpack.config');
6 | var compiler = webpack(webpackConfig);
7 |
8 | // Create our app
9 | var app = express();
10 | const PORT = process.env.PORT || 3000;
11 |
12 | // Setup logger
13 | app.use(morgan(':remote-addr - :remote-user [:date[clf]] ":method :url HTTP/:http-version" :status :res[content-length] :response-time ms'));
14 |
15 |
16 | app.use(require("webpack-dev-middleware")(compiler, {
17 | noInfo: true,
18 | publicPath: webpackConfig.output.publicPath
19 | }));
20 |
21 | app.use(require("webpack-hot-middleware")(compiler));
22 |
23 | app.use(function(req, res, next) {
24 | if (req.headers['x-forwarded-proto'] === 'https') {
25 | res.redirect('http://' + req.hostname + req.url);
26 | } else {
27 | next();
28 | }
29 | });
30 |
31 | app.use(function(req, res, next) {
32 | var userAgent = req.get('User-Agent');
33 | console.log(userAgent);
34 | next();
35 | });
36 |
37 | app.use(express.static('public'));
38 |
39 |
40 | // Always return the main index.html, so react-router render the route in the client
41 | app.get('*', (req, res) => {
42 | res.sendFile(path.resolve('public', 'index.html'));
43 |
44 | });
45 |
46 |
47 | app.listen(PORT, function() {
48 | console.log('Express server is up on port ' + PORT);
49 | });
--------------------------------------------------------------------------------
/src/api/CommentAPI.ts:
--------------------------------------------------------------------------------
1 | import StringAPI from 'api/StringAPI'
2 | import { ServerRequestType } from 'constants/serverRequestType'
3 | import { ServerRequestModel } from 'models/server'
4 | import { ServerRequestStatusType } from 'store/actions/serverRequestStatusType'
5 | import { comments } from 'models/comments/commentTypes'
6 | import * as _ from 'lodash'
7 |
8 | /**
9 | * Create get comments server request model
10 | */
11 | const createGetCommentsRequest = (postId: string) => {
12 | const requestId = StringAPI.createServerRequestId(ServerRequestType.CommentGetComments, postId)
13 | return new ServerRequestModel(
14 | ServerRequestType.CommentGetComments,
15 | requestId,
16 | '',
17 | ServerRequestStatusType.Sent
18 | )
19 | }
20 |
21 | const sortCommentsByDate = (sortedObjects: comments) => {
22 | const commentKeys = Object.keys(sortedObjects)
23 | if (commentKeys.length > 1) {
24 | return _.fromPairs(_.toPairs(sortedObjects)
25 | .sort((a: any, b: any) => parseInt(b[1].creationDate, 10) - parseInt(a[1].creationDate, 10)).slice(0, 3))
26 |
27 | }
28 | return sortedObjects
29 | }
30 |
31 | export default {
32 | createGetCommentsRequest,
33 | sortCommentsByDate
34 | }
--------------------------------------------------------------------------------
/src/api/CommonAPI.ts:
--------------------------------------------------------------------------------
1 | import * as moment from 'moment/moment'
2 | /**
3 | * Log the data
4 | * @param title log title
5 | * @param data log data object
6 | */
7 | const logger = (title: string, ...data: any[]) => {
8 | const randomColor = getRandomColor()
9 |
10 | window['console']['log'](`\n\n%c ======= ${title} ======= %c${moment().format('HH:mm:ss SSS')} \n`, `color:${randomColor};font-size:15`
11 | , `color:${getRandomColor()};font-size:15`)
12 | window['console']['log'](``)
13 | window['console']['log'](` `, data)
14 | window['console']['log'](`\n =========================================`)
15 |
16 | }
17 |
18 | /**
19 | * Get random color in hex
20 | */
21 | const getRandomColor = () => {
22 | let letters = '0123456789ABCDEF'
23 | let color = '#'
24 | for (let i = 0; i < 6; i++) {
25 | color += letters[Math.floor(Math.random() * 16)]
26 | }
27 | return color
28 | }
29 |
30 | const updateObject = (oldObject: any, updatedProperties: any) => {
31 | return {
32 | ...oldObject,
33 | ...updatedProperties
34 | }
35 | }
36 |
37 | const getStateSlice = (state: any) => state.toJS()['locale']
38 |
39 | export default {
40 | logger,
41 | getRandomColor,
42 | updateObject,
43 | getStateSlice
44 | }
45 |
--------------------------------------------------------------------------------
/src/api/PostAPI.ts:
--------------------------------------------------------------------------------
1 | import {List} from 'immutable'
2 |
3 | // Get tags from post content
4 | export const detectTags: (content: string, character: string) => string[] = (content: string, character: string) => {
5 |
6 | return content.split(' ').filter((word) => {
7 | return (word.slice(0,1) === character)
8 | })
9 |
10 | }
11 | export const getContentTags = (content: string) => {
12 | let newTags: string[] = []
13 | let tags = detectTags(content,'#')
14 | tags.forEach((tag) => {
15 | newTags.push(tag.slice(1))
16 | })
17 | return newTags
18 | }
19 |
20 | export const sortObjectsDate = (objects: any) => {
21 | let sortedObjects = objects
22 |
23 | // Sort posts with creation date
24 | sortedObjects.sort((a: any, b: any) => {
25 | return parseInt(b.creationDate,10) - parseInt(a.creationDate,10)
26 |
27 | })
28 |
29 | return sortedObjects
30 | }
31 |
32 | export const sortImuObjectsDate = (objects: List