Browse Source

updated README.md 5 and checked that everything runs fine

dmr1725 4 years ago
parent
commit
a9e45b0f38

+ 6
- 5
README.md View File

38
 # Below are the steps to run the application
38
 # Below are the steps to run the application
39
 
39
 
40
 ### Step 1: Download repository
40
 ### Step 1: Download repository
41
-- Download the repository from this url: https://git.ccom.uprrp.edu/CCOM4030/companion_app/src/branch/master 
41
+- Download the repository from this url: **https://git.ccom.uprrp.edu/CCOM4030/companion_app/src/branch/master**
42
 
42
 
43
 
43
 
44
 ### Step 2: Go to the server directory and run in your terminal
44
 ### Step 2: Go to the server directory and run in your terminal
52
 
52
 
53
 ### Step 4: change directories in files
53
 ### Step 4: change directories in files
54
 - Go to **organizar/organizar.py** and change the paths in lines 4, 5 and 6 to your path
54
 - Go to **organizar/organizar.py** and change the paths in lines 4, 5 and 6 to your path
55
-Go to **server/CompanionApp/views.py** and change paths in lines 3, 54 and 101 to your path. **NOTE: in line 54 you need to change 2 paths**
55
+- Go to **server/CompanionApp/views.py** and change paths in lines 3, 54 and 101 to your path. **NOTE: in line 54 you need to change 2 paths**
56
 
56
 
57
 
57
 
58
 ### Step 5: make migrations of django project
58
 ### Step 5: make migrations of django project
98
 ### Step 10: create a social application 
98
 ### Step 10: create a social application 
99
 - Go to **server** directory in the terminal and type ‘**python manage.py runserver**’
99
 - Go to **server** directory in the terminal and type ‘**python manage.py runserver**’
100
 - Then, go this url ‘**http://127.0.0.1:8000/admin**’ and login as admin.
100
 - Then, go this url ‘**http://127.0.0.1:8000/admin**’ and login as admin.
101
-- Once logged in, go to the bottom of the page and click on ‘Social applications’ and then click on ‘ADD SOCIAL APPLICATION’
101
+- Once logged in, go to the bottom of the page and click on ‘**Social applications**’ and then click on ‘**ADD SOCIAL APPLICATION**
102
     - Provider: **Google**
102
     - Provider: **Google**
103
     - Name: **Google Login**
103
     - Name: **Google Login**
104
     - Client id: **116415331974-tf6sehooctplmmn7j0gt831mdf1oqipl.apps.googleusercontent.com**
104
     - Client id: **116415331974-tf6sehooctplmmn7j0gt831mdf1oqipl.apps.googleusercontent.com**
114
         - This will return a list of your sites [‘example.com’, ‘localhost:8000’]
114
         - This will return a list of your sites [‘example.com’, ‘localhost:8000’]
115
         - Step 3 will be the tricky part
115
         - Step 3 will be the tricky part
116
     - Run in your terminal: **Site.objects.get(id=1)**
116
     - Run in your terminal: **Site.objects.get(id=1)**
117
-        - If you get an error you will need to run the same command above, but adding one to id. You will continue to do this until you get a return value of localhost:8000. Example: **Site.objects.get(id=2)**, **Site.objects.get(id=3)**, **Site.objects.get(id=4)**... My guess is that your value will be where id is between 4 and 7
117
+        - If you get an error you will need to run the same command above, but adding one to id. You will continue to do this until you get a return value of **localhost:8000**. Example: **Site.objects.get(id=2)**, **Site.objects.get(id=3)**, **Site.objects.get(id=4)**... My guess is that your value will be where id is between 4 and 7
118
     - **Enter: ‘quit()’ in the shell**
118
     - **Enter: ‘quit()’ in the shell**
119
 - Once you get your site id, go to **server/restful/settings.py**
119
 - Once you get your site id, go to **server/restful/settings.py**
