Skip to content

Commit ade3fdd

Browse files
committed
Folder Restructuring and Names Changed
1 parent b85ce7f commit ade3fdd

Some content is hidden

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

55 files changed

+118
-118
lines changed

server/.gitignore .gitignore

File renamed without changes.

README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ This section will walk you through how you can get started with the project.
3737
├── <strong>client</strong>
3838
|
3939
├── <strong>server</strong>
40-
| ├── <strong>Controllers</strong>
40+
| ├── <strong>controllers</strong>
4141
| │ ├── <strong>authController.js</strong>
4242
| │ ├── <strong>chatController.js</strong>
4343
| │ └── <strong>commentController.js</strong>
4444
| │ └── <strong>errorController.js</strong>
4545
| │ └── <strong>handlerFactory.js</strong>
4646
| │ └── <strong>messageController.js</strong>
47-
| │ └── <strong>postControllers.js</strong>
48-
| │ └── <strong>userControllers.js</strong>
47+
| │ └── <strong>postcontrollers.js</strong>
48+
| │ └── <strong>usercontrollers.js</strong>
4949
| │
50-
| ├── <strong>Models</strong>
50+
| ├── <strong>models</strong>
5151
| │ ├── <strong>chatModel.js</strong>
5252
| │ ├── <strong>commentModel.js</strong>
5353
| │ └── <strong>contractModel.js</strong>
@@ -63,14 +63,14 @@ This section will walk you through how you can get started with the project.
6363
| │ └── <strong>postRoutes.js</strong>
6464
| │ └── <strong>userRoutes.js</strong>
6565
| |
66-
| ├── <strong>Utils</strong>
66+
| ├── <strong>utils</strong>
6767
| │ ├── <strong>apiFeatures.js</strong>
6868
| │ ├── <strong>appError.js</strong>
6969
| │ └── <strong>catchAsync.js</strong>
7070
| │ └── <strong>email.js</strong>
7171
| │ └── <strong>exludedFields.js</strong>
7272
| |
73-
| ├── <strong>Views</strong>
73+
| ├── <strong>views</strong>
7474
| │ ├── <strong>_style.pug</strong>
7575
| │ ├── <strong>baseEmail.pug</strong>
7676
| │ └── <strong>passwordReset.pug</strong>
@@ -104,11 +104,11 @@ If you dont have [MongoDB]() you use [MongoDB Atls]()
104104

105105

106106
server
107-
└──- Controllers
108-
- Models
107+
└──- controllers
108+
- models
109109
- Routes
110-
- Utils
111-
- Views
110+
- utils
111+
- views
112112
- .env <-- create it here
113113
- .gitignore
114114
- app.js

server/app.js app.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ const postRouter = require('./Routes/postRoutes')
77
const chatRouter = require('./Routes/chatRoutes')
88
const contractRouter = require('./Routes/contractRoutes')
99

10-
const AppError = require('./Utils/appError')
11-
const globalErrorHandle = require('./Controllers/errorController')
10+
const AppError = require('./utils/appError')
11+
const globalErrorHandle = require('./controllers/errorController')
1212

1313
const app = express();
1414
require("dotenv").config();

client/src/App.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { BrowserRouter, Route, Routes } from "react-router-dom";
2-
import Home from "./Pages/Home";
3-
import Login from "./Pages/Login";
4-
import Profile from "./Pages/Profile";
5-
import Register from "./Pages/Register";
6-
import Chats from "./Pages/Chats";
7-
import GlobalStyles from "./Utils/GlobalStyles";
2+
import Home from "./pages/Home";
3+
import Login from "./pages/Login";
4+
import Profile from "./pages/Profile";
5+
import Register from "./pages/Register";
6+
import Chats from "./pages/Chats";
7+
import GlobalStyles from "./utils/GlobalStyles";
88
import { ThemeProvider } from "styled-components";
9-
import { light, dark, workedinScheme } from "./Utils/Themes";
9+
import { light, dark, workedinScheme } from "./utils/Themes";
1010

