File tree 7 files changed +86
-93
lines changed
7 files changed +86
-93
lines changed Original file line number Diff line number Diff line change
1
+ SECRET_KEY=Your Secret string value
2
+ MONGO_URI=Your URI here
Original file line number Diff line number Diff line change 1
1
node_modules
2
- .env
2
+ .env
3
+
4
+
5
+ # testing
6
+ /coverage
7
+
8
+ # production
9
+ /build
10
+
11
+ # misc
12
+ .DS_Store
13
+ .env.local
14
+ .env.development.local
15
+ .env.test.local
16
+ .env.production.local
17
+
18
+ npm-debug.log *
19
+ yarn-debug.log *
20
+ yarn-error.log *
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
import React , { useEffect , useState } from 'react' ;
2
2
import jwt_decode from 'jwt-decode' ;
3
+ import './profile.styles.scss' ;
3
4
4
5
function Profile ( ) {
5
6
const [ first_name , setfirst_name ] = useState ( '' ) ;
@@ -17,32 +18,30 @@ function Profile() {
17
18
} , [ ] ) ;
18
19
19
20
return (
20
- < div className = "container" >
21
+ < div className = "profile- container" >
21
22
< div className = "" >
22
- < div className = "" >
23
- { email ? (
24
- < h1 className = "" > PROFILE</ h1 >
25
- ) : (
26
- < h2 > Please Login/Register to view this page</ h2 >
27
- ) }
28
- </ div >
29
- < table className = "" >
30
- < tbody >
31
- < tr >
32
- < td > { first_name ? 'Fist Name' : null } </ td >
33
- < td > { first_name } </ td >
34
- </ tr >
35
- < tr >
36
- < td > { last_name ? 'Last Name' : null } </ td >
37
- < td > { last_name } </ td >
38
- </ tr >
39
- < tr >
40
- < td > { email ? 'Email' : null } </ td >
41
- < td > { email } </ td >
42
- </ tr >
43
- </ tbody >
44
- </ table >
23
+ { email ? (
24
+ < h1 className = "" > PROFILE</ h1 >
25
+ ) : (
26
+ < h2 > Please Login/Register to view this page</ h2 >
27
+ ) }
45
28
</ div >
29
+ < table className = "" >
30
+ < tbody >
31
+ < tr >
32
+ < td > { first_name ? 'Fist Name:' : null } </ td >
33
+ < td > { first_name } </ td >
34
+ </ tr >
35
+ < tr >
36
+ < td > { last_name ? 'Last Name:' : null } </ td >
37
+ < td > { last_name } </ td >
38
+ </ tr >
39
+ < tr >
40
+ < td > { email ? 'Email:' : null } </ td >
41
+ < td > { email } </ td >
42
+ </ tr >
43
+ </ tbody >
44
+ </ table >
46
45
</ div >
47
46
) ;
48
47
}
Original file line number Diff line number Diff line change
1
+ .profile-container {
2
+ justify-content : center ;
3
+ align-items : center ;
4
+ display : flex ;
5
+ flex-direction : column ;
6
+ }
Original file line number Diff line number Diff line change
1
+ # MERN-Authentication
2
+
3
+ BoilerPlate of MERN Stack user authentication using REACT as frontend and MONGODB as backend.
4
+ [ ![ License: MIT] ( https://img.shields.io/badge/License-MIT-yellow.svg )] ( https://opensource.org/licenses/MIT )
5
+
6
+ ## Dependencies
7
+
8
+ - bcrypt
9
+ - cors
10
+ - axios
11
+ - express
12
+ - mongoose
13
+ - jwt
14
+
15
+ ## Installation
16
+
17
+ For starting Frontend Client
18
+
19
+ ``` sh
20
+ $ cd client/
21
+ $ npm install
22
+ $ npm start
23
+ ```
24
+
25
+ For starting Backend Server
26
+
27
+ ``` sh
28
+ $ npm install
29
+ $ npm run dev
30
+ ```
Original file line number Diff line number Diff line change
1
+ require ( 'dotenv' ) . config ( ) ;
2
+
1
3
const express = require ( 'express' ) ;
2
4
const cors = require ( 'cors' ) ;
3
5
const bodyParser = require ( 'body-parser' ) ;
@@ -10,8 +12,12 @@ app.use(bodyParser.json());
10
12
app . use ( cors ( ) ) ;
11
13
app . use ( bodyParser . urlencoded ( { extended : true } ) ) ;
12
14
15
+ // Local DataBase
13
16
const mongoURI = 'mongodb://localhost:27017/reactauthDB' ;
14
17
18
+ // MongoAtlas Datbase
19
+ // const mongoURI = process.env.MONGO_URI;
20
+
15
21
mongoose
16
22
. connect ( mongoURI , { useNewUrlParser : true , useUnifiedTopology : true } )
17
23
. then ( ( ) => console . log ( 'MONGODB connected' ) )
You can’t perform that action at this time.
0 commit comments