sungjin

Release 1.0 version

...@@ -17,21 +17,13 @@ ...@@ -17,21 +17,13 @@
17 *** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use. 17 *** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use.
18 *** https://www.markdownguide.org/basic-syntax/#reference-style-links 18 *** https://www.markdownguide.org/basic-syntax/#reference-style-links
19 --> 19 -->
20 -[![Contributors][contributors-shield]][contributors-url]
21 -[![Forks][forks-shield]][forks-url]
22 -[![Stargazers][stars-shield]][stars-url]
23 -[![Issues][issues-shield]][issues-url]
24 -[![MIT License][license-shield]][license-url]
25 -[![LinkedIn][linkedin-shield]][linkedin-url]
26 -
27 -
28 20
29 <!-- PROJECT LOGO --> 21 <!-- PROJECT LOGO -->
30 <br /> 22 <br />
31 23
32 <div align="center"> 24 <div align="center">
33 - <a href="https://github.com/github_username/repo_name"> 25 + <a href="http://khuhub.khu.ac.kr/2021105619/learn_in_web">
34 - <img src="images/logo.png" alt="Logo" width="80" height="80"> 26 + <img src="logo.svg" alt="Logo" width="80" height="80">
35 </a> 27 </a>
36 <h3 align="center">Learn In Web</h3> 28 <h3 align="center">Learn In Web</h3>
37 29
...@@ -81,7 +73,7 @@ ...@@ -81,7 +73,7 @@
81 <!-- ABOUT THE PROJECT --> 73 <!-- ABOUT THE PROJECT -->
82 ## About The Project 74 ## About The Project
83 75
84 -[![Product Name Screen Shot][product-screenshot]](https://example.com) 76 +[![Product Name Screen Shot][product-screenshot]](https://code.sungjin.dev)
85 77
86 This project allows users to run codes and study without any IDE. This project focusd on schools, and students for study. 78 This project allows users to run codes and study without any IDE. This project focusd on schools, and students for study.
87 79
...@@ -179,7 +171,7 @@ _For Demo, please see my demo website [Demo](https://code.sungjin.dev/)_ ...@@ -179,7 +171,7 @@ _For Demo, please see my demo website [Demo](https://code.sungjin.dev/)_
179 - [ ] English 171 - [ ] English
180 - [ ] Japanese 172 - [ ] Japanese
181 173
182 -- [ ] View code run time 174 +- [ ] Custom Input
183 - [ ] Add competition between users with runtime. 175 - [ ] Add competition between users with runtime.
184 176
185 See the [open issues](https://github.com/othneildrew/Best-README-Template/issues) for a full list of proposed features (and known issues). 177 See the [open issues](https://github.com/othneildrew/Best-README-Template/issues) for a full list of proposed features (and known issues).
...@@ -209,7 +201,7 @@ Don't forget to give the project a star! Thanks again! ...@@ -209,7 +201,7 @@ Don't forget to give the project a star! Thanks again!
209 <!-- LICENSE --> 201 <!-- LICENSE -->
210 ## License 202 ## License
211 203
212 -Distributed under the MIT License. See `LICENSE.txt` for more information. 204 +Distributed under the MIT License.
213 205
214 <p align="right">(<a href="#top">back to top</a>)</p> 206 <p align="right">(<a href="#top">back to top</a>)</p>
215 207
...@@ -226,29 +218,8 @@ Project Link: [http://khuhub.khu.ac.kr/2021105619/learn_in_web](http://khuhub.kh ...@@ -226,29 +218,8 @@ Project Link: [http://khuhub.khu.ac.kr/2021105619/learn_in_web](http://khuhub.kh
226 218
227 219
228 220
229 -<!-- ACKNOWLEDGMENTS -->
230 -## Acknowledgments
231 -
232 -* []()
233 -* []()
234 -* []()
235 -
236 <p align="right">(<a href="#top">back to top</a>)</p> 221 <p align="right">(<a href="#top">back to top</a>)</p>
237 222
238 223
239 224
240 -<!-- MARKDOWN LINKS & IMAGES --> 225 +[product-screenshot]: screenshot.png
241 -<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
242 -[contributors-shield]: https://img.shields.io/github/contributors/github_username/repo_name.svg?style=for-the-badge
243 -[contributors-url]: https://github.com/github_username/repo_name/graphs/contributors
244 -[forks-shield]: https://img.shields.io/github/forks/github_username/repo_name.svg?style=for-the-badge
245 -[forks-url]: https://github.com/github_username/repo_name/network/members
246 -[stars-shield]: https://img.shields.io/github/stars/github_username/repo_name.svg?style=for-the-badge
247 -[stars-url]: https://github.com/github_username/repo_name/stargazers
248 -[issues-shield]: https://img.shields.io/github/issues/github_username/repo_name.svg?style=for-the-badge
249 -[issues-url]: https://github.com/github_username/repo_name/issues
250 -[license-shield]: https://img.shields.io/github/license/github_username/repo_name.svg?style=for-the-badge
251 -[license-url]: https://github.com/github_username/repo_name/blob/master/LICENSE.txt
252 -[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
253 -[linkedin-url]: https://linkedin.com/in/linkedin_username
254 -[product-screenshot]: images/screenshot.png
......
1 +<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M2 5a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5zm3.293 1.293a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1 0 1.414l-3 3a1 1 0 0 1-1.414-1.414L7.586 10 5.293 7.707a1 1 0 0 1 0-1.414zM11 12a1 1 0 1 0 0 2h3a1 1 0 1 0 0-2h-3z" clip-rule="evenodd"/></svg>
...\ No newline at end of file ...\ No newline at end of file
...@@ -15,9 +15,7 @@ export const login = async (email, password) => { ...@@ -15,9 +15,7 @@ export const login = async (email, password) => {
15 if (response == undefined || (response.status !== 200 && response.status !== 201)) { 15 if (response == undefined || (response.status !== 200 && response.status !== 201)) {
16 throw alert('Login failed!'); 16 throw alert('Login failed!');
17 } 17 }
18 - console.log(response.data.access_token)
19 useSession.accessToken = response.data.access_token; 18 useSession.accessToken = response.data.access_token;
20 - console.log("로그인" + useSession.accessToken);
21 return response.data; 19 return response.data;
22 } 20 }
23 21
...@@ -65,7 +63,6 @@ export const refreshToken = async () => { ...@@ -65,7 +63,6 @@ export const refreshToken = async () => {
65 } 63 }
66 64
67 export const validateToken = async () => { 65 export const validateToken = async () => {
68 - console.log(useSession.accessToken);
69 if(useSession.accessToken == undefined){ 66 if(useSession.accessToken == undefined){
70 return false; 67 return false;
71 } 68 }
......
1 -export const SERVER_BASE_URL = 'https://do.sungjin.dev';
...\ No newline at end of file ...\ No newline at end of file
1 +export const SERVER_BASE_URL = 'LOCAL_SERVER_BASE_URL';
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -55,7 +55,6 @@ export const getPostsByDifficulty = async (difficulty) => { ...@@ -55,7 +55,6 @@ export const getPostsByDifficulty = async (difficulty) => {
55 if (response.status !== 200) { 55 if (response.status !== 200) {
56 throw new Error('Failed to get posts!'); 56 throw new Error('Failed to get posts!');
57 } 57 }
58 - console.log(response.data);
59 return response.data; 58 return response.data;
60 } 59 }
61 60
......
...@@ -3,9 +3,6 @@ import router from "next/router" ...@@ -3,9 +3,6 @@ import router from "next/router"
3 import { Button } from "semantic-ui-react" 3 import { Button } from "semantic-ui-react"
4 4
5 export default function Nav() { 5 export default function Nav() {
6 - const moverun = () => {
7 - router.push("/run")
8 - }
9 6
10 const movenew = () => { 7 const movenew = () => {
11 router.push("/new") 8 router.push("/new")
...@@ -24,9 +21,6 @@ export default function Nav() { ...@@ -24,9 +21,6 @@ export default function Nav() {
24 <nav className="navbar"> 21 <nav className="navbar">
25 <div className="flex px-10 sm:px-20 text-2xl whitespace-nowrap 22 <div className="flex px-10 sm:px-20 text-2xl whitespace-nowrap
26 space-x-10 sm:space-x-20"> 23 space-x-10 sm:space-x-20">
27 - <Button onClick={moverun} className="cursor-pointer transition
28 - duration-100 transform hover:scale-125 hover:text-black
29 - active:text-white">테스트</Button>
30 <Button onClick={movelow} className="cursor-pointer transition 24 <Button onClick={movelow} className="cursor-pointer transition
31 duration-100 transform hover:scale-125 hover:text-black 25 duration-100 transform hover:scale-125 hover:text-black
32 active:text-white">난이도 </Button> 26 active:text-white">난이도 </Button>
......
...@@ -12,7 +12,6 @@ export default function Popular() { ...@@ -12,7 +12,6 @@ export default function Popular() {
12 }, []); 12 }, []);
13 13
14 const DateType = (date) => { 14 const DateType = (date) => {
15 - console.log(date);
16 const dateObj = new Date(date); 15 const dateObj = new Date(date);
17 const month = dateObj.toLocaleString("default", { month: "long" }); 16 const month = dateObj.toLocaleString("default", { month: "long" });
18 const day = dateObj.getDate(); 17 const day = dateObj.getDate();
......
1 -// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
2 -
3 -export default function handler(req, res) {
4 - res.status(200).json({ name: 'John Doe' })
5 -}
...@@ -12,7 +12,6 @@ export default function Popular() { ...@@ -12,7 +12,6 @@ export default function Popular() {
12 }, []); 12 }, []);
13 13
14 const DateType = (date) => { 14 const DateType = (date) => {
15 - console.log(date);
16 const dateObj = new Date(date); 15 const dateObj = new Date(date);
17 const month = dateObj.toLocaleString("default", { month: "long" }); 16 const month = dateObj.toLocaleString("default", { month: "long" });
18 const day = dateObj.getDate(); 17 const day = dateObj.getDate();
......
...@@ -12,7 +12,6 @@ export default function Popular() { ...@@ -12,7 +12,6 @@ export default function Popular() {
12 }, []); 12 }, []);
13 13
14 const DateType = (date) => { 14 const DateType = (date) => {
15 - console.log(date);
16 const dateObj = new Date(date); 15 const dateObj = new Date(date);
17 const month = dateObj.toLocaleString("default", { month: "long" }); 16 const month = dateObj.toLocaleString("default", { month: "long" });
18 const day = dateObj.getDate(); 17 const day = dateObj.getDate();
......
...@@ -12,7 +12,6 @@ export default function Popular() { ...@@ -12,7 +12,6 @@ export default function Popular() {
12 }, []); 12 }, []);
13 13
14 const DateType = (date) => { 14 const DateType = (date) => {
15 - console.log(date);
16 const dateObj = new Date(date); 15 const dateObj = new Date(date);
17 const month = dateObj.toLocaleString("default", { month: "long" }); 16 const month = dateObj.toLocaleString("default", { month: "long" });
18 const day = dateObj.getDate(); 17 const day = dateObj.getDate();
......
...@@ -32,7 +32,6 @@ export default function New() { ...@@ -32,7 +32,6 @@ export default function New() {
32 const testoutput = form.testoutput.value.split("\n"); 32 const testoutput = form.testoutput.value.split("\n");
33 const difficulty = form.level.value; 33 const difficulty = form.level.value;
34 const post = await newPost(title, explain, example, testinput, testoutput, difficulty); 34 const post = await newPost(title, explain, example, testinput, testoutput, difficulty);
35 - console.log(post);
36 router.push("/"); 35 router.push("/");
37 }; 36 };
38 return ( 37 return (
......
...@@ -22,7 +22,6 @@ export default function Post() { ...@@ -22,7 +22,6 @@ export default function Post() {
22 if (!router.isReady) return; 22 if (!router.isReady) return;
23 const { id } = router.query 23 const { id } = router.query
24 getPostbyId(id).then(res => { 24 getPostbyId(id).then(res => {
25 - console.log(res);
26 setPost(res) 25 setPost(res)
27 }) 26 })
28 }, [router.isReady]); 27 }, [router.isReady]);
...@@ -36,13 +35,14 @@ export default function Post() { ...@@ -36,13 +35,14 @@ export default function Post() {
36 const [comment, setComment] = useState(""); 35 const [comment, setComment] = useState("");
37 36
38 const addComment = async () => { 37 const addComment = async () => {
39 - console.log("comment is " + comment);
40 const { id } = router.query 38 const { id } = router.query
41 - await createComment(id, comment) 39 + await createComment(id, comment);
40 + getPostbyId(id).then(res => {
41 + setPost(res)
42 + })
42 } 43 }
43 44
44 const displayComment = () => { 45 const displayComment = () => {
45 - console.log(post.comments);
46 if (post.comments != undefined) { 46 if (post.comments != undefined) {
47 return post.comments.map(comment => ( 47 return post.comments.map(comment => (
48 <div className="flex w-full border-carbon border-4 rounded-xl my-2"> 48 <div className="flex w-full border-carbon border-4 rounded-xl my-2">
...@@ -66,15 +66,12 @@ export default function Post() { ...@@ -66,15 +66,12 @@ export default function Post() {
66 return; 66 return;
67 } 67 }
68 var result = await run(code, value); 68 var result = await run(code, value);
69 - console.log(result);
70 setAnswer(`출력 : ${result}`); 69 setAnswer(`출력 : ${result}`);
71 } 70 }
72 71
73 const testinput = () => { 72 const testinput = () => {
74 const insert = post.testinput; 73 const insert = post.testinput;
75 - console.log("insert = " + insert);
76 if (insert === [""] || insert === undefined) { 74 if (insert === [""] || insert === undefined) {
77 - console.log("없음");
78 return <div></div> 75 return <div></div>
79 } 76 }
80 return <div> 77 return <div>
...@@ -87,9 +84,7 @@ export default function Post() { ...@@ -87,9 +84,7 @@ export default function Post() {
87 84
88 const testoutput = () => { 85 const testoutput = () => {
89 const insert = post.testoutput; 86 const insert = post.testoutput;
90 - console.log("insert = " + insert);
91 if (insert === [""] || insert === undefined) { 87 if (insert === [""] || insert === undefined) {
92 - console.log("없음");
93 return <div></div> 88 return <div></div>
94 } 89 }
95 return <div> 90 return <div>
......
1 -import "@uiw/react-textarea-code-editor/dist.css";
2 -import dynamic from "next/dynamic";
3 -import { useState } from "react";
4 -import { Button } from "semantic-ui-react";
5 -import { run } from "../api/runner/runner";
6 -import { useRouter } from "next/dist/client/router";
7 -
8 -const CodeEditor = dynamic(
9 - () => import("@uiw/react-textarea-code-editor").then((mod) => mod.default),
10 - { ssr: false }
11 -);
12 -
13 -export default function Run() {
14 - const router = useRouter();
15 -
16 - const [value, setValue] = useState("c");
17 -
18 - const [code, setCode] = useState("");
19 -
20 - const [answer, setAnswer] = useState("");
21 -
22 - const runCode = async function () {
23 - var result = await run(code, value);
24 - console.log(result);
25 - setAnswer(result);
26 - }
27 -
28 - return (<div>
29 - <select value={value} onChange={(e) => setValue(e.target.value)}>
30 - <option value="c">c</option>
31 - <option value="cpp">cpp</option>
32 - <option value="js">javascript</option>
33 - </select>
34 - <CodeEditor
35 - value={code}
36 - language={value}
37 - placeholder="Please Enter the Code."
38 - onChange={(e) => setCode(e.target.value)}
39 - padding={15}
40 - style={{
41 - fontSize: 12,
42 - backgroundColor: "#f5f5f5",
43 - fontFamily:
44 - "ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace"
45 - }}
46 - />
47 - <Button onClick={runCode}>Run</Button>
48 - <div>{answer}</div>
49 - </div>);
50 -}
...\ No newline at end of file ...\ No newline at end of file
1 import { searchPost } from "../api/post/post"; 1 import { searchPost } from "../api/post/post";
2 import { useState } from "react"; 2 import { useState } from "react";
3 import { SearchIcon } from "@heroicons/react/outline"; 3 import { SearchIcon } from "@heroicons/react/outline";
4 +import { Link } from "@nextui-org/react";
4 5
5 export default function Search() { 6 export default function Search() {
6 const handleSubmit = async (e) => { 7 const handleSubmit = async (e) => {
7 e.preventDefault(); 8 e.preventDefault();
8 const search = await searchPost(e.target.search.value); 9 const search = await searchPost(e.target.search.value);
9 - console.log(search)
10 setResult(search); 10 setResult(search);
11 } 11 }
12 12
...@@ -24,9 +24,9 @@ export default function Search() { ...@@ -24,9 +24,9 @@ export default function Search() {
24 <h1 className="text-2xl font-bold">Search Result</h1> 24 <h1 className="text-2xl font-bold">Search Result</h1>
25 {result.map((post) => { 25 {result.map((post) => {
26 return ( 26 return (
27 - <div> 27 + <Link href={`/post/${post.id}`}>
28 - <h2>{post.title}</h2> 28 + <h2 className="text-xl">{post.title}</h2>
29 - </div> 29 + </Link>
30 ) 30 )
31 })} 31 })}
32 </div> 32 </div>
......
...@@ -32,7 +32,6 @@ export default function Signup() { ...@@ -32,7 +32,6 @@ export default function Signup() {
32 const email = form.email.value; 32 const email = form.email.value;
33 const password = form.password.value; 33 const password = form.password.value;
34 const passwordConfirm = form.passwordConfirm.value; 34 const passwordConfirm = form.passwordConfirm.value;
35 - console.log(name, email, password, passwordConfirm);
36 if (password !== passwordConfirm) { 35 if (password !== passwordConfirm) {
37 alert("Passwords do not match"); 36 alert("Passwords do not match");
38 return; 37 return;
......