1111
function App() {
1212
return (

client/src/Components/ChatComp/AllChats.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import axios from "axios";
22
import React, { useEffect, useState } from "react";
33
import styled from "styled-components";
4-
import { BASE_URL, chatEnd } from "../../Utils/APIRoutes";
5-
import { userProps } from "../../Utils/GlobalContants";
6-
import { getHeaders, getUserData } from "../../Utils/helperFunction";
4+
import { BASE_URL, chatEnd } from "../../utils/APIRoutes";
5+
import { userProps } from "../../utils/GlobalContants";
6+
import { getHeaders, getUserData } from "../../utils/helperFunction";
77
import CreateChatModal from "./CreateChatModal";
88

99
const Section = styled.div`

client/src/Components/ChatComp/ChatMembers.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import styled from "styled-components";
33
import { GiCrown } from "react-icons/gi";
44
import { AiOutlineDown } from "react-icons/ai";
55
import ChatOptions from "./ChatOptions";
6-
import { userProps } from "../../Utils/GlobalContants";
6+
import { userProps } from "../../utils/GlobalContants";
77
import UpdateChatModal from "./UpdateChatModal";
88
import ManageMembers from "./ManageMembers";
99

client/src/Components/ChatComp/ChatMessages.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import axios from "axios";
22
import React, { useEffect, useState } from "react";
33
import styled from "styled-components";
4-
import { BASE_URL, chatEnd } from "../../Utils/APIRoutes";
5-
import { userProps } from "../../Utils/GlobalContants";
6-
import { getHeaders } from "../../Utils/helperFunction";
4+
import { BASE_URL, chatEnd } from "../../utils/APIRoutes";
5+
import { userProps } from "../../utils/GlobalContants";
6+
import { getHeaders } from "../../utils/helperFunction";
77

88
import formatDistance from "date-fns/formatDistance";
99

client/src/Components/ChatComp/ChatOptions.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from "react";
22
import { AiOutlineDown, AiOutlineClose } from "react-icons/ai";
33
import { MdModeEdit } from "react-icons/md";
44
import styled from "styled-components";
5-
import { InvitePeople } from "../../Assets/InvitePeople";
5+
import { InvitePeople } from "../../assets/InvitePeople";
66
import { HiUserAdd } from 'react-icons/hi'
77

88
const Section = styled.div`

client/src/Components/ChatComp/CreateChatModal.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import axios from 'axios'
22
import React, { useState } from 'react'
33
import styled from 'styled-components'
4-
import { BASE_URL, chatEnd, searchUserEnd, userEnd } from '../../Utils/APIRoutes'
5-
import { userProps } from '../../Utils/GlobalContants'
6-
import { getHeaders } from '../../Utils/helperFunction'
4+
import { BASE_URL, chatEnd, searchUserEnd, userEnd } from '../../utils/APIRoutes'
5+
import { userProps } from '../../utils/GlobalContants'
6+
import { getHeaders } from '../../utils/helperFunction'
77
import { GrFormClose } from 'react-icons/gr'
88
import UserBadge from './UserBadge'
99
import SearchedUser from './SearchedUser'

client/src/Components/ChatComp/ManageMembers.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import axios from "axios";
22
import React, { useEffect, useState } from "react";
33
import styled from "styled-components";
4-
import { BASE_URL, chatEnd, searchUserEnd } from "../../Utils/APIRoutes";
5-
import { userProps } from "../../Utils/GlobalContants";
6-
import { getHeaders } from "../../Utils/helperFunction";
4+
import { BASE_URL, chatEnd, searchUserEnd } from "../../utils/APIRoutes";
5+
import { userProps } from "../../utils/GlobalContants";
6+
import { getHeaders } from "../../utils/helperFunction";
77
import SearchedUser from "./SearchedUser";
88

99
const Section = styled.div`

client/src/Components/HomeComp/CommentBox.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import axios from 'axios'
22
import React, { useEffect, useState } from 'react'
33
import styled from 'styled-components'
4-
import { BASE_URL, postEnd } from '../../Utils/APIRoutes'
5-
import { userProps } from '../../Utils/GlobalContants'
6-
import { getHeaders, getUserData } from '../../Utils/helperFunction'
4+
import { BASE_URL, postEnd } from '../../utils/APIRoutes'
5+
import { userProps } from '../../utils/GlobalContants'
6+
import { getHeaders, getUserData } from '../../utils/helperFunction'
77
import CommentFeed from './CommentFeed'
88
import CreateComment from './CreateComment'
99

client/src/Components/HomeComp/CommentFeed.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React, { useState, useEffect, useRef } from "react";
22
import styled from "styled-components";
3-
import { userProps } from "../../Utils/GlobalContants";
3+
import { userProps } from "../../utils/GlobalContants";
44
import { HiDotsVertical } from "react-icons/hi";
55
import CommentModal from "./CommentModal";
66
import axios from "axios";
7-
import { BASE_URL, postEnd } from "../../Utils/APIRoutes";
8-
import { getHeaders } from "../../Utils/helperFunction";
7+
import { BASE_URL, postEnd } from "../../utils/APIRoutes";
8+
import { getHeaders } from "../../utils/helperFunction";
99

1010
const Section = styled.div`
1111
/* display: flex; */

client/src/Components/HomeComp/CommentModal.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import axios from "axios";
22
import React from "react";
33
import styled from "styled-components";
4-
import { BASE_URL, postEnd } from "../../Utils/APIRoutes";
5-
import { userProps } from "../../Utils/GlobalContants";
6-
import { getHeaders } from "../../Utils/helperFunction";
4+
import { BASE_URL, postEnd } from "../../utils/APIRoutes";
5+
import { userProps } from "../../utils/GlobalContants";
6+
import { getHeaders } from "../../utils/helperFunction";
77

88
const Menu = styled.div`
99
position: absolute;

client/src/Components/HomeComp/CreateComment.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import axios from "axios";
22
import React, { useEffect, useState } from "react";
33
import styled from "styled-components";
4-
import { BASE_URL, postEnd } from "../../Utils/APIRoutes";
5-
import { userProps } from "../../Utils/GlobalContants";
6-
import { getHeaders } from "../../Utils/helperFunction";
4+
import { BASE_URL, postEnd } from "../../utils/APIRoutes";
5+
import { userProps } from "../../utils/GlobalContants";
6+
import { getHeaders } from "../../utils/helperFunction";
77

88
const Section = styled.div`
99
display: flex;

client/src/Components/HomeComp/CreatePost.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useEffect, useState } from "react";
22
import styled from "styled-components";
3-
import { localStorageUser, userProps } from "../../Utils/GlobalContants";
3+
import { localStorageUser, userProps } from "../../utils/GlobalContants";
44

55
const Section = styled.div`
66
height: 40vh;

client/src/Components/HomeComp/PostFeed.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import {
55
Share,
66
ThumbsUp,
77
ThumbsUp2,
8-
} from "../../Components/GeneralComp/SVG";
9-
import { BASE_URL, postEnd } from "../../Utils/APIRoutes";
10-
import { userProps } from "../../Utils/GlobalContants";
8+
} from "../../components/generalComp/SVG";
9+
import { BASE_URL, postEnd } from "../../utils/APIRoutes";
10+
import { userProps } from "../../utils/GlobalContants";
1111
import CommentBox from "./CommentBox";
1212

1313
const Section = styled.div`

client/src/Components/ProfileComp/Intro.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useEffect } from "react";
22
import styled from "styled-components";
3-
import { Pen } from "../GeneralComp/SVG";
3+
import { Pen } from "../generalComp/SVG";
44
import Socials from "./Socials";
55

