moved to vite
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"files": {
|
||||
"main.css": "/static/css/main.cb2b37d1.css",
|
||||
"main.js": "/static/js/main.d19fb767.js",
|
||||
"index.html": "/index.html",
|
||||
"main.cb2b37d1.css.map": "/static/css/main.cb2b37d1.css.map",
|
||||
"main.d19fb767.js.map": "/static/js/main.d19fb767.js.map"
|
||||
},
|
||||
"entrypoints": [
|
||||
"static/css/main.cb2b37d1.css",
|
||||
"static/js/main.d19fb767.js"
|
||||
]
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<!doctype html><html lang="en"><head><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><script defer="defer" src="/static/js/main.d19fb767.js"></script><link href="/static/css/main.cb2b37d1.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
|
||||
@@ -1,2 +0,0 @@
|
||||
.datePicker :hover{border-color:"#212121"}.datePicker :focus{border-color:"#1976d2";border-width:"2px"}.datePicker{background:"red";color:"red"}.colormebaby{background-color:"red";color:"red"}
|
||||
/*# sourceMappingURL=main.cb2b37d1.css.map*/
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"static/css/main.cb2b37d1.css","mappings":"AAAA,mBACE,sBACF,CACA,mBACE,sBAAuB,CACvB,kBACF,CACA,YAEE,gBAAgB,CADhB,WAEF,CAEA,aACE,sBAAsB,CACtB,WACF","sources":["App2.css"],"sourcesContent":[".datePicker :hover {\n border-color: \"#212121\";\n}\n.datePicker :focus {\n border-color: \"#1976d2\";\n border-width: \"2px\";\n}\n.datePicker{\n color:\"red\";\n background:\"red\";\n}\n\n.colormebaby{\n background-color:\"red\";\n color:\"red\"\n}\n"],"names":[],"sourceRoot":""}
|
||||
File diff suppressed because one or more lines are too long
@@ -1,121 +0,0 @@
|
||||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* react-dom.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* react-is.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* react-jsx-runtime.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* react.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* scheduler.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* use-sync-external-store-shim.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* use-sync-external-store-shim/with-selector.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @mui/styled-engine v5.13.2
|
||||
*
|
||||
* @license MIT
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @remix-run/router v1.7.2
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/**
|
||||
* React Router DOM v6.14.2
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/**
|
||||
* React Router v6.14.2
|
||||
*
|
||||
* Copyright (c) Remix Software Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/** @license React v16.13.1
|
||||
* react-is.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
File diff suppressed because one or more lines are too long
@@ -5,6 +5,6 @@ WORKDIR /usr/src/app
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN npm ci
|
||||
RUN npm i
|
||||
|
||||
CMD npm start
|
||||
CMD ["npm","run","dev","--","--host"]
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/index.tsx"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Generated
+1563
-23516
File diff suppressed because it is too large
Load Diff
+7
-9
@@ -12,7 +12,6 @@
|
||||
"@testing-library/react": "^13.4.0",
|
||||
"@testing-library/user-event": "^13.5.0",
|
||||
"@types/jest": "^27.5.2",
|
||||
"@types/node": "^16.18.39",
|
||||
"@types/react": "^18.2.16",
|
||||
"@types/react-dom": "^18.2.7",
|
||||
"axios": "^1.4.0",
|
||||
@@ -20,17 +19,15 @@
|
||||
"react-dom": "^18.2.0",
|
||||
"react-redux": "^8.1.1",
|
||||
"react-router-dom": "^6.14.2",
|
||||
"react-scripts": "5.0.1",
|
||||
"redux": "^4.2.1",
|
||||
"typescript": "^4.9.5",
|
||||
"uuid": "^9.0.0",
|
||||
"web-vitals": "^2.1.4"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
"build": "react-scripts build",
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject"
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"serve": "vite preview"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
@@ -51,7 +48,8 @@
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/uuid": "^9.0.2"
|
||||
},
|
||||
"proxy": "http://server:5000"
|
||||
"@types/uuid": "^9.0.2",
|
||||
"@vitejs/plugin-react": "^4.3.1",
|
||||
"vite": "^5.4.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"name": "my-app",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.11.1",
|
||||
"@emotion/styled": "^11.11.0",
|
||||
"@mui/icons-material": "^5.14.3",
|
||||
"@mui/material": "^5.14.4",
|
||||
"@reduxjs/toolkit": "^1.9.5",
|
||||
"@testing-library/jest-dom": "^5.17.0",
|
||||
"@testing-library/react": "^13.4.0",
|
||||
"@testing-library/user-event": "^13.5.0",
|
||||
"@types/jest": "^27.5.2",
|
||||
"@types/node": "^16.18.39",
|
||||
"@types/react": "^18.2.16",
|
||||
"@types/react-dom": "^18.2.7",
|
||||
"axios": "^1.4.0",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-redux": "^8.1.1",
|
||||
"react-router-dom": "^6.14.2",
|
||||
"redux": "^4.2.1",
|
||||
"typescript": "^4.9.5",
|
||||
"uuid": "^9.0.0",
|
||||
"web-vitals": "^2.1.4"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
"build": "react-scripts build",
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"react-app",
|
||||
"react-app/jest"
|
||||
]
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not op_mini all"
|
||||
],
|
||||
"development": [
|
||||
"last 1 chrome version",
|
||||
"last 1 firefox version",
|
||||
"last 1 safari version"
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/uuid": "^9.0.2"
|
||||
},
|
||||
"proxy": "http://server:5000"
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
|
||||
/>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -121,6 +121,7 @@ export const addPost =
|
||||
(formData: { text: string }): AppThunk =>
|
||||
async (dispatch) => {
|
||||
try {
|
||||
console.log(1);
|
||||
const res = await api.post("/posts", formData);
|
||||
|
||||
dispatch(addPostAction(res.data));
|
||||
|
||||
@@ -7,6 +7,7 @@ import { Box, Typography } from "@mui/material";
|
||||
|
||||
const Education = ({ education }: { education: EducationType[] }) => {
|
||||
const dispatch = useAppDispatch();
|
||||
if (!education) return <></>;
|
||||
const educations = education.map((edu) => (
|
||||
<tr key={edu._id}>
|
||||
<td>{edu.school}</td>
|
||||
@@ -35,7 +36,7 @@ const Education = ({ education }: { education: EducationType[] }) => {
|
||||
);
|
||||
return (
|
||||
<>
|
||||
<Typography variant='h5'>Education Credentials</Typography>
|
||||
<Typography variant="h5">Education Credentials</Typography>
|
||||
<table className="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -7,6 +7,7 @@ import { useAppDispatch } from "../../utils/hooks";
|
||||
|
||||
const Experience = ({ experience }: { experience: ExperienceType[] }) => {
|
||||
const dispatch = useAppDispatch();
|
||||
if (!experience) return <></>;
|
||||
const experiences = experience.map((exp) => (
|
||||
<tr key={exp._id}>
|
||||
<td>{exp.company}</td>
|
||||
@@ -27,7 +28,9 @@ const Experience = ({ experience }: { experience: ExperienceType[] }) => {
|
||||
|
||||
if (experiences.length === 0)
|
||||
return (
|
||||
<Typography variant="h5">You have no experiences, consider adding some.</Typography>
|
||||
<Typography variant="h5">
|
||||
You have no experiences, consider adding some.
|
||||
</Typography>
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
@@ -127,7 +127,7 @@ const Navbar = () => {
|
||||
}}
|
||||
>
|
||||
{isAuthenticated ? (
|
||||
<>
|
||||
<div>
|
||||
{" "}
|
||||
{authLinks.map((el) => (
|
||||
<MenuItem
|
||||
@@ -149,7 +149,7 @@ const Navbar = () => {
|
||||
</a>
|
||||
</MenuItem>
|
||||
,
|
||||
</>
|
||||
</div>
|
||||
) : (
|
||||
guestLinks.map((el) => (
|
||||
<MenuItem
|
||||
|
||||
@@ -14,8 +14,9 @@ const PostForm = () => {
|
||||
display="flex"
|
||||
gap="1rem"
|
||||
noValidate
|
||||
sx={{ mt: 3,mb:3 }}
|
||||
sx={{ mt: 3, mb: 3 }}
|
||||
onSubmit={async (e) => {
|
||||
console.log(1);
|
||||
e.preventDefault();
|
||||
await dispatch(addPost({ text }));
|
||||
setText("");
|
||||
@@ -26,9 +27,9 @@ const PostForm = () => {
|
||||
label="Create a post"
|
||||
fullWidth
|
||||
value={text}
|
||||
onChange={(e)=> setText(e.target.value)}
|
||||
onChange={(e) => setText(e.target.value)}
|
||||
multiline
|
||||
rows={3}
|
||||
rows={3}
|
||||
required
|
||||
/>
|
||||
<Button variant="contained">Submit</Button>
|
||||
|
||||
@@ -14,15 +14,20 @@ const Posts = () => {
|
||||
fetchData();
|
||||
}, [dispatch]);
|
||||
const posts = useAppSelector((state) => state.post.posts);
|
||||
if (!posts) return <></>;
|
||||
|
||||
return (
|
||||
<Container maxWidth="sm">
|
||||
<Typography variant="h3">Posts</Typography>
|
||||
<Typography variant='h4'>Welcome to the community</Typography>
|
||||
<Typography variant="h4">Welcome to the community</Typography>
|
||||
<PostForm />
|
||||
{posts.map((post) => (
|
||||
<PostItem key={post._id} post={post} />
|
||||
))}
|
||||
<Box>
|
||||
{posts.length > 0 && Array.isArray(posts) ? (
|
||||
posts.map((post) => <PostItem key={post._id} post={post} />)
|
||||
) : (
|
||||
<Typography>No posts found...</Typography>
|
||||
)}
|
||||
</Box>
|
||||
</Container>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -28,7 +28,7 @@ const Profiles = () => {
|
||||
Browse and connect with developers
|
||||
</Typography>
|
||||
<Box>
|
||||
{profiles.length > 0 ? (
|
||||
{profiles.length > 0 && Array.isArray(profiles) ? (
|
||||
profiles.map((profile) => (
|
||||
<ProfileItem key={profile._id} profile={profile} />
|
||||
))
|
||||
|
||||
@@ -2,7 +2,7 @@ import axios from "axios";
|
||||
import store from "../store";
|
||||
|
||||
const api = axios.create({
|
||||
baseURL: "/api",
|
||||
baseURL: "http://localhost:5000/api",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import { defineConfig } from "vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
|
||||
export default defineConfig(() => {
|
||||
return {
|
||||
build: {
|
||||
outDir: "build",
|
||||
},
|
||||
plugins: [react()],
|
||||
};
|
||||
});
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
services:
|
||||
app:
|
||||
image: devcon-frontend-dev
|
||||
@@ -6,7 +5,9 @@ services:
|
||||
context: ./client
|
||||
dockerfile: ./dev.Dockerfile
|
||||
ports:
|
||||
- 3000:3000
|
||||
- 5173:5173
|
||||
environment:
|
||||
VITE_BACKEND_URL: http://server:5000
|
||||
volumes:
|
||||
- ./client:/usr/src/app
|
||||
|
||||
|
||||
+28
-2
@@ -1,4 +1,26 @@
|
||||
services:
|
||||
app:
|
||||
image: devcon-frontend-dev
|
||||
build:
|
||||
context: ./client
|
||||
dockerfile: ./dev.Dockerfile
|
||||
ports:
|
||||
- 3000:3000
|
||||
volumes:
|
||||
- ./client:/usr/src/app
|
||||
|
||||
server:
|
||||
image: devcon-backend-dev
|
||||
build:
|
||||
context: ./server
|
||||
dockerfile: ./dev.Dockerfile
|
||||
ports:
|
||||
- 5000:5000
|
||||
volumes:
|
||||
- ./server:/usr/src/app
|
||||
environment:
|
||||
MONGO_URL: "mongodb://the_username:the_password@mongo:27017/the_database"
|
||||
|
||||
mongo:
|
||||
image: mongo
|
||||
ports:
|
||||
@@ -7,6 +29,10 @@ services:
|
||||
MONGO_INITDB_ROOT_USERNAME: root
|
||||
MONGO_INITDB_ROOT_PASSWORD: example
|
||||
MONGO_INITDB_DATABASE: the_database
|
||||
|
||||
volumes:
|
||||
volumes:
|
||||
- ./mongo/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js
|
||||
- mongo_data:/data/db
|
||||
|
||||
volumes:
|
||||
mongo_data:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user