Skip to content

Commit 77fcf54

Browse files
authored
Merge pull request #201 from oslabs-beta/main
Prepared for launch.
2 parents 2933dae + 58411de commit 77fcf54

File tree

131 files changed

+3618
-93564
lines changed

Some content is hidden

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

131 files changed

+3618
-93564
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
app/electron

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,4 +496,6 @@ server/rootCA.key
496496
server/rootCA.pem
497497
server/RootCA.srl
498498

499+
500+
499501
# End of https://www.gitignore.io/api/node,linux,macos,windows,visualstudio,yarn

CHANGE_LOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,38 @@
33
<h1 align="center">ReacType Change Log</h1>
44
</p>
55

6+
**Version 15.0.0 Changes**
7+
8+
Changes:<br>
9+
10+
- Developer Improvements:
11+
- Redux Toolkit:
12+
- Migrated state from a combination of useReducer/useContext and Redux to only using Redux Toolkit. This is the recommended modern approach to handling large state management in this sort of application. Enhances the developer experience by enabling the use of the Redux Devtools to debug, and see state/actions in real-time.
13+
- Dependency Updates
14+
- New developers can easily npm install without having to use an older version of node or using --legacy-peer-deps
15+
- Updated to modern versions to take advantage of newer features
16+
- User Features:
17+
- Websockets:
18+
- Users can now join rooms to collaborate in realtime
19+
- Tailwind CSS:
20+
- In the customization panel users can now choose between inline CSS and Tailwind. These changes are reflected in the live code preview.
21+
- OAuth:
22+
- Users may now log in using OAuth which enhances security, and makes sign in a breeze.
23+
- Deployed Website:
24+
- Containerized and deployed a working version of the application. Instead of having to download an application users may now interact live.
25+
26+
Recommendations for Future Enhancements:<br>
27+
28+
- Continue working on State Management. There are some changes that can be made to make the application cleaner. Right now the appStateSlice is a large file which houses a lot of the reducer functions. We believe there is a way to further modularize this to make it simpler to read, and iterate upon in the future.
29+
- Convert to using Vite. While developing we ran into issues with webpack taking a long time to reflect changes. Vite is lightweight and enhances the developer experience.
30+
- Expand Testing Coverage. Making a large move of state management made a lot of the testing innefective since it was based upon old ways.
31+
- Refactor away from MUI. MUI is very opinionated and while creating components with it is easy it leaves a lot to be desired.
32+
- Residual Bugs. While migrating state there are a few lingering bugs within the application. This process should be easier now with Redux Devtools availability, but we did not have time to go through every action and conduct thorough testing.
33+
634
**Version 14.0.0 Changes**
735

836
Changes:<br>
37+
938
- Added functionality & improvements:
1039
- Event listeners:
1140
- Added ability to assign event listeners to elements in the bottom customization tab
@@ -32,6 +61,7 @@ Changes:<br>
3261
- Reusable component: The drag-and-drop feature for reusable components is now functioning smoothly and without bugs
3362

3463
Recommendations for Future Enhancements:<br>
64+
3565
- Add function content in the current event listeners' function skeleton.
3666
- The code output formatting in generateCode.ts is currently difficult to read, and could be improved for better readability.
3767
- Currently, the project uses two sets of state management tools: useReducer/useContext and Redux. useReducer/useContext is used for handling the customization state, and Redux for managing the code preview, context manager, and dark mode reducer state. However, there seems to be some confusion around how to integrate these two tools effectively. For instance, both tools are used for managing the code preview state, and changing the useReducer/useContext state would replace the corresponding redux state. Need to clean up the logic and find a solution to solve this issue.
@@ -41,27 +71,32 @@ Recommendations for Future Enhancements:<br>
4171
**Version 13.0.0 Changes**
4272