66
const Section = styled.div`

client/src/Components/ProfileComp/Socials.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22
import styled, { keyframes } from "styled-components";
3-
import { Discord, Github, Linkedin, Portfolio, Twitter } from '../GeneralComp/SVG';
3+
import { Discord, Github, Linkedin, Portfolio, Twitter } from '../generalComp/SVG';
44

55

66
const animateSvg = keyframes`

client/src/Pages/Chats.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import React, { useState, useEffect } from 'react'
22
import styled from 'styled-components'
3-
import AllChats from '../Components/ChatComp/AllChats'
4-
import ChatMembers from '../Components/ChatComp/ChatMembers'
5-
import ChatMessages from '../Components/ChatComp/ChatMessages'
3+
import AllChats from '../components/chatComp/AllChats'
4+
import ChatMembers from '../components/chatComp/ChatMembers'
5+
import ChatMessages from '../components/chatComp/ChatMessages'
66

7-
import Navbar from '../Components/GeneralComp/Navbar'
8-
import { userProps } from '../Utils/GlobalContants'
9-
import { getUserData } from '../Utils/helperFunction'
7+
import Navbar from '../components/generalComp/Navbar'
8+
import { userProps } from '../utils/GlobalContants'
9+
import { getUserData } from '../utils/helperFunction'
1010

1111
const Section = styled.div`
1212
/* border: 1px solid red; */

client/src/Pages/Home.tsx

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import React, { useEffect, useState } from "react";
22
import styled from "styled-components";
3-
import CreatePost from "../Components/HomeComp/CreatePost";
4-
import Navbar from "../Components/GeneralComp/Navbar";
5-
import { BASE_URL, postEnd } from "../Utils/APIRoutes";
6-
import ProfileBriefBox from "../Components/HomeComp/ProfileBriefBox";
7-
import { apiProvider } from "../Utils/helperFunction";
8-
import ActivityBox from "../Components/HomeComp/ActivityBox";
9-
import PostFeed from "../Components/HomeComp/PostFeed";
10-
import { localStorageUser, userProps } from "../Utils/GlobalContants";
3+
import CreatePost from "../components/homeComp/CreatePost";
4+
import Navbar from "../components/generalComp/Navbar";
5+
import { BASE_URL, postEnd } from "../utils/APIRoutes";
6+
import ProfileBriefBox from "../components/homeComp/ProfileBriefBox";
7+
import { apiProvider } from "../utils/helperFunction";
8+
import ActivityBox from "../components/homeComp/ActivityBox";
9+
import PostFeed from "../components/homeComp/PostFeed";
10+
import { localStorageUser, userProps } from "../utils/GlobalContants";
1111

1212
const Section = styled.div`
1313
background-color: ${(props) => props.theme.grey};

