Skip to content

Commit f8ec29a

Browse files
committed
Merge remote-tracking branch 'origin/master' into #4-Edit-full-text-plus-replace-only-trainer
2 parents 60705de + 7934ee1 commit f8ec29a

19 files changed

Lines changed: 362 additions & 25 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,23 @@ jobs:
88
steps:
99
- name: Checkout repository
1010
uses: actions/checkout@v2
11-
- name: Install
11+
- name: Install front
1212
run: |
1313
cd front
1414
npm install
15+
- name: Install back
16+
run: |
17+
cd back
18+
npm install
1519
- name: Build
1620
run: |
1721
cd front
1822
npm run build
19-
- name: Tests
23+
- name: Tests front
2024
run: |
2125
cd front
2226
npm test
27+
- name: Tests back
28+
run: |
29+
cd back
30+
npm test

‎README.md‎

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,77 @@
1-
# code-paster
1+
<!-- PROJECT SHIELDS -->
2+
<!--
3+
*** I'm using markdown "reference style" links for readability.
4+
*** Reference links are enclosed in brackets [ ] instead of parentheses ( ).
5+
*** See the bottom of this document for the declaration of the reference variables
6+
*** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use.
7+
*** https://www.markdownguide.org/basic-syntax/#reference-style-links
8+
-->
9+
10+
[![Contributors][contributors-shield]][contributors-url]
11+
[![Forks][forks-shield]][forks-url]
12+
[![Stargazers][stars-shield]][stars-url]
13+
[![Issues][issues-shield]][issues-url]
14+
[![MIT License][license-shield]][license-url]
15+
16+
<!-- PROJECT LOGO -->
17+
<br />
18+
<p align="center">
19+
<a href="https://github.com/Lemoncode/code-paster">
20+
<img src="images/logo.png" alt="Logo" width="800" height="330">
21+
</a>
22+
<p align="center">
23+
Code Paster is a Teacher-to-Student communication tool for online programming lessons. Create a new session and easily share your code with all students connected so they can follow along with your examples.
24+
</p>
25+
</p>
26+
<br />
27+
28+
<!-- TABLE OF CONTENTS -->
29+
30+
## Table of Contents
31+
32+
- [About the Project](#about-the-project)
33+
- [Built With](#built-with)
34+
- [Roadmap](#roadmap)
35+
- [License](#license)
36+
37+
<!-- ABOUT THE PROJECT -->
38+
39+
## About The Project
40+
41+
During your programming online lessons you will write hundreds of lines of code and dozens of snippets. For students following along with the code there's nothing more annoying than falling behind the explanation because of a small typo or a missed variable. With Code Paster you can simply copy your code examples and share it in real time with your classroom.
42+
43+
This project was developed by Lemoncode Frontend Master students:
44+
45+
<!-- Include collaborators -->
46+
47+
### Built With
48+
49+
- [React](https://github.com/facebook/react/)
50+
- [Material-UI](https://material-ui.com/)
51+
- [Socket.io](https://socket.io/)
52+
53+
<!-- ROADMAP -->
54+
55+
## Roadmap
56+
57+
See the [open issues](https://github.com/Lemoncode/code-paster/issues) for a list of proposed features (and known issues).
58+
59+
<!-- LICENSE -->
60+
61+
## License
62+
63+
Distributed under the MIT License. See `LICENSE` for more information.
64+
65+
<!-- MARKDOWN LINKS & IMAGES -->
66+
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
67+
68+
[contributors-shield]: https://img.shields.io/github/contributors/Lemoncode/code-paster.svg?style=flat-square
69+
[contributors-url]: https://github.com/Lemoncode/code-paster/graphs/contributors
70+
[forks-shield]: https://img.shields.io/github/forks/Lemoncode/code-paster.svg?style=flat-square
71+
[forks-url]: https://github.com/Lemoncode/code-paster/network/members
72+
[stars-shield]: https://img.shields.io/github/stars/Lemoncode/code-paster.svg?style=flat-square
73+
[stars-url]: https://github.com/Lemoncode/code-paster/stargazers
74+
[issues-shield]: https://img.shields.io/github/issues/Lemoncode/code-paster.svg?style=flat-square
75+
[issues-url]: https://github.com/Lemoncode/code-paster/issues
76+
[license-shield]: https://img.shields.io/github/license/Lemoncode/code-paster.svg?style=flat-square
77+
[license-url]: https://github.com/Lemoncode/code-paster/blob/master/LICENSE.txt

‎back/config/test/jest.js‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
rootDir: '../../',
3+
preset: 'ts-jest',
4+
restoreMocks: true,
5+
setupFiles: ['<rootDir>/config/test/setup.js'],
6+
modulePathIgnorePatterns: ['node_modules', '<rootDir>/dist/'],
7+
testEnvironment: 'node',
8+
moduleDirectories: ['<rootDir>/src', 'node_modules'],
9+
};

‎back/config/test/setup.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
const { config } = require('dotenv');
2+
config({
3+
path: './.env',
4+
});

‎back/package.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
"build:dev": "npm run clean && babel src -d dist --ignore=\"./src/test-runners\" --extensions \".ts\" --source-maps",
1414
"type-check": "tsc --noEmit",
1515
"type-check:watch": "npm run type-check -- --watch",
16+
"test": "cross-env NODE_ENV=test jest -c ./config/test/jest.js --verbose",
17+
"test:watch": "npm run test -- --watchAll -i --no-cache",
1618
"clean": "rimraf dist"
1719
},
1820
"repository": {
@@ -35,11 +37,14 @@
3537
"@babel/preset-typescript": "^7.10.4",
3638
"@types/cors": "^2.8.7",
3739
"@types/express": "^4.17.7",
40+
"@types/jest": "^26.0.15",
3841
"@types/socket.io": "^2.1.10",
3942
"cross-env": "^7.0.2",
43+
"jest": "^26.6.1",
4044
"nodemon": "^2.0.4",
4145
"npm-run-all": "^4.1.5",
4246
"rimraf": "^3.0.2",
47+
"ts-jest": "^26.4.2",
4348
"typescript": "^3.9.7"
4449
},
4550
"dependencies": {
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
describe('Room name generator business spec', () => {
2+
it('', () => {
3+
const dummy = true;
4+
expect(dummy).toEqual(true);
5+
});
6+
});

‎front/config/test/jest.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ module.exports = {
44
restoreMocks: true,
55
moduleDirectories: ['<rootDir>/src', 'node_modules'],
66
setupFilesAfterEnv: ['<rootDir>/config/test/setup.ts'],
7+
modulePathIgnorePatterns: ['cypress'],
78
};

‎front/dev.env‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
NODE_ENV=development
2-
API_URL=http://localhost:8081
2+
BASE_API_URL=http://localhost:8081
33
BASE_SOCKET_URL=http://localhost:3001

‎front/prod.env‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
NODE_ENV=production
2-
API_URL=http://localhost:8080
2+
BASE_API_URL=http://localhost:8080
33
BASE_SOCKET_URL=http://localhost:3001

‎front/src/core/api.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as ioClient from 'socket.io-client';
22
import { Socket } from 'socket.io';
3+
import { baseSocketUrl } from './const';
34

45
export interface ConnectionSetup {
56
room: string;
@@ -9,7 +10,7 @@ export interface ConnectionSetup {
910
export const createSocket = (connectionSetup: ConnectionSetup): Socket => {
1011
const { room, trainertoken } = connectionSetup;
1112
const socketParams = {
12-
url: process.env.BASE_SOCKET_URL,
13+
url: baseSocketUrl,
1314
options: {
1415
query: { room, trainertoken },
1516
timeout: 60000,

0 commit comments

Comments
 (0)