Skip to content

Commit 3de3187

Browse files
committed
R 1.0.0-Beta Merge branch 'develop'
2 parents 666c2cb + 3c26432 commit 3de3187

32 files changed

+469
-332
lines changed

.travis.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,22 @@ matrix:
1212
- sudo apt-get update
1313
- sudo apt-get install yarn -y
1414
- sudo yarn global add coveralls
15+
- sudo yarn global add create-react-app
16+
- sudo yarn global add serve
17+
- sudo yarn global add typescript
18+
- sudo yarn global add react-scripts-ts
19+
- sudo yarn global add gulp
20+
- sudo yarn global add node-pty
21+
- sudo yarn global add node-gyp
22+
- sudo apt install make -y
23+
- sudo apt install g++ -y
1524
- cd src/client
16-
- yarn install
25+
- yarn add git+https://github.com/CodeChillAlluna/xterm.js.git
26+
- yarn install --no-bin-links
27+
- cd node_modules/xterm
28+
- npm install
29+
- cd ../..
30+
- ls node_modules/xterm -al
1731

1832
script:
1933
- yarn build
@@ -24,12 +38,15 @@ matrix:
2438
jdk: oraclejdk8
2539

2640
sudo: required
41+
services:
42+
- docker
2743
before_script:
2844
- sudo apt-get install -y maven
2945
- sudo apt-get install -y python-dev
3046
- sudo apt-get install -y libpq-dev
3147
- sudo service postgresql restart
3248
- sudo sh install/db.sh
49+
- sudo sh install/docker.sh
3350
- cd src/spring
3451

3552
script:
@@ -38,4 +55,4 @@ matrix:
3855
- sudo sh mvnw clean test -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID jacoco:report coveralls:report
3956

4057
notifications:
41-
email: false
58+
email: false