client/src/Pages/Login.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import styled from 'styled-components'
44
import { ToastContainer, toast } from 'react-toastify';
55
import 'react-toastify/dist/ReactToastify.css';
66
import axios from 'axios'
7-
import { localStorageUser } from '../Utils/GlobalContants';
7+
import { localStorageUser } from '../utils/GlobalContants';
88

99
const Section = styled.div`
1010
height: 100vh;

client/src/Pages/Profile.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import React, { useEffect, useState } from "react";
22
import styled from "styled-components";
3-
import { localStorageUser, userProps } from "../Utils/GlobalContants";
3+
import { localStorageUser, userProps } from "../utils/GlobalContants";
44

5-
import Navbar from "../Components/GeneralComp/Navbar";
6-
import Intro from "../Components/ProfileComp/Intro";
7-
import NoSkill from "../Components/ProfileComp/NoSkill";
8-
import PastProjects from "../Components/ProfileComp/PastProjects";
9-
import Skills from "../Components/ProfileComp/Skills";
5+
import Navbar from "../components/generalComp/Navbar";
6+
import Intro from "../components/profileComp/Intro";
7+
import NoSkill from "../components/profileComp/NoSkill";
8+
import PastProjects from "../components/profileComp/PastProjects";
9+
import Skills from "../components/profileComp/Skills";
1010

1111
const Section = styled.div`
1212
/* border: 1px solid black; */

client/src/Pages/Register.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import styled from 'styled-components'
44
import { ToastContainer, toast } from 'react-toastify';
55
import 'react-toastify/dist/ReactToastify.css';
66
import axios from 'axios';
7-
import { localStorageUser } from '../Utils/GlobalContants';
7+
import { localStorageUser } from '../utils/GlobalContants';
88

99
const Section = styled.div`
1010
height: 100vh;

server/Controllers/authController.js controllers/authController.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
const User = require("../Models/userModel");
2-
const catchAsync = require("../Utils/catchAsync");
1+
const User = require("../models/userModel");
2+
const catchAsync = require("../utils/catchAsync");
33
const jwt = require("jsonwebtoken");
4-
const AppError = require("../Utils/appError");
4+
const AppError = require("../utils/appError");
55
const { promisify } = require("util");
66
const crypto = require("crypto");
7-
const Email = require("../Utils/email");
7+
const Email = require("../utils/email");
88

99
const signToken = (id) => {
1010
return jwt.sign({ id }, process.env.JWT_SECRET, {

server/Controllers/chatController.js controllers/chatController.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const Chat = require("../Models/chatModel");
2-
const User = require("../Models/userModel");
3-
const catchAsync = require("../Utils/catchAsync");
4-
const AppError = require("../Utils/appError");
1+
const Chat = require("../models/chatModel");
2+
const User = require("../models/userModel");
3+
const catchAsync = require("../utils/catchAsync");
4+
const AppError = require("../utils/appError");
55

66
exports.accessChat = catchAsync(async (req, res) => {
77
const { userId } = req.body;

server/Controllers/commentController.js controllers/commentController.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const Post = require('../Models/postModel');
2-
const Comment = require('../Models/commentModel')
3-
const catchAsync = require('../Utils/catchAsync')
4-
const AppError = require('../Utils/appError')
1+
const Post = require('../models/postModel');
2+
const Comment = require('../models/commentModel')
3+
const catchAsync = require('../utils/catchAsync')
4+
const AppError = require('../utils/appError')
55
const factory = require('./handlerFactory')
66

77
exports.setPostandUserIds = (req,res,next) => {

server/Controllers/contractController.js controllers/contractController.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
const Contract = require("../Models/contractModel");
2-
const User = require("../Models/userModel");
3-
const catchAsync = require("../Utils/catchAsync");
1+
const Contract = require("../models/contractModel");
2+
const User = require("../models/userModel");
3+
const catchAsync = require("../utils/catchAsync");
44

55
exports.getAllContracts = catchAsync(async (req, res) => {
66
const contracts = await Contract.find()

server/Controllers/errorController.js controllers/errorController.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const AppError = require('./../Utils/appError');
1+
const AppError = require('../utils/appError');
22

33
const handleCastErrorDB = err => {
44
const message = `Invalid ${err.path}: ${err.value}.`;

server/Controllers/handlerFactory.js controllers/handlerFactory.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const catchAsync = require("../Utils/catchAsync");
2-
const AppError = require("../Utils/appError");
3-
const APIFeatures = require("../Utils/apiFeatures");
4-
const User = require("../Models/userModel");
1+
const catchAsync = require("../utils/catchAsync");
2+
const AppError = require("../utils/appError");
3+
const APIFeatures = require("../utils/apiFeatures");
4+
const User = require("../models/userModel");
55

66

77
exports.deleteOne = (Model) =>

0 commit comments

Comments
 (0)