Showing
115 changed files
with
2176 additions
and
72 deletions
archive/.gitignore
0 → 100644
archive/README.md
0 → 100644
1 | +# Capstone design | ||
2 | + | ||
3 | +1st semester capstone design project | ||
4 | + | ||
5 | +Subject : Making website in order to practice latest web technologies | ||
6 | + | ||
7 | +sub-subject : making chat site using JS | ||
8 | + | ||
9 | +# Schedule | ||
10 | + | ||
11 | +- 4/6 ~ 4/12 | ||
12 | +- [x] Set development environment | ||
13 | + | ||
14 | + (tech : react.js, react hooks, styled-components, GraphQL, Prisma, Apollo, AWS, Docker) | ||
15 | + | ||
16 | +- 4/13 ~ 4/19 | ||
17 | +- [x] login, sign up (using JWT, sendGrid), Create Docker-compose | ||
18 | + | ||
19 | +- 4/20 ~ 4/26 | ||
20 | +- [ ] Find ID, PW | ||
21 | + | ||
22 | +- 4/27 ~ 5/3 | ||
23 | +- [ ] Make chat room (using GraphQL's subscription) | ||
24 | + | ||
25 | +- 5/4 ~ 5/10 | ||
26 | +- [ ] Mid-term exam, Debugging | ||
27 | + | ||
28 | +- 5/11 ~ 5/17 | ||
29 | +- [ ] Plan chat category and make code | ||
30 | + | ||
31 | +- 5/18 ~ 5/24 | ||
32 | +- [ ] Debugging for code created in 6th week's plan | ||
33 | + | ||
34 | +- 5/25 ~ 5/31 | ||
35 | +- [ ] Plan a matching strategy for random chat | ||
36 | + | ||
37 | +- 6/1 ~ 6/7 | ||
38 | +- [ ] Make a code based on the matching plan created in 8th week's plan | ||
39 | + | ||
40 | +- 6/8 ~ 6/14 | ||
41 | +- [ ] Debugging for whole codes in our project | ||
42 | + | ||
43 | +- 6/15 ~ 6/21 | ||
44 | +- [ ] Deploy project in AWS amplify | ||
45 | + | ||
46 | +- 6/22 ~ 6/26 | ||
47 | +- [ ] Final exam, review project |
archive/back/.babelrc
0 → 100644
archive/back/.dockerignore
0 → 100644
1 | +node_modules | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
archive/back/.gitignore
0 → 100644
archive/back/Dockerfile
0 → 100644
archive/back/README.md
0 → 100644
1 | +# Capstone design | ||
2 | + | ||
3 | +1st semester capstone design project | ||
4 | + | ||
5 | +Subject : Making website in order to practice latest web technologies | ||
6 | + | ||
7 | +sub-subject : making chat site using JS | ||
8 | + | ||
9 | +# Schedule | ||
10 | + | ||
11 | +- 4/6 ~ 4/12 | ||
12 | +- [x] Set development environment | ||
13 | + | ||
14 | + (tech : react.js, react hooks, styled-components, GraphQL, Prisma, Apollo, AWS, Docker) | ||
15 | + | ||
16 | +- 4/13 ~ 4/19 | ||
17 | +- [x] login, sign up (using JWT, sendGrid), Create Docker-compose | ||
18 | + | ||
19 | +- 4/20 ~ 4/26 | ||
20 | +- [ ] Find ID, PW | ||
21 | + | ||
22 | +- 4/27 ~ 5/3 | ||
23 | +- [ ] Make chat room (using GraphQL's subscription) | ||
24 | + | ||
25 | +- 5/4 ~ 5/10 | ||
26 | +- [ ] Mid-term exam, Debugging | ||
27 | + | ||
28 | +- 5/11 ~ 5/17 | ||
29 | +- [ ] Plan chat category and make code | ||
30 | + | ||
31 | +- 5/18 ~ 5/24 | ||
32 | +- [ ] Debugging for code created in 6th week's plan | ||
33 | + | ||
34 | +- 5/25 ~ 5/31 | ||
35 | +- [ ] Plan a matching strategy for random chat | ||
36 | + | ||
37 | +- 6/1 ~ 6/7 | ||
38 | +- [ ] Make a code based on the matching plan created in 8th week's plan | ||
39 | + | ||
40 | +- 6/8 ~ 6/14 | ||
41 | +- [ ] Debugging for whole codes in our project | ||
42 | + | ||
43 | +- 6/15 ~ 6/21 | ||
44 | +- [ ] Deploy project in AWS amplify | ||
45 | + | ||
46 | +- 6/22 ~ 6/26 | ||
47 | +- [ ] Final exam, review project |
archive/back/nodemon.json
0 → 100644
archive/back/package-lock.json
0 → 100644
This diff could not be displayed because it is too large.
archive/back/package.json
0 → 100644
1 | +{ | ||
2 | + "name": "capstone-back", | ||
3 | + "version": "1.0.0", | ||
4 | + "description": "1st semester capstone design project", | ||
5 | + "scripts": { | ||
6 | + "start": "nodemon --exec babel-node src/server.js", | ||
7 | + "prisma": "prisma2 studio --experimental" | ||
8 | + }, | ||
9 | + "repository": { | ||
10 | + "type": "git", | ||
11 | + "url": "git+https://vel1024@bitbucket.org/vel1024/capstone2.git" | ||
12 | + }, | ||
13 | + "author": "sdy, kms", | ||
14 | + "license": "ISC", | ||
15 | + "homepage": "https://bitbucket.org/vel1024/capstone2#readme", | ||
16 | + "dependencies": { | ||
17 | + "@prisma/client": "^2.0.0-beta.2", | ||
18 | + "bcryptjs": "^2.4.3", | ||
19 | + "dotenv": "^8.2.0", | ||
20 | + "graphql-tools": "^4.0.7", | ||
21 | + "graphql-yoga": "^1.18.3", | ||
22 | + "jsonwebtoken": "^8.5.1", | ||
23 | + "merge-graphql-schemas": "^1.7.7", | ||
24 | + "nodemailer": "^6.4.6", | ||
25 | + "nodemailer-sendgrid-transport": "^0.2.0", | ||
26 | + "twilio": "^3.42.2" | ||
27 | + }, | ||
28 | + "devDependencies": { | ||
29 | + "@babel/core": "^7.9.0", | ||
30 | + "@babel/node": "^7.8.7", | ||
31 | + "@babel/preset-env": "^7.9.0", | ||
32 | + "@prisma/cli": "^2.0.0-beta.2", | ||
33 | + "morgan": "^1.10.0", | ||
34 | + "nodemon": "^2.0.2" | ||
35 | + } | ||
36 | +} |
archive/back/prisma/Dockerfile
0 → 100644
1 | +# Migration `20200419160117-init` | ||
2 | + | ||
3 | +This migration has been generated by sdy at 4/19/2020, 4:01:17 PM. | ||
4 | +You can check out the [state of the schema](./schema.prisma) after the migration. | ||
5 | + | ||
6 | +## Database Steps | ||
7 | + | ||
8 | +```sql | ||
9 | +CREATE TABLE `chat_schema`.`User` ( | ||
10 | + `avatarUrl` varchar(191) , | ||
11 | + `bio` varchar(191) , | ||
12 | + `createdAt` datetime DEFAULT CURRENT_TIMESTAMP , | ||
13 | + `email` varchar(191) NOT NULL , | ||
14 | + `id` int NOT NULL AUTO_INCREMENT, | ||
15 | + `loginSecret` varchar(191) , | ||
16 | + `name` varchar(191) NOT NULL , | ||
17 | + `password` varchar(191) NOT NULL , | ||
18 | + PRIMARY KEY (`id`) | ||
19 | +) | ||
20 | +DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci | ||
21 | + | ||
22 | +CREATE TABLE `chat_schema`.`Room` ( | ||
23 | + `id` int NOT NULL AUTO_INCREMENT, | ||
24 | + PRIMARY KEY (`id`) | ||
25 | +) | ||
26 | +DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci | ||
27 | + | ||
28 | +CREATE TABLE `chat_schema`.`Category` ( | ||
29 | + `id` int NOT NULL AUTO_INCREMENT, | ||
30 | + `name` varchar(191) DEFAULT '' , | ||
31 | + PRIMARY KEY (`id`) | ||
32 | +) | ||
33 | +DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci | ||
34 | + | ||
35 | +CREATE TABLE `chat_schema`.`Message` ( | ||
36 | + `id` int NOT NULL AUTO_INCREMENT, | ||
37 | + `senderId` int NOT NULL , | ||
38 | + `text` varchar(191) DEFAULT '' , | ||
39 | + PRIMARY KEY (`id`) | ||
40 | +) | ||
41 | +DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci | ||
42 | + | ||
43 | +CREATE TABLE `chat_schema`.`_RoomToUser` ( | ||
44 | + `A` int NOT NULL , | ||
45 | + `B` int NOT NULL | ||
46 | +) | ||
47 | +DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci | ||
48 | + | ||
49 | +CREATE TABLE `chat_schema`.`_CategoryToRoom` ( | ||
50 | + `A` int NOT NULL , | ||
51 | + `B` int NOT NULL | ||
52 | +) | ||
53 | +DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci | ||
54 | + | ||
55 | +CREATE UNIQUE INDEX `User.email` ON `chat_schema`.`User`(`email`) | ||
56 | + | ||
57 | +CREATE UNIQUE INDEX `_RoomToUser_AB_unique` ON `chat_schema`.`_RoomToUser`(`A`,`B`) | ||
58 | + | ||
59 | +CREATE INDEX `_RoomToUser_B_index` ON `chat_schema`.`_RoomToUser`(`B`) | ||
60 | + | ||
61 | +CREATE UNIQUE INDEX `_CategoryToRoom_AB_unique` ON `chat_schema`.`_CategoryToRoom`(`A`,`B`) | ||
62 | + | ||
63 | +CREATE INDEX `_CategoryToRoom_B_index` ON `chat_schema`.`_CategoryToRoom`(`B`) | ||
64 | + | ||
65 | +ALTER TABLE `chat_schema`.`Message` ADD FOREIGN KEY (`senderId`) REFERENCES `chat_schema`.`User`(`id`) ON DELETE CASCADE ON UPDATE CASCADE | ||
66 | + | ||
67 | +ALTER TABLE `chat_schema`.`_RoomToUser` ADD FOREIGN KEY (`A`) REFERENCES `chat_schema`.`Room`(`id`) ON DELETE CASCADE ON UPDATE CASCADE | ||
68 | + | ||
69 | +ALTER TABLE `chat_schema`.`_RoomToUser` ADD FOREIGN KEY (`B`) REFERENCES `chat_schema`.`User`(`id`) ON DELETE CASCADE ON UPDATE CASCADE | ||
70 | + | ||
71 | +ALTER TABLE `chat_schema`.`_CategoryToRoom` ADD FOREIGN KEY (`A`) REFERENCES `chat_schema`.`Category`(`id`) ON DELETE CASCADE ON UPDATE CASCADE | ||
72 | + | ||
73 | +ALTER TABLE `chat_schema`.`_CategoryToRoom` ADD FOREIGN KEY (`B`) REFERENCES `chat_schema`.`Room`(`id`) ON DELETE CASCADE ON UPDATE CASCADE | ||
74 | + | ||
75 | +DROP TABLE `chat_schema`.`_migration`; | ||
76 | + | ||
77 | +DROP TABLE `chat_schema`.`test`; | ||
78 | +``` | ||
79 | + | ||
80 | +## Changes | ||
81 | + | ||
82 | +```diff | ||
83 | +diff --git schema.prisma schema.prisma | ||
84 | +migration ..20200419160117-init | ||
85 | +--- datamodel.dml | ||
86 | ++++ datamodel.dml | ||
87 | +@@ -1,0 +1,41 @@ | ||
88 | ++generator client { | ||
89 | ++ provider = "prisma-client-js" | ||
90 | ++ binaryTargets = ["native", "debian-openssl-1.1.x"] | ||
91 | ++} | ||
92 | ++ | ||
93 | ++datasource db { | ||
94 | ++ provider = "mysql" | ||
95 | ++ url = env("DATABASE_URL") | ||
96 | ++} | ||
97 | ++ | ||
98 | ++model User { | ||
99 | ++ id Int @default(autoincrement()) @id | ||
100 | ++ avatarUrl String? | ||
101 | ++ email String @unique | ||
102 | ++ password String | ||
103 | ++ name String | ||
104 | ++ loginSecret String? | ||
105 | ++ bio String? | ||
106 | ++ rooms Room[] @relation(references: [id]) | ||
107 | ++ messages Message[] | ||
108 | ++ createdAt DateTime? @default(now()) | ||
109 | ++} | ||
110 | ++ | ||
111 | ++model Room { | ||
112 | ++ id Int @default(autoincrement()) @id | ||
113 | ++ participants User[] @relation(references: [id]) | ||
114 | ++ categories Category[] @relation(references: [id]) | ||
115 | ++} | ||
116 | ++ | ||
117 | ++model Category { | ||
118 | ++ id Int @default(autoincrement()) @id | ||
119 | ++ name String? @default("") | ||
120 | ++ rooms Room[] @relation(references: [id]) | ||
121 | ++} | ||
122 | ++ | ||
123 | ++model Message { | ||
124 | ++ id Int @default(autoincrement()) @id | ||
125 | ++ text String? @default("") | ||
126 | ++ sender User @relation(fields: [senderId], references: [id]) | ||
127 | ++ senderId Int | ||
128 | ++} | ||
129 | +``` | ||
130 | + | ||
131 | + |
1 | +generator client { | ||
2 | + provider = "prisma-client-js" | ||
3 | + binaryTargets = ["native", "debian-openssl-1.1.x"] | ||
4 | +} | ||
5 | + | ||
6 | +datasource db { | ||
7 | + provider = "mysql" | ||
8 | + url = "***" | ||
9 | +} | ||
10 | + | ||
11 | +model User { | ||
12 | + id Int @default(autoincrement()) @id | ||
13 | + avatarUrl String? | ||
14 | + email String @unique | ||
15 | + password String | ||
16 | + name String | ||
17 | + loginSecret String? | ||
18 | + bio String? | ||
19 | + rooms Room[] @relation(references: [id]) | ||
20 | + messages Message[] | ||
21 | + createdAt DateTime? @default(now()) | ||
22 | +} | ||
23 | + | ||
24 | +model Room { | ||
25 | + id Int @default(autoincrement()) @id | ||
26 | + participants User[] @relation(references: [id]) | ||
27 | + categories Category[] @relation(references: [id]) | ||
28 | +} | ||
29 | + | ||
30 | +model Category { | ||
31 | + id Int @default(autoincrement()) @id | ||
32 | + name String? @default("") | ||
33 | + rooms Room[] @relation(references: [id]) | ||
34 | +} | ||
35 | + | ||
36 | +model Message { | ||
37 | + id Int @default(autoincrement()) @id | ||
38 | + text String? @default("") | ||
39 | + sender User @relation(fields: [senderId], references: [id]) | ||
40 | + senderId Int | ||
41 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
This diff is collapsed. Click to expand it.
1 | +# Migration `20200424124259-init` | ||
2 | + | ||
3 | +This migration has been generated by sdy at 4/24/2020, 12:42:59 PM. | ||
4 | +You can check out the [state of the schema](./schema.prisma) after the migration. | ||
5 | + | ||
6 | +## Database Steps | ||
7 | + | ||
8 | +```sql | ||
9 | +CREATE TABLE `chat_schema`.`User` ( | ||
10 | + `avatarUrl` varchar(191) , | ||
11 | + `bio` varchar(191) , | ||
12 | + `createdAt` datetime DEFAULT CURRENT_TIMESTAMP , | ||
13 | + `email` varchar(191) NOT NULL , | ||
14 | + `emailSecret` varchar(191) , | ||
15 | + `id` int NOT NULL AUTO_INCREMENT, | ||
16 | + `name` varchar(191) NOT NULL , | ||
17 | + `password` varchar(191) NOT NULL , | ||
18 | + `phoneNumber` int , | ||
19 | + `phoneSecret` varchar(191) , | ||
20 | + PRIMARY KEY (`id`) | ||
21 | +) | ||
22 | +DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci | ||
23 | + | ||
24 | +CREATE TABLE `chat_schema`.`Room` ( | ||
25 | + `id` int NOT NULL AUTO_INCREMENT, | ||
26 | + PRIMARY KEY (`id`) | ||
27 | +) | ||
28 | +DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci | ||
29 | + | ||
30 | +CREATE TABLE `chat_schema`.`Category` ( | ||
31 | + `id` int NOT NULL AUTO_INCREMENT, | ||
32 | + `name` varchar(191) DEFAULT '' , | ||
33 | + PRIMARY KEY (`id`) | ||
34 | +) | ||
35 | +DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci | ||
36 | + | ||
37 | +CREATE TABLE `chat_schema`.`Message` ( | ||
38 | + `id` int NOT NULL AUTO_INCREMENT, | ||
39 | + `senderId` int NOT NULL , | ||
40 | + `text` varchar(191) DEFAULT '' , | ||
41 | + PRIMARY KEY (`id`) | ||
42 | +) | ||
43 | +DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci | ||
44 | + | ||
45 | +CREATE TABLE `chat_schema`.`_RoomToUser` ( | ||
46 | + `A` int NOT NULL , | ||
47 | + `B` int NOT NULL | ||
48 | +) | ||
49 | +DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci | ||
50 | + | ||
51 | +CREATE TABLE `chat_schema`.`_CategoryToRoom` ( | ||
52 | + `A` int NOT NULL , | ||
53 | + `B` int NOT NULL | ||
54 | +) | ||
55 | +DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci | ||
56 | + | ||
57 | +CREATE UNIQUE INDEX `User.email` ON `chat_schema`.`User`(`email`) | ||
58 | + | ||
59 | +CREATE UNIQUE INDEX `_RoomToUser_AB_unique` ON `chat_schema`.`_RoomToUser`(`A`,`B`) | ||
60 | + | ||
61 | +CREATE INDEX `_RoomToUser_B_index` ON `chat_schema`.`_RoomToUser`(`B`) | ||
62 | + | ||
63 | +CREATE UNIQUE INDEX `_CategoryToRoom_AB_unique` ON `chat_schema`.`_CategoryToRoom`(`A`,`B`) | ||
64 | + | ||
65 | +CREATE INDEX `_CategoryToRoom_B_index` ON `chat_schema`.`_CategoryToRoom`(`B`) | ||
66 | + | ||
67 | +ALTER TABLE `chat_schema`.`Message` ADD FOREIGN KEY (`senderId`) REFERENCES `chat_schema`.`User`(`id`) ON DELETE CASCADE ON UPDATE CASCADE | ||
68 | + | ||
69 | +ALTER TABLE `chat_schema`.`_RoomToUser` ADD FOREIGN KEY (`A`) REFERENCES `chat_schema`.`Room`(`id`) ON DELETE CASCADE ON UPDATE CASCADE | ||
70 | + | ||
71 | +ALTER TABLE `chat_schema`.`_RoomToUser` ADD FOREIGN KEY (`B`) REFERENCES `chat_schema`.`User`(`id`) ON DELETE CASCADE ON UPDATE CASCADE | ||
72 | + | ||
73 | +ALTER TABLE `chat_schema`.`_CategoryToRoom` ADD FOREIGN KEY (`A`) REFERENCES `chat_schema`.`Category`(`id`) ON DELETE CASCADE ON UPDATE CASCADE | ||
74 | + | ||
75 | +ALTER TABLE `chat_schema`.`_CategoryToRoom` ADD FOREIGN KEY (`B`) REFERENCES `chat_schema`.`Room`(`id`) ON DELETE CASCADE ON UPDATE CASCADE | ||
76 | + | ||
77 | +DROP TABLE `chat_schema`.`_categorytoroom`; | ||
78 | + | ||
79 | +DROP TABLE `chat_schema`.`_migration`; | ||
80 | + | ||
81 | +DROP TABLE `chat_schema`.`_roomtouser`; | ||
82 | + | ||
83 | +DROP TABLE `chat_schema`.`category`; | ||
84 | + | ||
85 | +DROP TABLE `chat_schema`.`message`; | ||
86 | + | ||
87 | +DROP TABLE `chat_schema`.`room`; | ||
88 | + | ||
89 | +DROP TABLE `chat_schema`.`test`; | ||
90 | + | ||
91 | +DROP TABLE `chat_schema`.`user`; | ||
92 | +``` | ||
93 | + | ||
94 | +## Changes | ||
95 | + | ||
96 | +```diff | ||
97 | +diff --git schema.prisma schema.prisma | ||
98 | +migration 20200419160117-init..20200424124259-init | ||
99 | +--- datamodel.dml | ||
100 | ++++ datamodel.dml | ||
101 | +@@ -4,18 +4,20 @@ | ||
102 | + } | ||
103 | + datasource db { | ||
104 | + provider = "mysql" | ||
105 | +- url = "***" | ||
106 | ++ url = env("DATABASE_URL") | ||
107 | + } | ||
108 | + model User { | ||
109 | + id Int @default(autoincrement()) @id | ||
110 | + avatarUrl String? | ||
111 | + email String @unique | ||
112 | + password String | ||
113 | + name String | ||
114 | +- loginSecret String? | ||
115 | ++ phoneNumber Int? | ||
116 | ++ emailSecret String? | ||
117 | ++ phoneSecret String? | ||
118 | + bio String? | ||
119 | + rooms Room[] @relation(references: [id]) | ||
120 | + messages Message[] | ||
121 | + createdAt DateTime? @default(now()) | ||
122 | +``` | ||
123 | + | ||
124 | + |
1 | +generator client { | ||
2 | + provider = "prisma-client-js" | ||
3 | + binaryTargets = ["native", "debian-openssl-1.1.x"] | ||
4 | +} | ||
5 | + | ||
6 | +datasource db { | ||
7 | + provider = "mysql" | ||
8 | + url = "***" | ||
9 | +} | ||
10 | + | ||
11 | +model User { | ||
12 | + id Int @default(autoincrement()) @id | ||
13 | + avatarUrl String? | ||
14 | + email String @unique | ||
15 | + password String | ||
16 | + name String | ||
17 | + phoneNumber Int? | ||
18 | + emailSecret String? | ||
19 | + phoneSecret String? | ||
20 | + bio String? | ||
21 | + rooms Room[] @relation(references: [id]) | ||
22 | + messages Message[] | ||
23 | + createdAt DateTime? @default(now()) | ||
24 | +} | ||
25 | + | ||
26 | +model Room { | ||
27 | + id Int @default(autoincrement()) @id | ||
28 | + participants User[] @relation(references: [id]) | ||
29 | + categories Category[] @relation(references: [id]) | ||
30 | +} | ||
31 | + | ||
32 | +model Category { | ||
33 | + id Int @default(autoincrement()) @id | ||
34 | + name String? @default("") | ||
35 | + rooms Room[] @relation(references: [id]) | ||
36 | +} | ||
37 | + | ||
38 | +model Message { | ||
39 | + id Int @default(autoincrement()) @id | ||
40 | + text String? @default("") | ||
41 | + sender User @relation(fields: [senderId], references: [id]) | ||
42 | + senderId Int | ||
43 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +{ | ||
2 | + "version": "0.3.14-fixed", | ||
3 | + "steps": [ | ||
4 | + { | ||
5 | + "tag": "CreateField", | ||
6 | + "model": "User", | ||
7 | + "field": "phoneNumber", | ||
8 | + "type": "Int", | ||
9 | + "arity": "Optional" | ||
10 | + }, | ||
11 | + { | ||
12 | + "tag": "CreateField", | ||
13 | + "model": "User", | ||
14 | + "field": "emailSecret", | ||
15 | + "type": "String", | ||
16 | + "arity": "Optional" | ||
17 | + }, | ||
18 | + { | ||
19 | + "tag": "CreateField", | ||
20 | + "model": "User", | ||
21 | + "field": "phoneSecret", | ||
22 | + "type": "String", | ||
23 | + "arity": "Optional" | ||
24 | + }, | ||
25 | + { | ||
26 | + "tag": "DeleteField", | ||
27 | + "model": "User", | ||
28 | + "field": "loginSecret" | ||
29 | + } | ||
30 | + ] | ||
31 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
archive/back/prisma/migrations/migrate.lock
0 → 100644
1 | +# IF THERE'S A GIT CONFLICT IN THIS FILE, DON'T SOLVE IT MANUALLY! | ||
2 | +# INSTEAD EXECUTE `prisma migrate fix` | ||
3 | +# Prisma Migrate lockfile v1 | ||
4 | +# Read more about conflict resolution here: TODO | ||
5 | + | ||
6 | +20200419160117-init | ||
7 | +20200424124259-init | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
archive/back/prisma/schema.prisma
0 → 100644
1 | +generator client { | ||
2 | + provider = "prisma-client-js" | ||
3 | + binaryTargets = ["native", "debian-openssl-1.1.x"] | ||
4 | +} | ||
5 | + | ||
6 | +datasource db { | ||
7 | + provider = "mysql" | ||
8 | + url = env("DATABASE_URL") | ||
9 | +} | ||
10 | + | ||
11 | +model User { | ||
12 | + id Int @default(autoincrement()) @id | ||
13 | + avatarUrl String? | ||
14 | + email String @unique | ||
15 | + password String | ||
16 | + name String | ||
17 | + phoneNumber String? @unique | ||
18 | + emailSecret String? | ||
19 | + phoneSecret String? | ||
20 | + bio String? | ||
21 | + rooms Room[] @relation(references: [id]) | ||
22 | + messages Message[] | ||
23 | + createdAt DateTime? @default(now()) | ||
24 | +} | ||
25 | + | ||
26 | +model Room { | ||
27 | + id Int @default(autoincrement()) @id | ||
28 | + participants User[] @relation(references: [id]) | ||
29 | + categories Category[] @relation(references: [id]) | ||
30 | +} | ||
31 | + | ||
32 | +model Category { | ||
33 | + id Int @default(autoincrement()) @id | ||
34 | + name String? @default("") | ||
35 | + rooms Room[] @relation(references: [id]) | ||
36 | +} | ||
37 | + | ||
38 | +model Message { | ||
39 | + id Int @default(autoincrement()) @id | ||
40 | + text String? @default("") | ||
41 | + sender User @relation(fields: [senderId], references: [id]) | ||
42 | + senderId Int | ||
43 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
archive/back/src/api/Room/seeRoom/seeRoom.js
0 → 100644
archive/back/src/api/TestQL/TestQL.graphql
0 → 100644
archive/back/src/api/TestQL/TestQL.js
0 → 100644
1 | +import { prisma, generateToken } from "../../../utils"; | ||
2 | +import bcrypt from "bcryptjs"; | ||
3 | + | ||
4 | +export default { | ||
5 | + Mutation: { | ||
6 | + createAccount: async (_, args) => { | ||
7 | + const { name, password, email, bio = "", avatarUrl = "" } = args; | ||
8 | + const encryptPw = await bcrypt.hash(password, 10); | ||
9 | + const user = await prisma.user.create({ | ||
10 | + data: { | ||
11 | + name, | ||
12 | + email, | ||
13 | + bio, | ||
14 | + avatarUrl, | ||
15 | + password: encryptPw, | ||
16 | + }, | ||
17 | + }); | ||
18 | + const token = generateToken(user.id); | ||
19 | + return { token, user }; | ||
20 | + }, | ||
21 | + }, | ||
22 | +}; |
1 | +import { prisma, generateSecret } from "../../../utils"; | ||
2 | +import twilio from "twilio"; | ||
3 | + | ||
4 | +export default { | ||
5 | + Query: { | ||
6 | + findEmail: async (_, args) => { | ||
7 | + const { phoneNumber } = args; | ||
8 | + const accountSid = process.env.TWILIO_SID; | ||
9 | + const authToken = process.env.TWILIO_AUTH_TOKEN; | ||
10 | + const client = new twilio(accountSid, authToken); | ||
11 | + const randomWords = generateSecret(); | ||
12 | + client.messages | ||
13 | + .create({ | ||
14 | + body: `Please enter this word : ${randomWords}`, | ||
15 | + to: `${phoneNumber}`, | ||
16 | + from: "KhuChat", | ||
17 | + }) | ||
18 | + .then((message) => console.log(message.sid)); | ||
19 | + | ||
20 | + const user = await prisma.user.update({ | ||
21 | + where: { | ||
22 | + phoneNumber, | ||
23 | + }, | ||
24 | + data: { | ||
25 | + phoneSecret: randomWords, | ||
26 | + }, | ||
27 | + }); | ||
28 | + return user; | ||
29 | + }, | ||
30 | + }, | ||
31 | +}; |
archive/back/src/api/User/login/login.js
0 → 100644
1 | +import { prisma } from "../../../utils"; | ||
2 | +import bcrypt from "bcryptjs"; | ||
3 | +import jwt from "jsonwebtoken"; | ||
4 | + | ||
5 | +export default { | ||
6 | + Mutation: { | ||
7 | + login: async (_, args) => { | ||
8 | + const { email, password } = args; | ||
9 | + const user = await prisma.user.findOne({ | ||
10 | + where: { | ||
11 | + email, | ||
12 | + }, | ||
13 | + }); | ||
14 | + let vaild; | ||
15 | + if (user) { | ||
16 | + vaild = await bcrypt.compare(password, user.password); | ||
17 | + } | ||
18 | + if (!user || !vaild) { | ||
19 | + throw new Error("Not vaild email or password"); | ||
20 | + } | ||
21 | + const token = jwt.sign({ id: user.id }, process.env.JWT_SECRET); | ||
22 | + return { token, user }; | ||
23 | + }, | ||
24 | + }, | ||
25 | +}; |
1 | +import { prisma, generateSecret, sendSecretMail } from "../../../utils"; | ||
2 | +import bcrypt from "bcryptjs"; | ||
3 | + | ||
4 | +export default { | ||
5 | + Mutation: { | ||
6 | + requestEmailSecret: async (_, args) => { | ||
7 | + const { email } = args; | ||
8 | + const emailSecret = generateSecret(); | ||
9 | + const encryptSecret = await bcrypt.hash(emailSecret, 10); | ||
10 | + try { | ||
11 | + await sendSecretMail(email, emailSecret); | ||
12 | + await prisma.user.update({ | ||
13 | + where: { | ||
14 | + email, | ||
15 | + }, | ||
16 | + data: { | ||
17 | + emailSecret: encryptSecret, | ||
18 | + }, | ||
19 | + }); | ||
20 | + return true; | ||
21 | + } catch (error) { | ||
22 | + console.log(error); | ||
23 | + return false; | ||
24 | + } | ||
25 | + }, | ||
26 | + }, | ||
27 | +}; |
1 | +import { prisma } from "../../../utils"; | ||
2 | +import bcrypt from "bcryptjs"; | ||
3 | + | ||
4 | +export default { | ||
5 | + Mutation: { | ||
6 | + resetPassword: async (_, args) => { | ||
7 | + const { secret, email, passwordOne, passwordTwo } = args; | ||
8 | + const user = await prisma.user.findOne({ | ||
9 | + where: { | ||
10 | + email, | ||
11 | + }, | ||
12 | + }); | ||
13 | + const encryptSecret = await bcrypt.hash(user.emailSecret, 10); | ||
14 | + if (encryptSecret !== secret) { | ||
15 | + throw new Error( | ||
16 | + "not vaild secret value!, input another value or resend email" | ||
17 | + ); | ||
18 | + } else { | ||
19 | + if (passwordOne !== passwordTwo) { | ||
20 | + // For check new password is right, the two things must be same. | ||
21 | + throw new Error("the two password don't match each other, try again"); | ||
22 | + } else { | ||
23 | + await prisma.user.update({ | ||
24 | + where: { | ||
25 | + email, | ||
26 | + }, | ||
27 | + data: { | ||
28 | + emailSecret: "", | ||
29 | + password: passwordOne, | ||
30 | + }, | ||
31 | + }); | ||
32 | + } | ||
33 | + return user; | ||
34 | + } | ||
35 | + }, | ||
36 | + }, | ||
37 | +}; |
archive/back/src/api/models.graphql
0 → 100644
1 | +type User { | ||
2 | + id: ID! | ||
3 | + avatarUrl: String | ||
4 | + name: String | ||
5 | + email: String! | ||
6 | + password: String | ||
7 | + phoneNumber: String | ||
8 | + emailSecret: String | ||
9 | + phoneSecret: String | ||
10 | + bio: String | ||
11 | + rooms: [Room] | ||
12 | + createdAt: String | ||
13 | + messages: [Message] | ||
14 | +} | ||
15 | + | ||
16 | +type Room { | ||
17 | + id: ID! | ||
18 | + participants: [User] | ||
19 | + categories: [Category] | ||
20 | +} | ||
21 | + | ||
22 | +type Category { | ||
23 | + id: ID! | ||
24 | + name: String | ||
25 | + rooms: [Room] | ||
26 | +} | ||
27 | + | ||
28 | +type Message { | ||
29 | + id: ID! | ||
30 | + text: String | ||
31 | + sender: User | ||
32 | +} | ||
33 | + | ||
34 | +type AuthPayload { | ||
35 | + token: String | ||
36 | + user: User | ||
37 | +} |
archive/back/src/schema.js
0 → 100644
1 | +import path from "path"; | ||
2 | +import { makeExecutableSchema } from "graphql-tools"; | ||
3 | +import { fileLoader, mergeResolvers, mergeTypes } from "merge-graphql-schemas"; | ||
4 | + | ||
5 | +const allTypes = fileLoader(path.join(__dirname, "api/**/*.graphql")); | ||
6 | +const allResolvers = fileLoader(path.join(__dirname, "api/**/*.js")); | ||
7 | + | ||
8 | +const schema = makeExecutableSchema({ | ||
9 | + typeDefs: mergeTypes(allTypes), | ||
10 | + resolvers: mergeResolvers(allResolvers), | ||
11 | +}); | ||
12 | + | ||
13 | +export default schema; |
archive/back/src/server.js
0 → 100644
1 | +import dotenv from "dotenv"; | ||
2 | +dotenv.config(); | ||
3 | +import { GraphQLServer } from "graphql-yoga"; | ||
4 | +import morgan from "morgan"; | ||
5 | +import schema from "./schema"; | ||
6 | +import { prisma } from "./utils"; | ||
7 | + | ||
8 | +const PORT = process.env.PORT; | ||
9 | + | ||
10 | +const server = new GraphQLServer({ | ||
11 | + schema, | ||
12 | + context: (request) => { | ||
13 | + return { | ||
14 | + ...request, | ||
15 | + prisma, | ||
16 | + }; | ||
17 | + }, | ||
18 | +}); | ||
19 | + | ||
20 | +server.express.use(morgan("dev")); | ||
21 | + | ||
22 | +server.start(() => console.log(`server is running : http://localhost:${PORT}`)); |
archive/back/src/utils.js
0 → 100644
1 | +import { PrismaClient } from "@prisma/client"; | ||
2 | +import { nouns, adjectives } from "./words"; | ||
3 | +import jwt from "jsonwebtoken"; | ||
4 | +import nodemailer from "nodemailer"; | ||
5 | +import sgTransport from "nodemailer-sendgrid-transport"; | ||
6 | + | ||
7 | +export const prisma = new PrismaClient(); | ||
8 | + | ||
9 | +export const getUserId = (context) => { | ||
10 | + const Authorization = context.request.get("Authorization"); | ||
11 | + if (Authorization) { | ||
12 | + const token = Authorization.replace("Bearer ", ""); | ||
13 | + const { userId } = jwt.verify(token, process.env.JWT_SECRET); | ||
14 | + return userId; | ||
15 | + } | ||
16 | + throw new Error("There is no vaild user"); | ||
17 | +}; | ||
18 | + | ||
19 | +export const generateSecret = () => { | ||
20 | + const randomNumber = Math.floor(Math.random() * adjectives.length); | ||
21 | + return `${adjectives[randomNumber]} ${nouns[randomNumber]}`; | ||
22 | +}; | ||
23 | + | ||
24 | +const sendEmail = (email) => { | ||
25 | + const options = { | ||
26 | + auth: { | ||
27 | + api_user: process.env.SENDGRID_USERNAME, | ||
28 | + api_password: process.env.SENDGRID_PASSWORD, | ||
29 | + }, | ||
30 | + }; | ||
31 | + const client = nodemailer.createTransport(sgTransport(options)); | ||
32 | + return client.sendMail(email); | ||
33 | +}; | ||
34 | + | ||
35 | +export const sendSecretMail = (address, emailSecret, value) => { | ||
36 | + const email = { | ||
37 | + from: "vel1024@khu.ac.kr", | ||
38 | + to: address, | ||
39 | + subject: `Authentication key for forgotten ${value}`, | ||
40 | + html: `Hello, This is khuchat, authentication key is <b>${emailSecret}</b>, copy and paste it, Thanks.`, | ||
41 | + }; | ||
42 | + return sendEmail(email); | ||
43 | +}; | ||
44 | + | ||
45 | +export const generateToken = (id) => jwt.sign({ id }, process.env.JWT_SECRET); |
archive/back/src/words.js
0 → 100644
1 | +export const adjectives = [ | ||
2 | + "languid", | ||
3 | + "expensive", | ||
4 | + "careful", | ||
5 | + "feeble", | ||
6 | + "inconclusive", | ||
7 | + "damp", | ||
8 | + "obscene", | ||
9 | + "optimal", | ||
10 | + "learned", | ||
11 | + "measly", | ||
12 | + "silent", | ||
13 | + "absurd", | ||
14 | + "hypnotic", | ||
15 | + "smart", | ||
16 | + "horrible", | ||
17 | + "deep", | ||
18 | + "grotesque", | ||
19 | + "rigid", | ||
20 | + "sweltering", | ||
21 | + "quirky", | ||
22 | + "pointless", | ||
23 | + "spiffy", | ||
24 | + "cheap", | ||
25 | + "psychotic", | ||
26 | + "possible", | ||
27 | + "burly", | ||
28 | + "huge", | ||
29 | + "tranquil", | ||
30 | + "impolite", | ||
31 | + "clear", | ||
32 | + "groovy", | ||
33 | + "royal", | ||
34 | + "envious", | ||
35 | + "voracious", | ||
36 | + "substantial", | ||
37 | + "gusty", | ||
38 | + "absorbing", | ||
39 | + "wealthy", | ||
40 | + "fancy", | ||
41 | + "ultra", | ||
42 | + "giant", | ||
43 | + "harmonious", | ||
44 | + "nauseating", | ||
45 | + "literate", | ||
46 | + "friendly", | ||
47 | + "panicky", | ||
48 | + "utopian", | ||
49 | + "happy", | ||
50 | + "gaudy", | ||
51 | + "direful", | ||
52 | + "descriptive", | ||
53 | + "better", | ||
54 | + "ambiguous", | ||
55 | + "momentous", | ||
56 | + "obsequious", | ||
57 | + "secret", | ||
58 | + "clever", | ||
59 | + "far", | ||
60 | + "temporary", | ||
61 | + "unable", | ||
62 | + "normal", | ||
63 | + "imported", | ||
64 | + "three", | ||
65 | + "five", | ||
66 | + "petite", | ||
67 | + "natural", | ||
68 | + "early", | ||
69 | + "profuse", | ||
70 | + "flimsy", | ||
71 | + "bustling", | ||
72 | + "scrawny", | ||
73 | + "present", | ||
74 | + "gruesome", | ||
75 | + "cut", | ||
76 | + "fantastic", | ||
77 | + "grandiose", | ||
78 | + "second-hand", | ||
79 | + "noiseless", | ||
80 | + "craven", | ||
81 | + "grubby", | ||
82 | + "vengeful", | ||
83 | + "tiny", | ||
84 | + "wiry", | ||
85 | + "auspicious", | ||
86 | + "dull", | ||
87 | + "quiet", | ||
88 | + "terrific", | ||
89 | + "furry", | ||
90 | + "crooked", | ||
91 | + "wholesale", | ||
92 | + "panoramic", | ||
93 | + "forgetful", | ||
94 | + "gamy", | ||
95 | + "victorious", | ||
96 | + "special", | ||
97 | + "neighborly", | ||
98 | + "useful", | ||
99 | + "chubby", | ||
100 | + "probable", | ||
101 | + "abnormal", | ||
102 | +]; | ||
103 | + | ||
104 | +export const nouns = [ | ||
105 | + "rat", | ||
106 | + "start", | ||
107 | + "icicle", | ||
108 | + "hobbies", | ||
109 | + "books", | ||
110 | + "dress", | ||
111 | + "board", | ||
112 | + "scale", | ||
113 | + "cattle", | ||
114 | + "quince", | ||
115 | + "cabbage", | ||
116 | + "chance", | ||
117 | + "attack", | ||
118 | + "linen", | ||
119 | + "swing", | ||
120 | + "skin", | ||
121 | + "channel", | ||
122 | + "discovery", | ||
123 | + "window", | ||
124 | + "watch", | ||
125 | + "collar", | ||
126 | + "creature", | ||
127 | + "fall", | ||
128 | + "rod", | ||
129 | + "skirt", | ||
130 | + "trousers", | ||
131 | + "guitar", | ||
132 | + "pest", | ||
133 | + "middle", | ||
134 | + "holiday", | ||
135 | + "invention", | ||
136 | + "pump", | ||
137 | + "morning", | ||
138 | + "reaction", | ||
139 | + "wash", | ||
140 | + "cloth", | ||
141 | + "hydrant", | ||
142 | + "committee", | ||
143 | + "meeting", | ||
144 | + "star", | ||
145 | + "pigs", | ||
146 | + "bikes", | ||
147 | + "plant", | ||
148 | + "stomach", | ||
149 | + "transport", | ||
150 | + "hole", | ||
151 | + "library", | ||
152 | + "tank", | ||
153 | + "hands", | ||
154 | + "offer", | ||
155 | + "slip", | ||
156 | + "chicken", | ||
157 | + "sand", | ||
158 | + "wilderness", | ||
159 | + "sweater", | ||
160 | + "frogs", | ||
161 | + "basket", | ||
162 | + "flesh", | ||
163 | + "cook", | ||
164 | + "girl", | ||
165 | + "queen", | ||
166 | + "nut", | ||
167 | + "force", | ||
168 | + "laborer", | ||
169 | + "basin", | ||
170 | + "lumber", | ||
171 | + "mine", | ||
172 | + "mountain", | ||
173 | + "insect", | ||
174 | + "store", | ||
175 | + "experience", | ||
176 | + "credit", | ||
177 | + "meat", | ||
178 | + "taste", | ||
179 | + "iron", | ||
180 | + "regret", | ||
181 | + "sleep", | ||
182 | + "notebook", | ||
183 | + "powder", | ||
184 | + "fuel", | ||
185 | + "lace", | ||
186 | + "volleyball", | ||
187 | + "look", | ||
188 | + "ticket", | ||
189 | + "place", | ||
190 | + "digestion", | ||
191 | + "point", | ||
192 | + "crook", | ||
193 | + "train", | ||
194 | + "judge", | ||
195 | + "time", | ||
196 | + "truck", | ||
197 | + "record", | ||
198 | + "sheet", | ||
199 | + "join", | ||
200 | + "achiever", | ||
201 | + "spring", | ||
202 | + "death", | ||
203 | + "potato", | ||
204 | + "liquid", | ||
205 | +]; |
archive/back/yarn.lock
0 → 100644
This diff is collapsed. Click to expand it.
archive/docker-compose.yml
0 → 100644
1 | +version: "3.7" | ||
2 | +services: | ||
3 | + mysql: | ||
4 | + image: mysql:8.0.19 | ||
5 | + container_name: mysql | ||
6 | + ports: | ||
7 | + - 3306:3306 | ||
8 | + restart: always | ||
9 | + environment: | ||
10 | + MYSQL_DATABASE: prisma | ||
11 | + MYSQL_ROOT_PASSWORD: prisma | ||
12 | + volumes: | ||
13 | + - /var/lib/mysql | ||
14 | + prisma: | ||
15 | + links: | ||
16 | + - mysql | ||
17 | + depends_on: | ||
18 | + - mysql | ||
19 | + container_name: prisma | ||
20 | + ports: | ||
21 | + - "5555:5555" | ||
22 | + build: | ||
23 | + context: ./back/prisma | ||
24 | + dockerfile: Dockerfile | ||
25 | + environment: | ||
26 | + MYSQL_URL: ${MYSQL_URL} | ||
27 | + MYSQL_DATABASE: prisma | ||
28 | + MYSQL_ROOT_PASSWORD: prisma | ||
29 | + volumes: | ||
30 | + - /app/prisma | ||
31 | + backend: | ||
32 | + links: | ||
33 | + - mysql | ||
34 | + depends_on: | ||
35 | + - mysql | ||
36 | + container_name: backend | ||
37 | + ports: | ||
38 | + - "4000:4000" | ||
39 | + build: | ||
40 | + context: ./back | ||
41 | + dockerfile: Dockerfile | ||
42 | + environment: | ||
43 | + MYSQL_URL: ${MYSQL_URL} | ||
44 | + FRONTEND_URL: ${FRONTEND_URL} | ||
45 | + volumes: | ||
46 | + - ./back:/usr/src/app | ||
47 | + - ./back/node_modules:/usr/src/app/node_modules | ||
48 | + - ./back/prisma:/usr/src/app/prisma | ||
49 | + frontend: | ||
50 | + container_name: frontend | ||
51 | + ports: | ||
52 | + - "3000:3000" | ||
53 | + tty: "true" | ||
54 | + build: | ||
55 | + context: ./front | ||
56 | + dockerfile: Dockerfile | ||
57 | + command: npm start | ||
58 | + environment: | ||
59 | + - NODE_ENV=development | ||
60 | + - CHOKIDAR_USEPOLLING=true | ||
61 | + - BACKEND_URL=${BACKEND_URL} | ||
62 | + volumes: | ||
63 | + - ./front:/usr/src/app |
archive/front/.dockerignore
0 → 100644
1 | +node_modules | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
archive/front/.gitignore
0 → 100644
1 | +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
2 | + | ||
3 | +# dependencies | ||
4 | +/node_modules | ||
5 | +/.pnp | ||
6 | +.pnp.js | ||
7 | + | ||
8 | +# testing | ||
9 | +/coverage | ||
10 | + | ||
11 | +# production | ||
12 | +/build | ||
13 | + | ||
14 | +# misc | ||
15 | +.DS_Store | ||
16 | +.env.local | ||
17 | +.env.development.local | ||
18 | +.env.test.local | ||
19 | +.env.production.local | ||
20 | + | ||
21 | +npm-debug.log* | ||
22 | +yarn-debug.log* | ||
23 | +yarn-error.log* |
archive/front/Dockerfile
0 → 100644
archive/front/README.md
0 → 100644
archive/front/package-lock.json
0 → 100644
This diff could not be displayed because it is too large.
archive/front/package.json
0 → 100644
1 | +{ | ||
2 | + "name": "capstone-front", | ||
3 | + "version": "0.1.0", | ||
4 | + "private": true, | ||
5 | + "dependencies": { | ||
6 | + "@testing-library/jest-dom": "^4.2.4", | ||
7 | + "@testing-library/react": "^9.3.2", | ||
8 | + "@testing-library/user-event": "^7.1.2", | ||
9 | + "apollo-boost": "^0.4.7", | ||
10 | + "core-js": "^3.6.5", | ||
11 | + "graphql": "^15.0.0", | ||
12 | + "react": "^16.13.1", | ||
13 | + "react-apollo-hooks": "^0.5.0", | ||
14 | + "react-dom": "^16.13.1", | ||
15 | + "react-hooks": "^1.0.1", | ||
16 | + "react-router": "^5.1.2", | ||
17 | + "react-router-dom": "^5.1.2", | ||
18 | + "react-scripts": "3.4.1", | ||
19 | + "react-toastify": "^5.5.0", | ||
20 | + "styled-components": "^5.1.0", | ||
21 | + "styled-reset": "^4.1.3" | ||
22 | + }, | ||
23 | + "scripts": { | ||
24 | + "start": "react-scripts start", | ||
25 | + "build": "react-scripts build", | ||
26 | + "test": "react-scripts test", | ||
27 | + "eject": "react-scripts eject" | ||
28 | + }, | ||
29 | + "eslintConfig": { | ||
30 | + "extends": "react-app" | ||
31 | + }, | ||
32 | + "browserslist": { | ||
33 | + "production": [ | ||
34 | + ">0.2%", | ||
35 | + "not dead", | ||
36 | + "not op_mini all" | ||
37 | + ], | ||
38 | + "development": [ | ||
39 | + "last 1 chrome version", | ||
40 | + "last 1 firefox version", | ||
41 | + "last 1 safari version" | ||
42 | + ] | ||
43 | + } | ||
44 | +} |
archive/front/public/favicon.ico
0 → 100644
No preview for this file type
archive/front/public/index.html
0 → 100644
1 | +<!DOCTYPE html> | ||
2 | +<html lang="en"> | ||
3 | + <head> | ||
4 | + <meta charset="utf-8" /> | ||
5 | + <link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> | ||
6 | + <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
7 | + <meta name="theme-color" content="#000000" /> | ||
8 | + <meta | ||
9 | + name="description" | ||
10 | + content="Web site created using create-react-app" | ||
11 | + /> | ||
12 | + <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> | ||
13 | + <!-- | ||
14 | + manifest.json provides metadata used when your web app is installed on a | ||
15 | + user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ | ||
16 | + --> | ||
17 | + <link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> | ||
18 | + <!-- | ||
19 | + Notice the use of %PUBLIC_URL% in the tags above. | ||
20 | + It will be replaced with the URL of the `public` folder during the build. | ||
21 | + Only files inside the `public` folder can be referenced from the HTML. | ||
22 | + | ||
23 | + Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will | ||
24 | + work correctly both with client-side routing and a non-root public URL. | ||
25 | + Learn how to configure a non-root public URL by running `npm run build`. | ||
26 | + --> | ||
27 | + <title>React App</title> | ||
28 | + </head> | ||
29 | + <body> | ||
30 | + <noscript>You need to enable JavaScript to run this app.</noscript> | ||
31 | + <div id="root"></div> | ||
32 | + <!-- | ||
33 | + This HTML file is a template. | ||
34 | + If you open it directly in the browser, you will see an empty page. | ||
35 | + | ||
36 | + You can add webfonts, meta tags, or analytics to this file. | ||
37 | + The build step will place the bundled scripts into the <body> tag. | ||
38 | + | ||
39 | + To begin the development, run `npm start` or `yarn start`. | ||
40 | + To create a production bundle, use `npm run build` or `yarn build`. | ||
41 | + --> | ||
42 | + </body> | ||
43 | +</html> |
archive/front/public/logo192.png
0 → 100644
5.22 KB
archive/front/public/logo512.png
0 → 100644
9.44 KB
archive/front/public/manifest.json
0 → 100644
1 | +{ | ||
2 | + "short_name": "React App", | ||
3 | + "name": "Create React App Sample", | ||
4 | + "icons": [ | ||
5 | + { | ||
6 | + "src": "favicon.ico", | ||
7 | + "sizes": "64x64 32x32 24x24 16x16", | ||
8 | + "type": "image/x-icon" | ||
9 | + }, | ||
10 | + { | ||
11 | + "src": "logo192.png", | ||
12 | + "type": "image/png", | ||
13 | + "sizes": "192x192" | ||
14 | + }, | ||
15 | + { | ||
16 | + "src": "logo512.png", | ||
17 | + "type": "image/png", | ||
18 | + "sizes": "512x512" | ||
19 | + } | ||
20 | + ], | ||
21 | + "start_url": ".", | ||
22 | + "display": "standalone", | ||
23 | + "theme_color": "#000000", | ||
24 | + "background_color": "#ffffff" | ||
25 | +} |
archive/front/public/robots.txt
0 → 100644
archive/front/src/Apollo/Client.js
0 → 100644
archive/front/src/Apollo/ClientState.js
0 → 100644
archive/front/src/Components/App.js
0 → 100644
1 | +import React from "react"; | ||
2 | +import GlobalStyles from "../Styles/GlobalStyles"; | ||
3 | +import Header from "./Header"; | ||
4 | +import Image from "./Image"; | ||
5 | +import Grid from "./Grid"; | ||
6 | + | ||
7 | +export default () => { | ||
8 | + return ( | ||
9 | + <> | ||
10 | + <GlobalStyles /> | ||
11 | + <Header /> | ||
12 | + <Image /> | ||
13 | + <Grid /> | ||
14 | + </> | ||
15 | + ); | ||
16 | +}; |
archive/front/src/Components/Article.js
0 → 100644
1 | +import React from "react"; | ||
2 | +import Styled from "styled-components"; | ||
3 | + | ||
4 | +const Article = Styled.div` | ||
5 | + width: 70%; | ||
6 | + justify-content: center; | ||
7 | + align-items: center; | ||
8 | + text-align: center; | ||
9 | + margin-top: 10px; | ||
10 | + border-top: 1px solid black; | ||
11 | +`; | ||
12 | + | ||
13 | +export default () => { | ||
14 | + return ( | ||
15 | + <Article> | ||
16 | + <h1>Article Title</h1> | ||
17 | + </Article> | ||
18 | + ); | ||
19 | +}; |
archive/front/src/Components/Grid.js
0 → 100644
1 | +import React from "react"; | ||
2 | +import Styled from "styled-components"; | ||
3 | +import MenuList from "./MenuList"; | ||
4 | +import Article from "./Article"; | ||
5 | + | ||
6 | +const Grid = Styled.div` | ||
7 | + width: 100%; | ||
8 | + display: flex; | ||
9 | +`; | ||
10 | + | ||
11 | +export default () => { | ||
12 | + return ( | ||
13 | + <Grid> | ||
14 | + <MenuList /> | ||
15 | + <Article /> | ||
16 | + </Grid> | ||
17 | + ); | ||
18 | +}; |
archive/front/src/Components/Header.js
0 → 100644
1 | +import React from "react"; | ||
2 | +import Styled from "styled-components"; | ||
3 | + | ||
4 | +const Header = Styled.div` | ||
5 | + width: 100%; | ||
6 | + display: flex; | ||
7 | + justify-content: center; | ||
8 | + margin: 10px 0px; | ||
9 | + font-size: 25px; | ||
10 | +`; | ||
11 | + | ||
12 | +export default () => { | ||
13 | + return ( | ||
14 | + <Header> | ||
15 | + <h1>KHU Chatting service</h1> | ||
16 | + </Header> | ||
17 | + ); | ||
18 | +}; |
archive/front/src/Components/Image.js
0 → 100644
1 | +import React from "react"; | ||
2 | +import Styled from "styled-components"; | ||
3 | + | ||
4 | +const Image = Styled.div` | ||
5 | + width: 100%; | ||
6 | + margin: 20px 0px; | ||
7 | + display: flex; | ||
8 | + justify-content: center; | ||
9 | +`; | ||
10 | + | ||
11 | +export default () => { | ||
12 | + return ( | ||
13 | + <Image> | ||
14 | + <img src="" alt="sample"></img> | ||
15 | + </Image> | ||
16 | + ); | ||
17 | +}; |
archive/front/src/Components/MenuList.js
0 → 100644
1 | +import React from "react"; | ||
2 | +import Styled from "styled-components"; | ||
3 | + | ||
4 | +const MenuBox = Styled.div` | ||
5 | + width: 30%; | ||
6 | + display: flex; | ||
7 | + justify-content: center; | ||
8 | + align-items: center; | ||
9 | + margin-top: 10px; | ||
10 | + border-top: 1px solid black; | ||
11 | + border-right: 1px solid black; | ||
12 | +`; | ||
13 | + | ||
14 | +const MenuList = Styled.ol` | ||
15 | +`; | ||
16 | + | ||
17 | +const MenuItem = Styled.li` | ||
18 | +`; | ||
19 | + | ||
20 | +const Link = Styled.a` | ||
21 | +`; | ||
22 | + | ||
23 | +export default () => { | ||
24 | + return ( | ||
25 | + <MenuBox> | ||
26 | + <MenuList> | ||
27 | + <MenuItem> | ||
28 | + <Link href="">1. What is KHU Chat?</Link> | ||
29 | + </MenuItem> | ||
30 | + </MenuList> | ||
31 | + </MenuBox> | ||
32 | + ); | ||
33 | +}; |
archive/front/src/Styles/GlobalStyles.js
0 → 100644
archive/front/src/index.js
0 → 100644
1 | +import React from "react"; | ||
2 | +import ReactDOM from "react-dom"; | ||
3 | +import App from "./Components/App"; | ||
4 | +import { ApolloProvider } from "react-apollo-hooks"; | ||
5 | +import Client from "./Apollo/Client"; | ||
6 | + | ||
7 | +ReactDOM.render( | ||
8 | + <ApolloProvider client={Client}> | ||
9 | + <App /> | ||
10 | + </ApolloProvider>, | ||
11 | + document.getElementById("root") | ||
12 | +); |
archive/front/web/JS/validation.js
0 → 100644
1 | + | ||
2 | +var Email={ | ||
3 | + checkEmail:function(self){ | ||
4 | + var email=document.getElementById('eValidation').value; | ||
5 | + var regExp = /^[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*.[a-zA-Z]{2,3}$/i; | ||
6 | + if(regExp.test(email)){ | ||
7 | + return true; | ||
8 | + }else if(email===""){ | ||
9 | + focusFunction("#eValidation"); | ||
10 | + alert("이메일을 입력해주세요!"); | ||
11 | + return false; | ||
12 | + } | ||
13 | + else { | ||
14 | + alert("이메일 형식을 제대로 입력해주세요!"); | ||
15 | + return false; | ||
16 | + } | ||
17 | + } | ||
18 | +} | ||
19 | + | ||
20 | +var Password={ | ||
21 | + checkPassword:function(self){ | ||
22 | + var fpassword=document.getElementById('fValidation').value; | ||
23 | + var spassword= document.getElementById('sValidation').value; | ||
24 | + if(fpassword==="" || spassword===""){ | ||
25 | + alert("비밀번호를 입력해주세요!"); | ||
26 | + return false; | ||
27 | + }else if(fpassword===spassword){ | ||
28 | + return true; | ||
29 | + }else{ | ||
30 | + alert("입력하신 비밀번호들이 다릅니다!"); | ||
31 | + return false; | ||
32 | + } | ||
33 | + } | ||
34 | +} | ||
35 | + | ||
36 | +function checkValidation(self){ | ||
37 | + if(Email.checkEmail() && Password.checkPassword() ){ | ||
38 | + return true; | ||
39 | + }else return false; | ||
40 | + | ||
41 | +} | ||
42 | + | ||
43 | +function checkPasswordMatch() { | ||
44 | + var password = $("#fpassword").val(); | ||
45 | + var confirmPassword = $("#spassword").val(); | ||
46 | + | ||
47 | + if (password != confirmPassword) | ||
48 | + $("#message").html("비밀번호가 일치하지 않습니다.!"); | ||
49 | + else | ||
50 | + $("#message").html("일치."); | ||
51 | +} |
1 | <!doctype html> | 1 | <!doctype html> |
2 | <html> | 2 | <html> |
3 | <head> | 3 | <head> |
4 | +<title>KHU KHU Chat</title> | ||
5 | +<meta charset="utf-8"> | ||
6 | +<link rel="stylesheet" href="style/style.css"> | ||
7 | +<style> | ||
4 | 8 | ||
5 | - <title>KHU Chat</title> | 9 | +</style> |
6 | - <meta charset="utf-8"> | 10 | +</head> |
7 | - <link rel="stylesheet" href="style/style.css"> | 11 | +<body> |
8 | - <script src="https://kit.fontawesome.com/6a5db0a2e0.js" crossorigin="anonymous"></script> | ||
9 | - <link rel="icon" href="https://kit.fontawesome.com/6a5db0a2e0.js" /> | ||
10 | - <link href="https://fonts.googleapis.com/css2?family=Black+Han+Sans&display=swap" rel="stylesheet"> | ||
11 | - <script src="JS/main.js"></script> | ||
12 | - </head> | ||
13 | - <body> | ||
14 | - <header role="banner"> | ||
15 | - <nav class="khu-nav" role="navigation" aria-label="Primary navigation"> | ||
16 | - <div class="khu-nav-row"> | ||
17 | - <div class="khu-logo"> | ||
18 | - <a id="khu-logo" data-clog-click="" data-clog-ui-element="link_home" href="main.html" aria-label="Khu-logo" data-qa="logo"> | ||
19 | - <img src="img/Khu_Chat_Icon.svg" width="30px" hegiht="20px" alt="Khu Chat"> | ||
20 | - </a> | ||
21 | - | ||
22 | - <a id="khu-logo-font" data-clog-click="" data-clog-ui-element="link_home" href="main.html" aria-label="Khu-logo-font" data-qa="logo"> | ||
23 | - Khu Chat | ||
24 | - </a> | ||
25 | - </div> | ||
26 | - <div class ="khu-login" > | ||
27 | - <a data-clog-click="" data-clog-ui-element="link_home" href="main.html" aria-label="Khu-logo-font" data-qa="logo"> | ||
28 | - Login | ||
29 | - </a> | ||
30 | - </div> | ||
31 | - <div class="khu-signin"> | ||
32 | - <a data-clog-click="" data-clog-ui-element="link_home" href="main.html" aria-label="Khu-logo-font" data-qa="logo"> | ||
33 | - Sign in | ||
34 | - </a> | ||
35 | - </div> | ||
36 | - <div class="khu-start-button"> | ||
37 | - <button id="khu-start-button" onclick="" data-clog-click="" data-clog-ui-element="link_home" href="main.html" aria-label="Khu-start-button" data-qa="logo"> | ||
38 | - Launch Chating | ||
39 | - </button> | ||
40 | - </div> | ||
41 | - </div> | ||
42 | -</nav> | ||
43 | 12 | ||
44 | <h1><a href="main.html" color:black>KHU Chatting service</a></h1> | 13 | <h1><a href="main.html" color:black>KHU Chatting service</a></h1> |
45 | <img src="image/welcome.jpg" class="image"> | 14 | <img src="image/welcome.jpg" class="image"> |
... | @@ -47,11 +16,11 @@ | ... | @@ -47,11 +16,11 @@ |
47 | <div id="grid"> | 16 | <div id="grid"> |
48 | <div id="category"> | 17 | <div id="category"> |
49 | <ol class="center"> | 18 | <ol class="center"> |
50 | - <li><a class="dr-icon" href="service/whatiskhuchat.html" >What is KHU chat? </a></li> | 19 | + <li><a href="service/whatiskhuchat.html" class="saw">What is KHU chat? </a></li> |
51 | - <li><a class="dr-icon" href="loginmain.html" >로그인</a></li> | 20 | + <li><a href="loginmain.html" class="saw">로그인</a></li> |
52 | - <li><a class="dr-icon" href="signinmain.html" >회원가입</a></li> | 21 | + <li><a href="signinmain.html" class="saw">회원가입</a></li> |
53 | - <li><a class="dr-icon" href="question.html" >문의사항</a></li> | 22 | + <li><a href="question.html" class="saw">문의사항</a></li> |
54 | - <li><a class="dr-icon" href="afterlogin.html" >로그인이후</a></li> | 23 | + <li><a href="afterlogin.html" class="saw">로그인이후</a></li> |
55 | </ol> | 24 | </ol> |
56 | </div> | 25 | </div> |
57 | <div id="article"> | 26 | <div id="article"> |
... | @@ -77,5 +46,6 @@ | ... | @@ -77,5 +46,6 @@ |
77 | </form> | 46 | </form> |
78 | </div> | 47 | </div> |
79 | </div> | 48 | </div> |
49 | + | ||
80 | </body> | 50 | </body> |
81 | </html> | 51 | </html> | ... | ... |
archive/front/web/ex/Loopandfunction.html
0 → 100644
1 | +<!doctype html> | ||
2 | +<html> | ||
3 | +<head> | ||
4 | +<title>KHU KHU Chat</title> | ||
5 | +<meta charset="utf-8"> | ||
6 | + | ||
7 | +<link rel="stylesheet" href="style.css"> | ||
8 | +<script> | ||
9 | +function LinksSetColor(color){ | ||
10 | + var alist=document.querySelectorAll('a'); | ||
11 | + var i =0; | ||
12 | + while(i<alist.length) | ||
13 | + { | ||
14 | + alist[i].style.color=color; | ||
15 | + i+=1; | ||
16 | + } | ||
17 | +} | ||
18 | +var Body={ | ||
19 | + setColor:function(color){ | ||
20 | + | ||
21 | + } | ||
22 | +} | ||
23 | +function bodySetColor(color){ | ||
24 | + document.querySelector('body').style.color= color; | ||
25 | +} | ||
26 | +function bodySetBackGruondColor(color){ | ||
27 | + document.querySelector('body').style.backgroundColor= color; | ||
28 | +} | ||
29 | +function nightDayHandler(self){ | ||
30 | + if(self.value==='night') | ||
31 | + { | ||
32 | + bodySetBackGruondColor('black') | ||
33 | + bodySetColor('white'); | ||
34 | + self.value= 'day'; | ||
35 | + | ||
36 | + setColor('powderblue'); | ||
37 | + | ||
38 | + }else{ | ||
39 | + bodySetBackGruondColor('white') | ||
40 | + bodySetColor('black'); | ||
41 | + self.value= 'night'; | ||
42 | + | ||
43 | + setColor('blue'); | ||
44 | + } | ||
45 | + } | ||
46 | +</script> | ||
47 | +</head> | ||
48 | +<body> | ||
49 | + | ||
50 | + <h1><a href="main.html" color:black>KHU Chatting service</a></h1> | ||
51 | + <img src="image/signin.jpg" class="image"> | ||
52 | + | ||
53 | +<!--refactoring and conditional statement --> | ||
54 | + | ||
55 | + | ||
56 | +<!-- about this grammer | ||
57 | + | ||
58 | + <input type="button" value="night" onclick=" | ||
59 | + if(this.value==='night') | ||
60 | + { | ||
61 | + document.querySelector('body').style.backgroundColor= 'black'; | ||
62 | + document.querySelector('body').style.color= 'white'; | ||
63 | + this.value= 'day'; | ||
64 | + }else{ | ||
65 | + document.querySelector('body').style.backgroundColor= 'white'; | ||
66 | + document.querySelector('body').style.color= 'black'; | ||
67 | + this.value= 'night'; | ||
68 | + } | ||
69 | + "> | ||
70 | + --> | ||
71 | + | ||
72 | + | ||
73 | + | ||
74 | +<!-- about array | ||
75 | + <script> | ||
76 | + var cowokers=["minsing","minsoft"]; | ||
77 | + document.write(cowokers[0]); | ||
78 | + document.write(cowokers[1]); | ||
79 | + cowokers.push("ssssss") | ||
80 | + document.write(cowokers); | ||
81 | + </script> | ||
82 | +--> | ||
83 | + | ||
84 | +<!-- about Loop | ||
85 | +<ul> | ||
86 | + <script> | ||
87 | + var i=0; | ||
88 | + while(i<3) | ||
89 | + { | ||
90 | + document.write("<li>var</li>") | ||
91 | + i+=1; | ||
92 | + } | ||
93 | + </script> | ||
94 | +</ul> | ||
95 | +--> | ||
96 | + | ||
97 | + | ||
98 | + | ||
99 | +<!--Loop & Array | ||
100 | +<script> | ||
101 | + var cowokers=["minsung","leezche","minsoft","sdy"]; | ||
102 | +</script> | ||
103 | + | ||
104 | +<script> | ||
105 | + var i=0; | ||
106 | + while( i< cowokers.length ){ | ||
107 | + document.write('<li><a href="http://a.com/'+cowokers[i]+'">'+cowokers[i]+'</a></li>'); | ||
108 | + i+=1; | ||
109 | + } | ||
110 | +</script> | ||
111 | +--> | ||
112 | + | ||
113 | +<!-- Loop apply | ||
114 | +var alist=document.querySelectorAll('a'); | ||
115 | +var i =0; | ||
116 | +while(i<alist.length){ | ||
117 | +console.log(alist[i]); | ||
118 | +i+=1; | ||
119 | +} | ||
120 | +--> | ||
121 | + | ||
122 | +<!-- button 1 usage array and Loop for chage style | ||
123 | + self를 통한 input의 객체 지정해주기 | ||
124 | + 지정해주기전에는 전역객체를 가르키게 된다. | ||
125 | + --> | ||
126 | +<input id="night_day" type="button" value="night" onclick=" | ||
127 | + nightDayHandler(this); | ||
128 | +"> | ||
129 | + | ||
130 | +<!-- button2 making and using function --> | ||
131 | + <input id="night_day" type="button" value="night" onclick=" | ||
132 | + nightDayHandler(this); | ||
133 | + "> | ||
134 | + | ||
135 | + <div id="grid"> | ||
136 | + <ol> | ||
137 | + <li><a href="whatiskhuchat.html" class="saw">What is KHU chat? </a></li> | ||
138 | + <li><a href="loginmain.html" class="saw">로그인</a></li> | ||
139 | + <li><a href="signinmain.html" class="saw">회원가입</a></li> | ||
140 | + <li><a href="question.html" class="saw">문의사항</a></li> | ||
141 | + <li><a href="afterlogin.html" class="saw">로그인이후</a></li> | ||
142 | + </ol> | ||
143 | + <div id="article"> | ||
144 | + <h2>회원가입</h2> | ||
145 | + <div id="inputset"> | ||
146 | + <form class="signinform" action="loginmain.html"> | ||
147 | + <label for="email">Email:</label><br> | ||
148 | + <input type="text" name="email"><br> | ||
149 | + | ||
150 | + <label for="password">password:</label><br> | ||
151 | + <input type="password" name="password"><br> | ||
152 | + | ||
153 | + <label for="name">이름:</label><br> | ||
154 | + <input type="text" name="name"><br> | ||
155 | + | ||
156 | + <label for="age">나이:</label><br> | ||
157 | + <input type="text" name="age"><br><br> | ||
158 | + | ||
159 | + <label for="sex">성별:</label><br> | ||
160 | + <input type="radio" value="man" name="sex">남자<br> | ||
161 | + <input type="radio" value="woman" name="sex">여자<br><br> | ||
162 | + | ||
163 | + <label for="work">직업:</label><br> | ||
164 | + <input type="radio" value="nowork" name="work">무직<br> | ||
165 | + <input type="radio" value="Hstudent" name="work">중/고생<br> | ||
166 | + <input type="radio" value="Ustudent" name="work">대학생<br> | ||
167 | + <input type="radio" value="worker" name="work">직장인<br><br> | ||
168 | + | ||
169 | + <label for="interesting">관심사(중복선택가능):</label><br> | ||
170 | + <input type="checkbox" value="movie" name="interesting">영화<br> | ||
171 | + <input type="checkbox" value="song" name="interesting">노래<br> | ||
172 | + <input type="checkbox" value="study" name="interesting">공부<br> | ||
173 | + <input type="checkbox" value="coding" name="interesting">코딩<br><br> | ||
174 | + | ||
175 | + <input type="submit" value="회원가입신청"> | ||
176 | + </form> | ||
177 | + </div> | ||
178 | + | ||
179 | + | ||
180 | + </div> | ||
181 | + </div> | ||
182 | + | ||
183 | + | ||
184 | +</body> | ||
185 | +</html> |
archive/front/web/ex/box.html
0 → 100644
1 | +<!doctype html> | ||
2 | +<html> | ||
3 | + <head> | ||
4 | + <meta charset="utf-8"> | ||
5 | + <title>KHU chat box model test</title> | ||
6 | + <style> | ||
7 | + h1,a { | ||
8 | + border:5px solid red; | ||
9 | + padding:5px; | ||
10 | + margin:20px; | ||
11 | + width:100px; | ||
12 | + } | ||
13 | + | ||
14 | + </style> | ||
15 | + </head> | ||
16 | + <body> | ||
17 | + | ||
18 | + <h1>Test</h1><br> This is <a href="index.html">test</a> site. | ||
19 | + | ||
20 | + </body> | ||
21 | +</html> |
archive/front/web/ex/colors.js
0 → 100644
1 | +var Links={ | ||
2 | + SetColor:function(color){ | ||
3 | + // var alist=document.querySelectorAll('a'); | ||
4 | + // var i =0; | ||
5 | + // while(i<alist.length) | ||
6 | + // { | ||
7 | + // alist[i].style.color=color; | ||
8 | + // i+=1; | ||
9 | + // } | ||
10 | + // } | ||
11 | + $('a').css('color',color); //jquery 사용한 것. | ||
12 | + } | ||
13 | +} | ||
14 | +var Body = { | ||
15 | + SetColor:function(color){ | ||
16 | + //document.querySelector('body').style.color= color; | ||
17 | + $('body').css('color',color); | ||
18 | + | ||
19 | + }, | ||
20 | + SetBackGruondColor:function(color){ | ||
21 | + //document.querySelector('body').style.backgroundColor= color; | ||
22 | + $('body').css('backgroundColor',color); | ||
23 | + } | ||
24 | +} | ||
25 | + | ||
26 | +function nightDayHandler(self){ | ||
27 | + if(self.value==='night') | ||
28 | + { | ||
29 | + Body.SetBackGruondColor('black') | ||
30 | + Body.SetColor('white'); | ||
31 | + self.value= 'day'; | ||
32 | + | ||
33 | + Links.SetColor('powderblue'); | ||
34 | + | ||
35 | + }else{ | ||
36 | + Body.SetBackGruondColor('white') | ||
37 | + Body.SetColor('black'); | ||
38 | + self.value= 'night'; | ||
39 | + | ||
40 | + Links.SetColor('blue'); | ||
41 | + } | ||
42 | + } |
archive/front/web/ex/fetch.html
0 → 100644
archive/front/web/ex/fetch2.html
0 → 100644
1 | +<!doctype html> | ||
2 | +<html> | ||
3 | +<head> | ||
4 | + <title>WEB1 - Welcome</title> | ||
5 | + <meta charset="utf-8"> | ||
6 | + <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> | ||
7 | + <script src="colors.js"></script> | ||
8 | + <script src="../fetch-master/fetch.js"></script> | ||
9 | +</head> | ||
10 | +<body> | ||
11 | + <h1><a href="#!welcome">WEB</a></h1> | ||
12 | + <h1><a href="index.html">WEB</a></h1> | ||
13 | + <h2><a href="welcome.html">Welcome</h2> | ||
14 | + <input id="night_day" type="button" value="night" onclick=" | ||
15 | + nightDayHandler(this); | ||
16 | + "> | ||
17 | + <ol id="nav"> | ||
18 | + | ||
19 | + </ol> | ||
20 | + <article> | ||
21 | + </article> | ||
22 | + <script> | ||
23 | + function fetchPage(name){ | ||
24 | + fetch(name).then(function(response){ | ||
25 | + response.text().then(function(text){ | ||
26 | + document.querySelector('article').innerHTML=text; | ||
27 | + }) | ||
28 | + }); | ||
29 | + } | ||
30 | + | ||
31 | + if(location.hash){ | ||
32 | + fetchPage(location.hash.substr(2)); | ||
33 | + }else{ | ||
34 | + fetchPage('welcome'); | ||
35 | + } | ||
36 | + fetch('list').then(function(response){ | ||
37 | + response.text().then(function(text){ | ||
38 | + document.querySelector('#nav').innerHTML=text; | ||
39 | + }) | ||
40 | + }); | ||
41 | + | ||
42 | + </script> | ||
43 | +</body> | ||
44 | +</html> |
archive/front/web/ex/grid.html
0 → 100644
1 | +<!DOCTYPE html> | ||
2 | +<html> | ||
3 | + <head> | ||
4 | + <meta charset="utf-8"> | ||
5 | + <title></title> | ||
6 | + <style> | ||
7 | + #grid{ | ||
8 | + border-color: pink; | ||
9 | + display:grid; | ||
10 | + grid-template-columns: 150px 1fr; | ||
11 | + } | ||
12 | + div{ | ||
13 | + border:5px solid gray; | ||
14 | + } | ||
15 | + </style> | ||
16 | + </head> | ||
17 | + <body> | ||
18 | + <div id="grid"> | ||
19 | + <div>NAVIGATION</div> | ||
20 | + <div> ARTICLE</div> | ||
21 | + </div> | ||
22 | + <!-- div(무생무체와 같은 태그 의미가 없음,디자인 용도) | ||
23 | + 는 block element span은 inline element --> | ||
24 | + </body> | ||
25 | +</html> |
archive/front/web/ex/mediaquery.html
0 → 100644
1 | +<!doctype html> | ||
2 | +<html> | ||
3 | +<head> | ||
4 | + <title>WEB - CSS</title> | ||
5 | + <meta charset="utf-8"> | ||
6 | + <style> | ||
7 | + body{ | ||
8 | + margin:0; | ||
9 | + } | ||
10 | + a { | ||
11 | + color:black; | ||
12 | + text-decoration: none; | ||
13 | + } | ||
14 | + h1 { | ||
15 | + font-size:45px; | ||
16 | + text-align: center; | ||
17 | + border-bottom:1px solid gray; | ||
18 | + margin:0; | ||
19 | + padding:20px; | ||
20 | + } | ||
21 | + ol{ | ||
22 | + border-right:1px solid gray; | ||
23 | + width:100px; | ||
24 | + margin:0; | ||
25 | + padding:20px; | ||
26 | + } | ||
27 | + #grid{ | ||
28 | + display: grid; | ||
29 | + grid-template-columns: 150px 1fr; | ||
30 | + } | ||
31 | + #grid ol{ | ||
32 | + padding-left:33px; | ||
33 | + } | ||
34 | + #grid #article{ | ||
35 | + padding-left:25px; | ||
36 | + } | ||
37 | + @media(max-width:800px){ | ||
38 | + #grid{ | ||
39 | + display: block; | ||
40 | + } | ||
41 | + ol{ | ||
42 | + border-right:none; | ||
43 | + } | ||
44 | + h1 { | ||
45 | + border-bottom:none; | ||
46 | + } | ||
47 | + } | ||
48 | + </style> | ||
49 | +</head> | ||
50 | +<body> | ||
51 | + <h1><a href="index.html">WEB</a></h1> | ||
52 | + <div id="grid"> | ||
53 | + <ol> | ||
54 | + <li><a href="1.html">HTML</a></li> | ||
55 | + <li><a href="2.html">CSS</a></li> | ||
56 | + <li><a href="3.html">JavaScript</a></li> | ||
57 | + </ol> | ||
58 | + <div id="article"> | ||
59 | + <h2>CSS</h2> | ||
60 | + <p> | ||
61 | + Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation of a document written in a markup language.[1] Although most often used to set the visual style of web pages and user interfaces written in HTML and XHTML, the language can be applied to any XML document, including plain XML, SVG and XUL, and is applicable to rendering in speech, or on other media. Along with HTML and JavaScript, CSS is a cornerstone technology used by most websites to create visually engaging webpages, user interfaces for web applications, and user interfaces for many mobile applications. | ||
62 | + </p> | ||
63 | + </div> | ||
64 | + </div> | ||
65 | + </body> | ||
66 | + </html> |
archive/front/web/ex/object.html
0 → 100644
1 | +<!DOCTYPE html> | ||
2 | +<html> | ||
3 | + <head> | ||
4 | + <meta charset="utf-8"> | ||
5 | + <title></title> | ||
6 | + </head> | ||
7 | + <body> | ||
8 | + <h1>how to make object</h1> | ||
9 | + <script> | ||
10 | + var coworkers = { | ||
11 | + "designer":"minsung", | ||
12 | + "programmer":"sdy" | ||
13 | + }; | ||
14 | + document.write("programmer: "+coworkers.programmer+"<br>"); | ||
15 | + document.write("designer: "+coworkers.designer+"<br>"); | ||
16 | + coworkers.bookkeeper="duru"; | ||
17 | + document.write("bookkeeper: "+coworkers.bookkeeper+"<br>"); | ||
18 | + coworkers["data scientist"] ="taeho"; | ||
19 | + document.write("data scientist: "+coworkers["data scientist"]+"<br>"); | ||
20 | + </script> | ||
21 | + | ||
22 | + <h2>iterate</h2> | ||
23 | + | ||
24 | + <h2>property & method</h2> | ||
25 | + <script> | ||
26 | + coworker.showAll =function(){ | ||
27 | + for(var key in this){ | ||
28 | + document.write(key+' : ' +this[key]+'<br>'); | ||
29 | + } | ||
30 | + } | ||
31 | + coworkers.showAll(); | ||
32 | + </script> | ||
33 | + </body> | ||
34 | +</html> |
archive/front/web/ex/usingobject.html
0 → 100644
1 | +<!doctype html> | ||
2 | +<html> | ||
3 | +<head> | ||
4 | +<title>KHU KHU Chat</title> | ||
5 | +<meta charset="utf-8"> | ||
6 | +<link rel="stylesheet" href="style.css"> | ||
7 | +<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"> | ||
8 | +//color.js 앞에 jquery 써줘야함 | ||
9 | +</script> | ||
10 | + | ||
11 | +<script src="colors.js"></script> | ||
12 | +</head> | ||
13 | +<body> | ||
14 | + <input id="night_day" type="button" value="night" onclick=" | ||
15 | + nightDayHandler(this); | ||
16 | + "> | ||
17 | + <!-- button2 making and using function --> | ||
18 | + <input id="night_day" type="button" value="night" onclick=" | ||
19 | + nightDayHandler(this); | ||
20 | + "> | ||
21 | + | ||
22 | + <div id="grid"> | ||
23 | + <ol> | ||
24 | + <li><a href="whatiskhuchat.html" class="saw">What is KHU chat? </a></li> | ||
25 | + <li><a href="loginmain.html" class="saw">로그인</a></li> | ||
26 | + <li><a href="signinmain.html" class="saw">회원가입</a></li> | ||
27 | + <li><a href="question.html" class="saw">문의사항</a></li> | ||
28 | + <li><a href="afterlogin.html" class="saw">로그인이후</a></li> | ||
29 | + </ol> | ||
30 | + <div id="article"> | ||
31 | + <h2>회원가입</h2> | ||
32 | + <div id="inputset"> | ||
33 | + <form class="signinform" action="loginmain.html"> | ||
34 | + <label for="email">Email:</label><br> | ||
35 | + <input type="text" name="email"><br> | ||
36 | + | ||
37 | + <label for="password">password:</label><br> | ||
38 | + <input type="password" name="password"><br> | ||
39 | + | ||
40 | + <label for="name">이름:</label><br> | ||
41 | + <input type="text" name="name"><br> | ||
42 | + | ||
43 | + <label for="age">나이:</label><br> | ||
44 | + <input type="text" name="age"><br><br> | ||
45 | + | ||
46 | + <label for="sex">성별:</label><br> | ||
47 | + <input type="radio" value="man" name="sex">남자<br> | ||
48 | + <input type="radio" value="woman" name="sex">여자<br><br> | ||
49 | + | ||
50 | + <label for="work">직업:</label><br> | ||
51 | + <input type="radio" value="nowork" name="work">무직<br> | ||
52 | + <input type="radio" value="Hstudent" name="work">중/고생<br> | ||
53 | + <input type="radio" value="Ustudent" name="work">대학생<br> | ||
54 | + <input type="radio" value="worker" name="work">직장인<br><br> | ||
55 | + | ||
56 | + <label for="interesting">관심사(중복선택가능):</label><br> | ||
57 | + <input type="checkbox" value="movie" name="interesting">영화<br> | ||
58 | + <input type="checkbox" value="song" name="interesting">노래<br> | ||
59 | + <input type="checkbox" value="study" name="interesting">공부<br> | ||
60 | + <input type="checkbox" value="coding" name="interesting">코딩<br><br> | ||
61 | + | ||
62 | + <input type="submit" value="회원가입신청"> | ||
63 | + </form> | ||
64 | + </div> | ||
65 | + | ||
66 | + | ||
67 | + </div> | ||
68 | + </div> | ||
69 | + | ||
70 | + | ||
71 | + </body> | ||
72 | + </html> |
archive/front/web/image/coding.jpg
0 → 100644
672 KB
archive/front/web/image/login.jpg
0 → 100644
1.6 MB
archive/front/web/image/main2.jpg
0 → 100644
9.03 MB
archive/front/web/image/question.jpg
0 → 100644
807 KB
archive/front/web/image/signin.jpg
0 → 100644
861 KB
3.14 MB
archive/front/web/image/welcome.jpg
0 → 100644
2.55 MB
... | @@ -12,11 +12,11 @@ | ... | @@ -12,11 +12,11 @@ |
12 | <div class="media" id="grid"> | 12 | <div class="media" id="grid"> |
13 | <div id="category"> | 13 | <div id="category"> |
14 | <ol class="center"> | 14 | <ol class="center"> |
15 | - <li><a class="dr-icon" href="service/whatiskhuchat.html">What is KHU chat? </a></li> | 15 | + <li><a href="service/whatiskhuchat.html" class="saw">What is KHU chat? </a></li> |
16 | - <li><a class="dr-icon"href="loginmain.html" >로그인</a></li> | 16 | + <li><a href="loginmain.html" class="saw">로그인</a></li> |
17 | - <li><a class="dr-icon" href="signinmain.html">회원가입</a></li> | 17 | + <li><a href="signinmain.html" class="saw">회원가입</a></li> |
18 | - <li><a class="dr-icon"href="question.html" >문의사항</a></li> | 18 | + <li><a href="question.html" class="saw">문의사항</a></li> |
19 | - <li><a class="dr-icon"href="afterlogin.html" >로그인이후</a></li> | 19 | + <li><a href="afterlogin.html" class="saw">로그인이후</a></li> |
20 | </ol> | 20 | </ol> |
21 | </div> | 21 | </div> |
22 | <div id="article"> | 22 | <div id="article"> | ... | ... |
... | @@ -4,37 +4,38 @@ | ... | @@ -4,37 +4,38 @@ |
4 | <title>KHU KHU Chat</title> | 4 | <title>KHU KHU Chat</title> |
5 | <meta charset="utf-8"> | 5 | <meta charset="utf-8"> |
6 | <link rel="stylesheet" href="style/style.css"> | 6 | <link rel="stylesheet" href="style/style.css"> |
7 | -<style> | ||
8 | 7 | ||
9 | -</style> | ||
10 | </head> | 8 | </head> |
11 | <body> | 9 | <body> |
12 | 10 | ||
13 | <h1><a href="main.html" color:black>KHU Chatting service</a></h1> | 11 | <h1><a href="main.html" color:black>KHU Chatting service</a></h1> |
14 | <img src="image/main2.jpg" class="image"> | 12 | <img src="image/main2.jpg" class="image"> |
15 | 13 | ||
16 | - <div id="grid"> | 14 | +<div id="grid"> |
17 | - <ol> | 15 | + <div id="category"> |
18 | - <li><a href="whatiskhuchat.html" class="saw">What is KHU chat? </a></li> | 16 | + <ol class="center"> |
17 | + <li><a href="service/whatiskhuchat.html" class="saw">What is KHU chat? </a></li> | ||
19 | <li><a href="loginmain.html" class="saw">로그인</a></li> | 18 | <li><a href="loginmain.html" class="saw">로그인</a></li> |
20 | <li><a href="signinmain.html" class="saw">회원가입</a></li> | 19 | <li><a href="signinmain.html" class="saw">회원가입</a></li> |
21 | <li><a href="question.html" class="saw">문의사항</a></li> | 20 | <li><a href="question.html" class="saw">문의사항</a></li> |
21 | + <li><a href="afterlogin.html" class="saw">로그인이후</a></li> | ||
22 | </ol> | 22 | </ol> |
23 | - <div id="article"> | ||
24 | - <h2>로그인 </h2> | ||
25 | - <form class="formlogin" action="member.html" id="login"> | ||
26 | - <label for="email">mail:</label><br> | ||
27 | - <input type="text" id="Email" name="email"><br> | ||
28 | - <label for="password">password:</label><br> | ||
29 | - <input type="password" id="password" name="password"><br><br> | ||
30 | - <input type="submit" value="로그인"><br> | ||
31 | - </form> | ||
32 | - <form class="formlogin" action="signinmain.html" id="signin"> | ||
33 | - <input type="submit" value="회원가입"> | ||
34 | - | ||
35 | - </form> | ||
36 | - | ||
37 | </div> | 23 | </div> |
24 | + <article> | ||
25 | + | ||
26 | + </article> | ||
27 | + <div id="article"> | ||
28 | + <h2><a href=https://www.helpshift.com/glossary/chat-service/ | ||
29 | + title="what is chat service">chat service란 무엇인가?</a></h2> | ||
30 | + <p>This is chating application which chats with your frineds, coworkers and anyone do you want <br> | ||
31 | + so enjoy it out sevice. | ||
32 | + </p> | ||
33 | + <h2><a href=service/whatiskhuchat.html title="what is KHU chat"> | ||
34 | + 1.What is KHU chat ?</a></h2> | ||
35 | + <p> | ||
36 | + KHU chat service는 무엇인가요? | ||
37 | + </p> | ||
38 | </div> | 38 | </div> |
39 | +</div> | ||
39 | </body> | 40 | </body> |
40 | </html> | 41 | </html> | ... | ... |
... | @@ -13,11 +13,11 @@ | ... | @@ -13,11 +13,11 @@ |
13 | <div id="grid"> | 13 | <div id="grid"> |
14 | <div id="category"> | 14 | <div id="category"> |
15 | <ol class="center"> | 15 | <ol class="center"> |
16 | - <li><a class="dr-icon" href="service/whatiskhuchat.html" >What is KHU chat? </a></li> | 16 | + <li><a href="service/whatiskhuchat.html" class="saw">What is KHU chat? </a></li> |
17 | - <li><a class="dr-icon" href="loginmain.html">로그인</a></li> | 17 | + <li><a href="loginmain.html" class="saw">로그인</a></li> |
18 | - <li><a class="dr-icon" href="signinmain.html" >회원가입</a></li> | 18 | + <li><a href="signinmain.html" class="saw">회원가입</a></li> |
19 | - <li><a class="dr-icon" href="question.html" >문의사항</a></li> | 19 | + <li><a href="question.html" class="saw">문의사항</a></li> |
20 | - <li><a class="dr-icon" href="afterlogin.html" >로그인이후</a></li> | 20 | + <li><a href="afterlogin.html" class="saw">로그인이후</a></li> |
21 | </ol> | 21 | </ol> |
22 | </div> | 22 | </div> |
23 | <div id="article"> | 23 | <div id="article"> | ... | ... |
archive/front/web/service/addfriend.html
0 → 100644
This diff is collapsed. Click to expand it.
archive/front/web/service/chatservice.html
0 → 100644
This diff is collapsed. Click to expand it.
archive/front/web/service/makefriend.html
0 → 100644
This diff is collapsed. Click to expand it.
archive/front/web/service/randomchat.html
0 → 100644
This diff is collapsed. Click to expand it.
archive/front/web/service/whatiskhuchat.html
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
archive/front/web/style/style.css
0 → 100644
This diff is collapsed. Click to expand it.
archive/front/web/test.md
0 → 100644
This diff is collapsed. Click to expand it.
archive/front/yarn.lock
0 → 100644
This diff could not be displayed because it is too large.
archive/package.json
0 → 100644
This diff is collapsed. Click to expand it.
archive/면담확인서/김민성/3월면담확인서.hwp
0 → 100644
No preview for this file type
archive/면담확인서/신동윤/3월면담확인서.hwp
0 → 100644
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
patch.diff
0 → 100644
This diff is collapsed. Click to expand it.
-
Please register or login to post a comment