4373
New Functionality:<br>
74+
4475
- Manage state locally: Users can now manage state dynamically within nested components using React Hooks within the state manager tab.
4576
- Add/delete props: For a selected component, users can see a list of available props from the parent, add props, and delete props in case they are not - required later on.
4677
- State/props flow: If state or props are deleted upstream, it will automatically update the state for its children components.
4778
- Visualize state/props flow: Within the display sub-tab of the state manager tab, users can visualize an interactive tree diagram depicting the state initialized in the current component and passed down props from the parent component.
4879

4980
Enhancements:<br>
81+
5082
- Live code preview: Live rendering of code based on any changes in the state and dragging and nesting of components.
5183
- Next.js & Gatsby compatibility: New state manager tab is now compatible with next.js and Gatsby.
5284
- Tutorial: Tutorial is functional and has the latest guides to navigate through the newly added state management tab.
5385

5486
Deployment Updates:<br>
87+
5588
- Electron app is now available for Windows users.
5689
- Web based version of the app is available on Heroku.
5790

5891
Bug Fixes:<br>
92+
5993
- User dashboard: The dashboard works now and shows private and shared projects with the ability for users to drop comments.
6094
- Login/logout: Users can now signup/login/logout now on both development and production environments.
6195
- Manage Projects: Github authenticated users are now able to create and save projects.
6296
- Customization: Use State works as expected now within HTML elements.
6397

6498
What’s next:<br>
99+
65100
- Adding on click functionality within components. Goal: Make a fully functional tic-tac-toe app.
66101
- Incorporating material ui into the components so that exported app has visually appealing components.
67102
- Enabling auto save functionality when dragging and dropping components, and amending component state.

Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Stage 1: Build
2+
FROM node:19-alpine as build
3+
4+
# python: required dependency for node alpine, shrinks image size from 2.17GB to 1.67GB
5+
RUN apk add --no-cache --virtual .gyp \
6+
python3 \
7+
make \
8+
g++
9+
10+
WORKDIR /app
11+
12+
COPY package*.json ./
13+
14+
RUN npm install --no-install-recommends --fetch-retry-maxtimeout 500000
15+
16+
COPY . .
17+
18+
# Stage 2: Runtime
19+
FROM node:19-alpine as runtime
20+
21+
WORKDIR /app
22+
23+
COPY --from=build /app/package*.json ./
24+
25+
RUN npm install --no-install-recommends --only=production --fetch-retry-maxtimeout 500000
26+
27+
COPY --from=build /app/.env .env
28+
COPY --from=build /app/config.js ./config.js
29+
COPY --from=build /app/server ./server
30+
COPY --from=build /app/app/dist /app
31+
32+
EXPOSE 5656
33+
34+
ENV IS_DOCKER true
35+
36+
CMD [ "npm", "start" ]

Dockerrun.aws.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"AWSEBDockerrunVersion": "1",
3+
"Image": {
4+
"Name": "035101486432.dkr.ecr.us-east-1.amazonaws.com/reactype-2stage:latest",
5+
"Update": "true"
6+
},
7+
"Ports": [
8+
{
9+
"ContainerPort": "5656"
10+
}
11+
],
12+
"Environment": [
13+
{
14+
"Name": "API_BASE_URL",
15+
"Value": "Reactypev15-env.eba-mbvivk7k.us-east-1.elasticbeanstalk.com"
16+
}
17+
]
18+
}

README.md

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<img width="100" src="https://i.imgur.com/Yn70tqI.png">
33
<h1 align="center">ReacType </h1>
44
</p> -->
5+
56
# ReacType
67