120
 - In settings.py go to line 76 and change the value from **SITE_ID** to your value and save the file
120
 - In settings.py go to line 76 and change the value from **SITE_ID** to your value and save the file
152
 ### Step 14: run the app
152
 ### Step 14: run the app
153
 - Open a terminal and go to the **client** directory and in your terminal and type ‘**npm start**’. After running successfully go to this url **http://localhost:19002**
153
 - Open a terminal and go to the **client** directory and in your terminal and type ‘**npm start**’. After running successfully go to this url **http://localhost:19002**
154
 - Open another terminal and go to the server directory and type ‘**python manage.py runserver**’
154
 - Open another terminal and go to the server directory and type ‘**python manage.py runserver**’
155
-- Use your phone to scan the qr code from expo and use CompanionApp
155
+- Use your phone to scan the qr code from expo and use CompanionApp. 
156
+- **It is mandatory that your phone uses the same wifi that your local computer is using** 
156
 
157
 
157
 
158
 
158
 # ADDITIONAL NOTES:
159
 # ADDITIONAL NOTES:

+ 2
- 2
client/Screens/AddTakenCourse.js View File

52
 
52
 
53
       let response = await axios({
53
       let response = await axios({
54
         method: 'POST',
54
         method: 'POST',
55
-        url: 'http://7f9219a069f7.ngrok.io/api/add_taken_course',
55
+        url: 'http://481cb6e289f9.ngrok.io/api/add_taken_course',
56
         headers: {
56
         headers: {
57
           'content-type': 'application/json',
57
           'content-type': 'application/json',
58
           Authorization: `Token ${token}`
58
           Authorization: `Token ${token}`
92
       const token = await SecureStore.getItemAsync('token')
92
       const token = await SecureStore.getItemAsync('token')
93
       const response = await axios({
93
       const response = await axios({
94
           method: 'GET',
94
           method: 'GET',
95
-          url: `http://7f9219a069f7.ngrok.io/api/find_course?code=${text}`,
95
+          url: `http://481cb6e289f9.ngrok.io/api/find_course?code=${text}`,
96
           headers: {
96
           headers: {
97
             'content-type': 'application/json',
97
             'content-type': 'application/json',
98
             Authorization: `Token ${token}`
98
             Authorization: `Token ${token}`

+ 1
- 1
client/Screens/Agenda.js View File

30
 
30
 
31
     let response = await axios({
31
     let response = await axios({
32
       method: 'POST',
32
       method: 'POST',
33
-      url: 'http://7f9219a069f7.ngrok.io/api/get_current_courses',
33
+      url: 'http://481cb6e289f9.ngrok.io/api/get_current_courses',
34
       headers: {
34
       headers: {
35
         'content-type': 'application/json',
35
         'content-type': 'application/json',
36
         Authorization: `Token ${token}`
36
         Authorization: `Token ${token}`

+ 2
- 2
client/Screens/CurrentCourses.js View File

54
         let user_id = parseInt(id)
54
         let user_id = parseInt(id)
55
 
55
 
56
         try {
56
         try {
57
-            let response = await axios(`http://7f9219a069f7.ngrok.io/api/get_current_courses`, {
57
+            let response = await axios(`http://481cb6e289f9.ngrok.io/api/get_current_courses`, {
58
                 method: 'POST',
58
                 method: 'POST',
59
                 headers: {
59
                 headers: {
60
                     'content-type': 'application/json',
60
                     'content-type': 'application/json',
86
         console.log(year)
86
         console.log(year)
87
 
87
 
88
         try {
88
         try {
89
-            let response = await axios(`http://7f9219a069f7.ngrok.io/api/delete_course`, {
89
+            let response = await axios(`http://481cb6e289f9.ngrok.io/api/delete_course`, {
90
                 method: 'DELETE',
90
                 method: 'DELETE',
91
                 headers: {
91
                 headers: {
92
                     'content-type': 'application/json',
92
                     'content-type': 'application/json',

+ 3
- 3
client/Screens/EditGrades.js View File

50
         console.log(user_id)
50
         console.log(user_id)
51
 
51
 
52
         try {
52
         try {
53
-            let response = await axios(`http://7f9219a069f7.ngrok.io/api/get_all_courses_by_semester?user_id=${user_id}&year=${year}&semestre=${semester}`, {
53
+            let response = await axios(`http://481cb6e289f9.ngrok.io/api/get_all_courses_by_semester?user_id=${user_id}&year=${year}&semestre=${semester}`, {
54
                 method: 'GET',
54
                 method: 'GET',
55
                 headers: {
55
                 headers: {
56
                     'content-type': 'application/json',
56
                     'content-type': 'application/json',
72
         let user_id = parseInt(id)
72
         let user_id = parseInt(id)
73
 
73
 
74
         try {
74
         try {
75
-            let response = await axios(`http://7f9219a069f7.ngrok.io/api/delete_course`, {
75
+            let response = await axios(`http://481cb6e289f9.ngrok.io/api/delete_course`, {
76
                 method: 'DELETE',
76
                 method: 'DELETE',
77
                 headers: {
77
                 headers: {
78
                     'content-type': 'application/json',
78
                     'content-type': 'application/json',
117
         console.log(year)
117
         console.log(year)
118
 
118
 
119
         try {
119
         try {
120
-            let response = await axios(`http://7f9219a069f7.ngrok.io/api/update_grade_and_gpa`, {
120
+            let response = await axios(`http://481cb6e289f9.ngrok.io/api/update_grade_and_gpa`, {
121
                 method: 'PATCH',
121
                 method: 'PATCH',
122
                 headers: {
122
                 headers: {
123
                     'content-type': 'application/json',
123
                     'content-type': 'application/json',

+ 2
- 2
client/Screens/EnrollNextSemester.js View File

55
 
55
 
56
       let response = await axios({
56
       let response = await axios({
57
         method: 'POST',
57
         method: 'POST',
58
-        url: 'http://7f9219a069f7.ngrok.io/api/matricular_prox_semestre',
58
+        url: 'http://481cb6e289f9.ngrok.io/api/matricular_prox_semestre',
59
         headers: {
59
         headers: {
60
           'content-type': 'application/json',
60
           'content-type': 'application/json',
61
           Authorization: `Token ${token}`
61
           Authorization: `Token ${token}`
93
       const token = await SecureStore.getItemAsync('token')
93
       const token = await SecureStore.getItemAsync('token')
94
       const response = await axios({
94
       const response = await axios({
95
           method: 'GET',
95
           method: 'GET',
96
-          url: `http://7f9219a069f7.ngrok.io/api/select_course_prox_semestre?code=${text}`,
96
+          url: `http://481cb6e289f9.ngrok.io/api/select_course_prox_semestre?code=${text}`,
97
           headers: {
97
           headers: {
98
             'content-type': 'application/json',
98
             'content-type': 'application/json',
99
             Authorization: `Token ${token}`
99
             Authorization: `Token ${token}`

+ 1
- 1
client/Screens/HomeScreen.js View File

12
     console.log(token, id)
12
     console.log(token, id)
13
 
13
 
14
     let response = await Axios({
14
     let response = await Axios({
15
-      url: 'http://7f9219a069f7.ngrok.io/api/hello',
15
+      url: 'http://481cb6e289f9.ngrok.io/api/hello',
16
       method: 'GET',
16
       method: 'GET',
17
       headers: {
17
       headers: {
18
           Authorization: `Token ${token}`
18
           Authorization: `Token ${token}`

+ 2
- 2
client/Screens/Login.js View File

43
 
43
 
44
         try {
44
         try {
45
           // login user in backend
45
           // login user in backend
46
-          let response = await fetch('http://7f9219a069f7.ngrok.io/rest-auth/google/', {
46
+          let response = await fetch('http://481cb6e289f9.ngrok.io/rest-auth/google/', {
47
             method: 'POST',
47
             method: 'POST',
48
             headers: {
48
             headers: {
49
               'content-type': 'application/json'
49
               'content-type': 'application/json'
64
           const token = await SecureStore.getItemAsync('token')
64
           const token = await SecureStore.getItemAsync('token')
65
 
65
 
66
           // storing our id
66
           // storing our id
67
-          let id = await fetch('http://7f9219a069f7.ngrok.io/api/get_user_id', {
67
+          let id = await fetch('http://481cb6e289f9.ngrok.io/api/get_user_id', {
68
             method: 'GET',
68
             method: 'GET',
69
             headers: {
69
             headers: {
70
               'content-type': 'application/json',
70
               'content-type': 'application/json',

+ 1
- 1
client/Screens/Logout.js View File

10
       
10
       
11
       let response = await Axios({
11
       let response = await Axios({
12
         method: 'POST',
12
         method: 'POST',
13
-        url: 'http://7f9219a069f7.ngrok.io/api/logout',
13
+        url: 'http://481cb6e289f9.ngrok.io/api/logout',
14
         headers: {
14
         headers: {
15
           'content-type': 'application/json',
15
           'content-type': 'application/json',
16
           Authorization: `Token ${token}`
16
           Authorization: `Token ${token}`

+ 2
- 2
client/Screens/MyCurriculum.js View File

20
         let user_id = parseInt(id)
20
         let user_id = parseInt(id)
21
 
21
 
22
         try {
22
         try {
23
-            let response = await axios('http://7f9219a069f7.ngrok.io/api/see_gpa', {
23
+            let response = await axios('http://481cb6e289f9.ngrok.io/api/see_gpa', {
24
                 method: 'POST',
24
                 method: 'POST',
25
                 headers: {
25
                 headers: {
26
                     Authorization: `Token ${token}`
26
                     Authorization: `Token ${token}`
43
         let numbers = []
43
         let numbers = []
44
 
44
 
45
         try {
45
         try {
46
-            let response = await axios(`http://7f9219a069f7.ngrok.io/api/get_all_courses_by_semester?user_id=${user_id}&year=${year}&semestre=${semester}`, {
46
+            let response = await axios(`http://481cb6e289f9.ngrok.io/api/get_all_courses_by_semester?user_id=${user_id}&year=${year}&semestre=${semester}`, {
47
                 method: 'GET',
47
                 method: 'GET',
48
                 headers: {
48
                 headers: {
49
                     'content-type': 'application/json',
49
                     'content-type': 'application/json',

+ 2
- 2
client/Screens/UpdateSemYear.js View File

21
 
21
 
22
         let response = await axios({
22
         let response = await axios({
23
         method: 'PATCH',
23
         method: 'PATCH',
24
-        url: 'http://7f9219a069f7.ngrok.io/api/update_year_and_semester',
24
+        url: 'http://481cb6e289f9.ngrok.io/api/update_year_and_semester',
25
         headers: {
25
         headers: {
26
             'content-type': 'application/json',
26
             'content-type': 'application/json',
27
             Authorization: `Token ${token}`
27
             Authorization: `Token ${token}`
48
 
48
 
49
       let response = await axios({
49
       let response = await axios({
50
         method: 'POST',
50
         method: 'POST',
51
-        url: 'http://7f9219a069f7.ngrok.io/api/get_year_and_semester',
51
+        url: 'http://481cb6e289f9.ngrok.io/api/get_year_and_semester',
52
         headers: {
52
         headers: {
53
           'content-type': 'application/json',
53
           'content-type': 'application/json',
54
           Authorization: `Token ${token}`
54
           Authorization: `Token ${token}`

BIN
server/restful/__pycache__/settings.cpython-38.pyc View File