README.md

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,18 @@ Master project : Online development environment
1212
* If you want to set up our project from scratch using our vagrant click [here](#vagrant-installation-guide)
1313
* If you want to set up our project without vagrant click [here](#vagrantless-installation-guide)
1414
# Release installation guide
15-
* You need <a href="http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html">Java 8+</a> , <a href="https://nodejs.org/en/">NodeJS 9+</a> and <a href="https://www.postgresql.org/download/">PostgresSQL</a>.
16-
* Create a user `code` with password `chill` in postgresSQL
17-
* Create a database `codechill` and grant permission on this database to your user.
18-
* You can install Code&Chill <a href="https://github.com/CodeChillAlluna/code-chill/releases">here</a>.
19-
* Go to your spring repository : `cd ./spring`
20-
* Run the command : `java -jar spring-0.1.0.jar`
21-
* And then : `npm install serve`
22-
* To run the server : `serve -s client`
23-
* You can go to <a href="http://localhost:5000/">http://localhost:5000/</a> on your browser to access to your terminal.
15+
You can run our releases in our vagrant or install it on your own machine.
16+
You can download our releases <a href="https://github.com/CodeChillAlluna/code-chill/releases">here</a>
17+
## Install on Vagrant
18+
1. Extract the release in your vagrant folder.
19+
2. Follow <a href="#vagrant-installation-guide">Vagrant installation guide</a>
20+
3. Launch <a href="#production-mode">Server</a>
21+
4. Launch <a href="#production-mode-1">Client</a>
22+
## Install on your machine
23+
1. Extract the release on your machine.
24+
2. Install all the dependancies (Check `install/install.sh` to have all dependancies).
25+
3. Launch <a href="#production-mode">Server</a>
26+
4. Launch <a href="#production-mode-1">Client</a>
2427

2528
# Vagrant installation guide
2629
## Environment installation
@@ -54,31 +57,36 @@ You will find all our project dependancies in `install/install.sh`
5457
Choose either of the solutions:
5558
- Cloning the repository : `git clone https://github.com/CodeChillAlluna/code-chill.git`
5659
- Downloading the repository : `https://github.com/CodeChillAlluna/code-chill/archive/master.zip`
60+
- Downloading our release : `https://github.com/CodeChillAlluna/code-chill/releases`
5761

5862
# Usage
5963
## Spring
60-
### Build Spring
64+
### Production Mode
6165
To build Spring, you will have to use the following command lines :
6266

6367
1. `cd src/spring` : will place you in the source dictionnary.
6468
2. `sh mvnw clean package` : will compile java files to create a runnable jar package.
6569
3. `cd target` : will place you in the build dictionnary of the project.
6670
4. `java -jar spring-0.0.1-SNAPSHOT.jar` : will launch the Spring project, depending on what you are using the version might not always be "0.0.1".
67-
### Run Spring
71+
5. Server API accessible at `http://localhost:8080/`
72+
### Development Mode
6873
To run Spring in development mode, you will have to use the following command lines :
6974
1. `cd src/spring` : will place you in the source dictionnary.
7075
2. `sh mvnw spring-boot:run`: will compile the source code and launch the spring server
76+
3. Server API accessible at `http://localhost:8080/`
7177

7278
## React
73-
### Build React
79+
### Production Mode
7480
To build React, you will have to use the following command lines :
7581
1. `cd src/client` : will place you in the source dictionnary.
7682
2. `sudo yarn install` : will install if they are missing and update the dependencies of the project.
7783
3. `yarn build` : will build the project.
7884
4. `serve -s build` : will launch the project properly.
79-
### Run React
85+
5. Website accessible at `http://localhost:5000/`
86+
### Development Mode
8087
To run react in development mode, you will have to use the following command lines :
8188
1. `cd src/client` : will place you in the source dictionnary.
8289
2. `sudo yarn install` : will install if they are missing and update the dependencies of the project.
8390
3. `yarn start`: will check your code validity and launch the node server.
91+
4. Website accessible at `http://localhost:3000/`
8492

Vagrantfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ Vagrant.configure("2") do |config|
3333
# Create a forwarded port mapping which allows access to a specific port
3434
# within the machine from a port on the host machine and only allow access
3535
# via 127.0.0.1 to disable public access
36+
config.vm.network "public_network", ip: "192.168.1.97"
3637
config.vm.network "forwarded_port", guest: 8080, host: 8080, host_ip: "127.0.0.1"
3738
config.vm.network "forwarded_port", guest: 3000, host: 3000, host_ip: "127.0.0.1"
3839
config.vm.network "forwarded_port", guest: 5000, host: 5000, host_ip: "127.0.0.1"
3940
config.vm.network "forwarded_port", guest: 2375, host: 2375, host_ip: "127.0.0.1"
4041
config.vm.network "forwarded_port", guest: 2376, host: 2376, host_ip: "127.0.0.1"
42+
config.vm.network "forwarded_port", guest: 80, host: 80, host_ip: "127.0.0.1"
4143

4244
# Create a private network, which allows host-only access to the machine
4345
# using a specific IP.

install/db.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
DB_USER=code
44
DB_PWD=chill
55
DB_NAME=codechill
6+
DB_NAME_TEST=codechill_test
67

78
sudo su - postgres -c psql <<EOF
89
CREATE DATABASE $DB_NAME;
@@ -16,3 +17,15 @@ GRANT ALL PRIVILEGES ON DATABASE $DB_NAME TO $DB_USER;
1617
ALTER USER $DB_USER CREATEDB;
1718
EOF
1819

20+
sudo su - postgres -c psql <<EOF
21+
CREATE DATABASE $DB_NAME_TEST;
22+
CREATE USER $DB_USER WITH PASSWORD '$DB_PWD';
23+
24+
ALTER ROLE $DB_USER SET client_encoding TO 'utf8';
25+
ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';
26+
ALTER ROLE $DB_USER SET timezone TO 'UTC';
27+
28+
GRANT ALL PRIVILEGES ON DATABASE $DB_NAME_TEST TO $DB_USER;
29+
ALTER USER $DB_USER CREATEDB;
30+
EOF
31+

install/docker.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
# Installation de Docker
4+
export DOCKER_HOST=tcp://localhost:2375
5+
if ! grep -qF "DOCKER_HOST=tcp://localhost:2375" /etc/environment
6+
then
7+
echo "DOCKER_HOST=tcp://localhost:2375" >> /etc/environment
8+
fi
9+
source /etc/environment
10+
systemctl restart docker
11+
docker pull ubuntu
12+
docker run --name code-chill -dti ubuntu /bin/bash

install/install.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ sudo apt-get install -y postgresql-contrib
7575
DB_USER=code
7676
DB_PWD=chill
7777
DB_NAME=codechill
78+
DB_NAME_TEST=codechill_test
7879

7980
sudo service postgresql restart
8081
sudo su - postgres -c psql <<EOF
@@ -89,6 +90,18 @@ GRANT ALL PRIVILEGES ON DATABASE $DB_NAME TO $DB_USER;
8990
ALTER USER $DB_USER CREATEDB;
9091
EOF
9192

93+
sudo su - postgres -c psql <<EOF
94+
CREATE DATABASE $DB_NAME_TEST;
95+
CREATE USER $DB_USER WITH PASSWORD '$DB_PWD';
96+
97+
ALTER ROLE $DB_USER SET client_encoding TO 'utf8';
98+
ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';
99+
ALTER ROLE $DB_USER SET timezone TO 'UTC';
100+
101+
GRANT ALL PRIVILEGES ON DATABASE $DB_NAME_TEST TO $DB_USER;
102+
ALTER USER $DB_USER CREATEDB;
103+
EOF
104+
92105
# Installation de Docker
93106
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
94107
sudo apt-key fingerprint 0EBFCD88
@@ -140,12 +153,19 @@ systemctl restart docker
140153
docker pull ubuntu
141154
docker run --name code-chill -dti ubuntu /bin/bash
142155

156+
# Install nginx
157+
sudo apt-get install nginx
158+
143159
# Install js packages
144160
cd $client
145161
yarn global add create-react-app
146162
yarn global add serve
147163
yarn global add typescript
148164
yarn global add react-scripts-ts
165+
yarn global add gulp
166+
167+
sudo apt-get install make -y
168+
sudo apt-get install g++ -y
149169

150170
# Fix error with shared folder and npm modules
151171
# https://medium.com/@dtinth/isolating-node-modules-in-vagrant-9e646067b36
@@ -155,6 +175,9 @@ mkdir $client/node_modules
155175
# sudo mount --rbind $HOME_DIR/vagrant_node_modules $client/node_modules
156176

157177
# Install client dependencies
178+
yarn add git+https://github.com/CodeChillAlluna/xterm.js.git --no-bin-links
158179
yarn install --no-bin-links
180+
cd node_modules/xterm
181+
npm install --no-bin-links
159182

160183
print_help

src/client/package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
2-
"name": "my-app",
3-
"version": "0.1.0",
2+
"name": "code-chill",
3+
"version": "1.0.0-Beta",
44
"private": true,
5+
"homepage": "/",
6+
"restApi": "http://localhost:8080",
7+
"dockerApi": "ws://localhost:2375",
58
"dependencies": {
69
"@types/lodash": "^4.14.104",
710
"@types/react-redux": "^5.0.14",
@@ -12,11 +15,12 @@
1215
"react-dom": "^16.2.0",
1316
"react-redux": "^5.0.6",
1417
"react-router-dom": "^4.2.2",
18+
"react-router-named-routes": "^0.0.23",
1519
"react-scripts-ts": "2.12.0",
1620
"semantic-ui-css": "^2.2.14",
1721
"semantic-ui-react": "^0.78.2",
1822
"text-encoding": "^0.6.4",
19-
"xterm": "^3.1.0"
23+
"xterm": "git+https://github.com/CodeChillAlluna/xterm.js.git"
2024
},
2125
"scripts": {
2226
"start": "react-scripts-ts start",

src/client/public/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<meta name="msapplication-TileColor" content="#ffffff">
2727
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
2828
<meta name="theme-color" content="#ffffff">
29+
<meta name="description" content="Have you ever wanted to code something in your couch ? Code&Chill is now here for you. Don't forget this: a good developper is a lazy one" />
2930
<!--
3031
Notice the use of %PUBLIC_URL% in the tags above.
3132
It will be replaced with the URL of the `public` folder during the build.
@@ -35,7 +36,7 @@
3536
work correctly both with client-side routing and a non-root public URL.
3637
Learn how to configure a non-root public URL by running `npm run build`.
3738
-->
38-
<title>React App</title>
39+
<title>Code&Chill</title>
3940
</head>
4041
<body>
4142
<noscript>

src/client/public/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"short_name": "React App",
3-
"name": "Create React App Sample",
2+
"short_name": "Code&Chill",
3+
"name": "Code&Chill",
44
"icons": [
55
{
66
"src": "favicon.ico",

src/client/src/App.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,7 @@
3434
from { transform: rotate(0deg); }
3535
to { transform: rotate(360deg); }
3636
}
37+
38+
#root {
39+
margin-top: 5em;
40+
}

0 commit comments

Comments
 (0)