78
<!-- <p align="center">
@@ -14,27 +15,24 @@
1415
[![ContributorShield][contributors]][contributors-url]
1516
[![ForksShield][forks]][forks-url]
1617
![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)
17-
![Version: 14.0.0](https://img.shields.io/badge/version-14.0.0-orange)
18+
![Version: 14.0.0](https://img.shields.io/badge/version-15.0.0-orange)
1819

1920
</div>
2021
<!-- <p align="center">
2122
<img width="1000" src="https://i.imgur.com/FPizsat.png">
2223
</p> -->
2324

24-
2525
<p align="center">
2626
<img width="1000" src="https://i.imgur.com/FIX8skV.png">
2727
</p>
2828

29-
3029
<p align="center">
31-
<img width="1000" src="https://i.imgur.com/jR53ySV.png">
30+
<img width="1000" src="./resources/ReadMe.gif">
3231
</p>
3332

34-
3533
**ReacType** is a rapid prototyping tool built on Electron that allows users _visualize_ their application architecture dynamically, employing a _drag-and-drop canvas display_ and an interactive, _real-time component code preview_ that can be exported as a **React** app for developers employing React component architecture alongside the comprehensive type-checking of **TypeScript**. In other words, **you can draw prototypes and export React / TypeScript code!**
3634

37-
Visit [reactype.io](https://reactype.io/) to learn more about the product.
35+
Visit [reactype.dev](https://reactype.dev) to learn more about the product.
3836

3937
Follow [@ReacType](https://twitter.com/reactype) on Twitter for important announcements.
4038

@@ -45,31 +43,30 @@ If you want to read about using ReacType, the [User Manual](https://reactype-1.h
4543
### Installing
4644

4745
- **MacOS**
48-
Download the latest [release](https://github.com/open-source-labs/ReacType/releases) <br>
49-
After opening the dmg and dragging ReacType into your Applications folder, ctrl+click the icon and select 'Open' from the context menu to run the app. This extra step is necessary since we don't have an Apple developer license yet.
50-
If you are given a warning that Apple could not scan the app. Please follow these [steps](https://support.apple.com/en-ca/HT202491)
46+
Download the latest [release](https://github.com/open-source-labs/ReacType/releases) <br>
47+
After opening the dmg and dragging ReacType into your Applications folder, ctrl+click the icon and select 'Open' from the context menu to run the app. This extra step is necessary since we don't have an Apple developer license yet.
48+
If you are given a warning that Apple could not scan the app. Please follow these [steps](https://support.apple.com/en-ca/HT202491)
5149

5250
- **Windows**
53-
Download the latest [release](https://github.com/open-source-labs/ReacType/releases)
54-
51+
Download the latest [release](https://github.com/open-source-labs/ReacType/releases)
5552

56-
## Changes with version 14.0.0
53+
## Changes with version 15.0.0
5754

58-
- **Added event listeners**: Users can now add event listeners to elements in the customization tab and view a list of added events. The list can be edited to remove events, and the live code preview will show the events being added and updated.
59-
- **Delete buttons added**: Delete buttons have been added to canvas components and elements for easier removal. Users can now delete elements or components directly by focusing on them and mouse-clicking the delete button.
60-
- **Live code preview and component tree update**: When users drag-and-drop components and elements, the live code preview and component tree are automatically updated to reflect the changes in real-time.
61-
- **Major UI enhancement**: The user interface has undergone a major change, including a sliding effect for the left and bottom panels to maximize user visibility. The styling has been unified and the display of the canvas hierarchy has been made more prominent for improved clarity.
55+
- **Consolidated State Management**: Reactype was using mutliple methods of State Management. We consolidated this all to the modern version of Redux Toolkit to enhance the developer experience and make it easier to debug.
56+
- **Major Dependency Updates**: No more workarounds required to get new developers up and running in the project. A simple npm install works as intended.
57+
- **Websockets**: Users can now join rooms to collaborate on a project together in real time!
58+
- **Fully Deployed Web Application**: To utilize these new features we have hosted the full application via AWS so users can easily use Reactype without a download.
6259
- **And more:** See [change log](https://github.com/open-source-labs/ReacType/blob/master/CHANGE_LOG.md) for more details on what was changed from the previous versions as well as plans for upcoming features!
6360

64-
## (_New_) File Structure
61+
## File Structure courtesy of Reactype version 14.0.0
6562

6663
Here is the main file structure:
64+
6765
<p align="center">
6866
<img width="1000" src="https://i.imgur.com/RdK8QzW.jpg">
6967
</p>
7068
Please refer to the link: https://excalidraw.com/#json=JKwzVD5qx6lsfiHW1_pQ9,XJ6uDoehVu-1bsx0SMlC6w for more details.
7169

72-
7370
## Run ReacType using CLI
7471

7572
- **Fork** and **Clone** Repository.
@@ -79,11 +76,6 @@ Please refer to the link: https://excalidraw.com/#json=JKwzVD5qx6lsfiHW1_pQ9,XJ6
7976
```bash
8077
npm install
8178
```
82-
- If there is a dependency issue during installation, try switching to Node version v16.0.0 and then install. If the dependency issue still persists, try using the `--legacy-peer-deps` flag instead.
83-
84-
```bash
85-
npm install --legacy-peer-deps
86-
```
8779

8880
- To run the production build
8981

@@ -103,11 +95,12 @@ npm run test
10395
npm run dev
10496
```
10597

98+
- Note that a .env with DEV_PORT, and a NODE_ENV flag (=production or development) are needed.
10699
- Please note that the development build is not connected to the production server. `npm run dev` should spin up the development server from the server folder of this repo. For additional information, the readme is [here](https://github.com/open-source-labs/ReacType/blob/master/server/README.md). Alternatively, you can select "Continue as guest" on the login page of the app, which will not use any features that rely on the server (authentication and saving project data.)
107100

108101
- To run the development build of electron app
109102

110-
```bash
103+
```bash
111104
npm run dev
112105
npm run electron-dev
113106
```
@@ -144,7 +137,6 @@ Typescript, React.js, Redux, Javascript, D3.js, Node.js (Express), HTML, CSS/SAS
144137
Here is the up to date [list](https://github.com/open-source-labs/ReacType/blob/master/contributors.md) of all co-developers of this product.
145138
Please visit our [contribution documentation](https://github.com/open-source-labs/ReacType/blob/master/contribution_documentation.md) for more information on how you can contribute to ReacType!
146139

147-
148140
## License
149141

150142
This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/team-reactype/ReacType/blob/development/LICENSE.md) file for details.

__tests__/enzyme.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { shallow} from 'enzyme';
2-
import { configure } from 'enzyme';
2+
// import { configure } from 'enzyme';
33
import Adapter from 'enzyme-adapter-react-16'
44
import React from 'react';
55
import { DndProvider } from 'react-dnd';
@@ -17,8 +17,8 @@ import HTMLItem from '../app/src/components/left/HTMLItem';
1717
import LeftContainer from '../app/src/containers/LeftContainer';
1818
import AppContainer from '../app/src/containers/AppContainer';
1919
import NavBar from '../app/src/components/top/NavBar';
20-
import MenuItem from '@material-ui/core/MenuItem';
21-
import Tab from '@material-ui/core/Tab';
20+
import MenuItem from '@mui/material/MenuItem';
21+
import Tab from '@mui/material/Tab';
2222
import LoginButton from '../app/src/components/right/LoginButton';
2323
import customizationPanel from '../app/src/containers/CustomizationPanel'
2424

app/electron/main.js renamed to app/.electron/main.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ const {
2020
const { resolve } = require('app-root-path');
2121

2222
// to install react dev tool extension
23-
const {
24-
default: installExtension,
25-
REACT_DEVELOPER_TOOLS
26-
} = require('electron-devtools-installer');
23+
// const {
24+
// default: installExtension,
25+
// REACT_DEVELOPER_TOOLS
26+
// } = require('electron-devtools-installer');
2727
const debug = require('electron-debug');
2828

2929
// import custom protocol in protocol.js
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

app/src/Dashboard/NavbarDash.tsx

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
import React, { useState, useContext } from 'react';
2-
import {
3-
withStyles, //added
4-
createStyles,
5-
makeStyles,
6-
Theme,
7-
} from '@material-ui/core/styles';
8-
import AppBar from '@material-ui/core/AppBar';
9-
import Avatar from '@material-ui/core/Avatar';
10-
import Brightness3Icon from '@material-ui/icons/Brightness3';
11-
import Brightness5Icon from '@material-ui/icons/Brightness5';
12-
import Button from '@material-ui/core/Button';
13-
import EventNoteIcon from '@material-ui/icons/EventNote';
14-
import HomeIcon from '@material-ui/icons/Home';
15-
import Toolbar from '@material-ui/core/Toolbar';
16-
import Typography from '@material-ui/core/Typography';
2+
import { Theme } from '@mui/material/styles';
3+
import withStyles from '@mui/styles/withStyles';
4+
import createStyles from '@mui/styles/createStyles';
5+
import makeStyles from '@mui/styles/makeStyles';
6+
import AppBar from '@mui/material/AppBar';
7+
import Avatar from '@mui/material/Avatar';
8+
import Brightness3Icon from '@mui/icons-material/Brightness3';
9+
import Brightness5Icon from '@mui/icons-material/Brightness5';
10+
import Button from '@mui/material/Button';
11+
import EventNoteIcon from '@mui/icons-material/EventNote';
12+
import HomeIcon from '@mui/icons-material/Home';
13+
import Toolbar from '@mui/material/Toolbar';
14+
import Typography from '@mui/material/Typography';
1715
import { Link } from 'react-router-dom';
18-
import { styleContext } from '../containers/AppContainer';
19-
import Menu from '@material-ui/core/Menu';
20-
import MenuItem from '@material-ui/core/MenuItem';
21-
import SortIcon from '@material-ui/icons/Sort';
22-
import StarBorderIcon from '@material-ui/icons/StarBorder';
23-
import PersonIcon from '@material-ui/icons/Person';
16+
import Menu from '@mui/material/Menu';
17+
import MenuItem from '@mui/material/MenuItem';
18+
import SortIcon from '@mui/icons-material/Sort';
19+
import StarBorderIcon from '@mui/icons-material/StarBorder';
20+
import PersonIcon from '@mui/icons-material/Person';
2421
import greenLogo from '../public/icons/png/512x512.png';
22+
import {setStyle} from '../redux/reducers/slice/styleSlice'
23+
import { useSelector,useDispatch } from 'react-redux';
2524

2625
// NavBar text and button styling
2726
const useStyles = makeStyles((theme: Theme) => createStyles({
@@ -47,12 +46,12 @@ const sortMethods = ['RATING', 'DATE', 'USER'];
4746
// Drop down menu button for SORT PROJECTS
4847
const StyledMenu = withStyles({
4948
paper: {
50-
border: '1px solid #d3d4d5'
49+
border: '1px solid #d3d4d5',
5150
}
5251
})(props => (
5352
<Menu
5453
elevation={0}
55-
getContentAnchorEl={null}
54+
// getContentAnchorEl={null}
5655
anchorOrigin={{
5756
vertical: 'bottom',
5857
horizontal: 'center'
@@ -77,7 +76,8 @@ const StyledMenuItem = withStyles(theme => ({
7776
export default function NavBar(props) {
7877
// TO DO: import setStyle
7978
const classes = useStyles();
80-
const { style, setStyle } = useContext(styleContext);
79+
const style = useSelector(store => store.styleSlice);
80+
const dispatch = useDispatch();
8181
const toggling = () => setIsOpen(!isOpen);
8282
// toggle to open and close dropdown sorting menu
8383
const [isOpen, setIsOpen] = useState(false);
@@ -145,9 +145,9 @@ export default function NavBar(props) {
145145
style={{minWidth: '113.97px'}}
146146
endIcon={props.isThemeLight ? <Brightness3Icon/> : <Brightness5Icon/>}
147147
onClick={() => {
148-
!props.styles[0].backgroundColor
149-
? props.styles[1]({ backgroundColor: '#21262D' }) //dark mode color
150-
: props.styles[1]({ backgroundColor: null })
148+
!style.backgroundColor
149+
? dispatch(setStyle({ backgroundColor: '#21262D' })) //dark mode color
150+
: dispatch(setStyle( null ))
151151
props.isThemeLight ? props.setTheme(false) : props.setTheme(true);
152152
}}
153153
>

0 commit comments

Comments
 (0)