Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment #1 #56

Merged
merged 9 commits into from
May 21, 2022
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
LICENSE
README.md

# JS
.eslintrc.js
.prettierc.js
# Linter
.prettierc
.eslintrc.yaml

# Node
node_modules/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/end-to-end-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
- name: Run cypress
uses: cypress-io/github-action@v2
with:
start: docker run -p 3000:3000 ipc:latest
wait-on: "http://localhost:3000"
start: docker run -p 8080:80 ipc:latest
wait-on: "http://localhost:8080"

- name: Get screenshots
uses: actions/upload-artifact@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/eslint-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
uses: actions/checkout@v2

- name: Install dependencies
run: npm install
run: yarn

- name: Run eslint
run: npm run lint > eslint-results
run: yarn lint > eslint-results

- name: Get eslint results
uses: actions/upload-artifact@v1
Expand Down
16 changes: 8 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
# Contributing to [PROJECT'S NAME]
# Contributing to InterPlanetaryCloud

## Create an issue

- If you've encountered a bug, open a [Bug Report](https://github.com/PoCInnovation/$REPOSITORY/issues/new?assignees=&labels=&template=bug_report.md&title=).
- If you want [PROJECT'S NAME] to have a new fonctionality, open a [Feature Request](https://github.com/PoCInnovation/$REPOSITORY/issues/new?assignees=&labels=&template=feature_request.md&title=).
- If you've encountered a bug, open a [Bug Report](https://github.com/PoCInnovation/InterPlanetaryCloud/issues/new?assignees=&labels=&template=bug_report.md&title=).
- If you want InterPlanetaryCloud to have a new fonctionality, open a [Feature Request](https://github.com/PoCInnovation/InterPlanetaryCloud/issues/new?assignees=&labels=&template=feature_request.md&title=).

## Resolve an issue

Select an [issue](https://github.com/PoCInnovation/$REPOSITORY/issues) that you want to resolve.
Select an [issue](https://github.com/PoCInnovation/InterPlanetaryCloud/issues) that you want to resolve.

The recommended workflow is to fork this repository and open pull requests from your fork.

### 1. Fork, clone & configure [PROJECT'S NAME] upstream
### 1. Fork, clone & configure InterPlanetaryCloud upstream

- Click on the _Fork_ button on GitHub
- Clone the original repository
- Add your repository as a new remote

```sh
# Clone original repository
git clone [email protected]:PoCInnovation/$REPOSITORY.git
git clone [email protected]:PoCInnovation/InterPlanetaryCloud.git

# Add your fork as a remove
git remote add <fork_name> https://github.com/$YOUR_GITHUB_USER/$REPOSITORY.git
git remote add <fork_name> https://github.com/$YOUR_GITHUB_USER/InterPlanetaryCloud.git
```

### 2. Create a pull request
Expand All @@ -40,7 +40,7 @@ git commit -s
# Push your new branch
git push <fork name>

# Create a new pull request from https://github.com/PoCInnovation/$REPOSITORY/pulls
# Create a new pull request from https://github.com/PoCInnovation/InterPlanetaryCloud/pulls
```

### 3. Update your pull request with latest changes
Expand Down
40 changes: 31 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,41 @@
# Set the base image
FROM node:16.5-alpine
###
# Builder image
###
FROM node:16.5-alpine AS builder

# Retrieve sources
WORKDIR /app
COPY . /app

# Install dependecies
adrienfort marked this conversation as resolved.
Show resolved Hide resolved
COPY package.json .
COPY yarn.lock .

# Install dependencies
RUN npm install
RUN yarn install

# Copy source (see .dockerignore)
COPY . .

# Add env variable
ENV REACT_APP_ALEPH_CHANNEL=TEST

# Build source
RUN yarn run build

###
# Production image
###
FROM nginx:1.21.6-alpine as app

WORKDIR /app

# Copy code
COPY --from=builder /app/build /usr/share/nginx/html

# Copy nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf

# Expose PORT
EXPOSE 3000
EXPOSE 80

# Declare entrypoint
ENTRYPOINT ["npm"]
CMD ["start"]
# Prefix commands and start production
ENTRYPOINT ["nginx", "-g", "daemon off;"]
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ docker build . -t ipc:latest

```
# Run IPC docker image
docker run -p 3000:3000 ipc:latest
docker run -p 8080:80 ipc:latest
```

You are now ready to access to your decentralized cloud :boom: !
You are now ready to access to your decentralized cloud at [`http://localhost:8080`](http://localhost:8080) :boom: !

## Get involved

Expand Down Expand Up @@ -227,6 +227,25 @@ We use [Aleph SDK TS](https://github.com/aleph-im/aleph-sdk-ts#readme).

## Our PoC team :ok_hand:

### April 2022 - September 2022
Developpers - Team Storage:

| [<img src="https://github.com/RezaRahemtola.png?size=85" width=85><br><sub>Reza Rahemtola</sub>](https://github.com/RezaRahemtola) | [<img src="https://github.com/TristanMasselot.png?size=85" width=85><br><sub>Tristan Masselot</sub>](https://github.com/TristanMasselot) | [<img src="https://github.com/Samoten777.png?size=85" width=85><br><sub>Samoten 777</sub>](https://github.com/Samoten777)
|:---:|:---:|:---:|

Developpers - Team Computing:

| [<img src="https://github.com/AmozPay.png?size=85" width=85><br><sub>Amoz Pay</sub>](https://github.com/AmozPay)| [<img src="https://github.com/ZerLock.png?size=85" width=85><br><sub>Léo Dubosclard</sub>](https://github.com/ZerLock) | [<img src="https://github.com/Alex-Prevot.png?size=85" width=85><br><sub>Alex Prevot</sub>](https://github.com/Alex-Prevot)
|:---:|:---:|:---:|

Project Manager:
| [<img src="https://github.com/adrienfort.png?size=85" width=85><br><sub>Adrien Fort</sub>](https://github.com/adrienfort)
| :---: |

Reviewers :
| [<img src="https://github.com/lucas-louis.png?size=85" width=85><br><sub>Lucas Louis</sub>](https://github.com/lucas-louis)
| :---: |

### September 2021 - April 2022
Developers:
| [<img src="https://github.com/lucas-louis.png?size=85" width=85><br><sub>Lucas Louis</sub>](https://github.com/lucas-louis) | [<img src="https://github.com/lolboysg.png?size=85" width=85><br><sub>Matéo Viel</sub>](https://github.com/lolboysg)
Expand Down
3 changes: 2 additions & 1 deletion cypress.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"watchForFileChanges": false
"watchForFileChanges": false,
"baseUrl": "http://localhost:8080"
}
6 changes: 3 additions & 3 deletions cypress/integration/dashboard.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ let dashboardSpecMnemonic = '';

describe('Create account for DashboardView tests', () => {
it('Connect', () => {
cy.visit('http://localhost:3000/signup');
cy.visit('/signup');
cy.wait(1000);
cy.get('#ipc-signupView-credentials-signup-button').click();
cy.get('#ipc-signupView-text-area')
Expand All @@ -18,7 +18,7 @@ describe('Upload a file modal for DashboardView', () => {
const fixtureFile = 'upload_test_file.txt';

beforeEach(() => {
cy.visit('http://localhost:3000/login');
cy.visit('/login');
cy.wait(1000);
cy.get('#ipc-loginView-text-area').click().type(dashboardSpecMnemonic);
cy.get('#ipc-loginView-credentials-button').click().wait(3000);
Expand All @@ -41,7 +41,7 @@ describe('Upload a file modal for DashboardView', () => {

describe('Download a file for DashboardView', () => {
beforeEach(() => {
cy.visit('http://localhost:3000/login');
cy.visit('/login');
cy.wait(1000);
cy.get('#ipc-loginView-text-area').click().type(dashboardSpecMnemonic);
cy.get('#ipc-loginView-credentials-button').click();
Expand Down
6 changes: 3 additions & 3 deletions cypress/integration/dashboardFront.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ let dashboardSpecMnemonic = '';

describe('Create account for DashboardView tests', () => {
it('Connect', () => {
cy.visit('http://localhost:3000/signup');
cy.visit('/signup');
cy.wait(1000);
cy.get('#ipc-signupView-credentials-signup-button').click();
cy.get('#ipc-signupView-text-area')
Expand All @@ -16,7 +16,7 @@ describe('Create account for DashboardView tests', () => {

describe('Good front for DashboardView', () => {
it('Go to dashboard view', () => {
cy.visit('http://localhost:3000/login');
cy.visit('/login');
cy.wait(1000);
cy.get('#ipc-loginView-text-area').click().type(dashboardSpecMnemonic);
cy.get('#ipc-loginView-credentials-button').click();
Expand All @@ -34,7 +34,7 @@ describe('Good front for DashboardView', () => {

describe('Good Modal Front for DashboardView', () => {
it('Go to upload modal into dashboard view', () => {
cy.visit('http://localhost:3000/login');
cy.visit('/login');
cy.wait(1000);
cy.get('#ipc-loginView-text-area').click().type(dashboardSpecMnemonic);
cy.get('#ipc-loginView-credentials-button').click().wait(3000);
Expand Down
10 changes: 5 additions & 5 deletions cypress/integration/home.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe('Good front for HomeView', () => {
it('Go to home view', () => {
cy.visit('http://localhost:3000');
cy.visit('');
cy.wait(1000);
});

Expand All @@ -27,22 +27,22 @@ describe('Good front for HomeView', () => {

describe('Create Account Button for HomeView', () => {
it('Go to home view', () => {
cy.visit('http://localhost:3000');
cy.visit('');
cy.wait(1000);
});

it('Good URL redirect for create account button', () => {
cy.get('#ipc-homeView-create-account-button').click().url().should('eq', 'http://localhost:3000/signup');
cy.get('#ipc-homeView-create-account-button').click().url().should('eq', 'http://localhost:8080/signup');
});
});

describe('Login Button form HomeView', () => {
it('Go to home view', () => {
cy.visit('http://localhost:3000');
cy.visit('');
cy.wait(1000);
});

it('Good URL redirect for login button', () => {
cy.get('#ipc-homeView-login-button').click().url().should('eq', 'http://localhost:3000/login');
cy.get('#ipc-homeView-login-button').click().url().should('eq', 'http://localhost:8080/login');
});
});
10 changes: 5 additions & 5 deletions cypress/integration/login.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const mnemonic = 'repair nest celery light distance coil giant pyramid poet suit

describe('Good front for LoginView', () => {
it('Go to login view', () => {
cy.visit('http://localhost:3000/login');
cy.visit('/login');
cy.wait(1000);
});

Expand Down Expand Up @@ -33,7 +33,7 @@ describe('Good front for LoginView', () => {

describe('Login with credentials Button for LoginView', () => {
it('Go to login view', () => {
cy.visit('http://localhost:3000/login');
cy.visit('/login');
cy.wait(1000);
cy.get('#ipc-loginView-text-area').click().type(mnemonic);
});
Expand All @@ -43,17 +43,17 @@ describe('Login with credentials Button for LoginView', () => {
});

it('Good URL redirect for login button', () => {
cy.get('#ipc-loginView-credentials-button').click().url().should('eq', 'http://localhost:3000/dashboard');
cy.get('#ipc-loginView-credentials-button').click().url().should('eq', 'http://localhost:8080/dashboard');
});
});

describe('Signup Button for LoginView', () => {
it('Go to login view', () => {
cy.visit('http://localhost:3000/login');
cy.visit('/login');
cy.wait(1000);
});

it('Good URL redirect for signup button', () => {
cy.get('#ipc-loginView-signup-button').click().url().should('eq', 'http://localhost:3000/signup');
cy.get('#ipc-loginView-signup-button').click().url().should('eq', 'http://localhost:8080/signup');
});
});
12 changes: 6 additions & 6 deletions cypress/integration/signup.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe('Good front for SignupView', () => {
it('Go to signup view', () => {
cy.visit('http://localhost:3000/signup');
cy.visit('/signup');
cy.wait(1000);
});

Expand All @@ -27,7 +27,7 @@ describe('Good front for SignupView', () => {

describe('Good Modal front for SignupView', () => {
it('Go to signup view', () => {
cy.visit('http://localhost:3000/signup');
cy.visit('/signup');
cy.wait(1000);
cy.get('#ipc-signupView-credentials-signup-button').click();
});
Expand Down Expand Up @@ -55,7 +55,7 @@ describe('Good Modal front for SignupView', () => {

describe('Signup with credentials Button for SignupView', () => {
it('Go to signup view', () => {
cy.visit('http://localhost:3000/signup');
cy.visit('/signup');
cy.wait(1000);
cy.get('#ipc-signupView-credentials-signup-button').click();
cy.get(1000);
Expand All @@ -73,17 +73,17 @@ describe('Signup with credentials Button for SignupView', () => {

it('Good URL redirect for close button', () => {
cy.wait(1000);
cy.get('#ipc-modal-close-button').click().url().should('eq', 'http://localhost:3000/dashboard');
cy.get('#ipc-modal-close-button').click().url().should('eq', 'http://localhost:8080/dashboard');
});
});

describe('Login Button for SignupView', () => {
it('Go to signup view', () => {
cy.visit('http://localhost:3000/signup');
cy.visit('/signup');
cy.wait(1000);
});

it('Good URL redirect for login button', () => {
cy.get('#ipc-signupView-login-button').click().url().should('eq', 'http://localhost:3000/login');
cy.get('#ipc-signupView-login-button').click().url().should('eq', 'http://localhost:8080/login');
});
});
15 changes: 15 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
server {
listen 80;
server_name localhost;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri /index.html;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
Loading