Skip to content

Commit

Permalink
feat: create initial template for xtreme labs project
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanDavidBuitrago committed Nov 26, 2024
1 parent ccd13c1 commit a00db07
Show file tree
Hide file tree
Showing 40 changed files with 111 additions and 46,859 deletions.
4 changes: 0 additions & 4 deletions .env
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
NODE_ENV='production'
ACCESS_TOKEN_COOKIE_NAME=''
BASE_URL=''
CREDENTIALS_BASE_URL=''
CSRF_TOKEN_API_PATH=''
ECOMMERCE_BASE_URL=''
LANGUAGE_PREFERENCE_COOKIE_NAME=''
LMS_BASE_URL=''
LOGIN_URL=''
Expand All @@ -12,8 +10,6 @@ LOGO_URL=''
LOGO_TRADEMARK_URL=''
LOGO_WHITE_URL=''
FAVICON_URL=''
MARKETING_SITE_BASE_URL=''
ORDER_HISTORY_URL=''
REFRESH_ACCESS_TOKEN_ENDPOINT=''
SEGMENT_KEY=''
SITE_NAME=''
Expand Down
8 changes: 2 additions & 6 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
NODE_ENV='development'
PORT=8080
PORT=2004
ACCESS_TOKEN_COOKIE_NAME='edx-jwt-cookie-header-payload'
BASE_URL='http://localhost:8080'
CREDENTIALS_BASE_URL='http://localhost:18150'
BASE_URL='http://localhost:2004'
CSRF_TOKEN_API_PATH='/csrf/api/v1/token'
ECOMMERCE_BASE_URL='http://localhost:18130'
LANGUAGE_PREFERENCE_COOKIE_NAME='openedx-language-preference'
LMS_BASE_URL='http://localhost:18000'
LOGIN_URL='http://localhost:18000/login'
Expand All @@ -13,8 +11,6 @@ LOGO_URL=https://edx-cdn.org/v3/default/logo.svg
LOGO_TRADEMARK_URL=https://edx-cdn.org/v3/default/logo-trademark.svg
LOGO_WHITE_URL=https://edx-cdn.org/v3/default/logo-white.svg
FAVICON_URL=https://edx-cdn.org/v3/default/favicon.ico
MARKETING_SITE_BASE_URL='http://localhost:18000'
ORDER_HISTORY_URL='http://localhost:1996/orders'
REFRESH_ACCESS_TOKEN_ENDPOINT='http://localhost:18000/login_refresh'
SEGMENT_KEY=''
SITE_NAME=localhost
Expand Down
4 changes: 0 additions & 4 deletions .env.test
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
ACCESS_TOKEN_COOKIE_NAME='edx-jwt-cookie-header-payload'
BASE_URL='http://localhost:1995'
CREDENTIALS_BASE_URL='http://localhost:18150'
CSRF_TOKEN_API_PATH='/csrf/api/v1/token'
ECOMMERCE_BASE_URL='http://localhost:18130'
LANGUAGE_PREFERENCE_COOKIE_NAME='openedx-language-preference'
LMS_BASE_URL='http://localhost:18000'
LOGIN_URL='http://localhost:18000/login'
Expand All @@ -11,8 +9,6 @@ LOGO_URL=https://edx-cdn.org/v3/default/logo.svg
LOGO_TRADEMARK_URL=https://edx-cdn.org/v3/default/logo-trademark.svg
LOGO_WHITE_URL=https://edx-cdn.org/v3/default/logo-white.svg
FAVICON_URL=https://edx-cdn.org/v3/default/favicon.ico
MARKETING_SITE_BASE_URL='http://localhost:18000'
ORDER_HISTORY_URL='http://localhost:1996/orders'
REFRESH_ACCESS_TOKEN_ENDPOINT='http://localhost:18000/login_refresh'
SEGMENT_KEY=''
SITE_NAME=localhost
Expand Down
5 changes: 4 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
coverage/*
dist/
node_modules/
jest.config.js
jest.config.js

.eslintrc.js
test-utils.jsx
13 changes: 12 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
const { createConfig } = require('@edx/frontend-build');

module.exports = createConfig('eslint');
module.exports = createConfig('eslint', {
'rules': {
'import/prefer-default-export': 'off',
},
'settings': {
'import/resolver': {
'node': {
'paths': ['src'],
},
},
},
});
19 changes: 0 additions & 19 deletions .github/workflows/add-depr-ticket-to-depr-board.yml

This file was deleted.

8 changes: 2 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Default CI
on:
on:
push:
branches:
- 'master'
- 'main'
pull_request:
branches:
- '**'
Expand Down Expand Up @@ -32,9 +32,5 @@ jobs:
run: npm run test
- name: Build
run: npm run build
- name: i18n_extract
run: npm run i18n_extract
- name: is-es5
run: npm run is-es5
- name: Coverage
uses: codecov/codecov-action@v3
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.17.1
16.20.2
17 changes: 2 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
transifex_resource = frontend-template-application
transifex_resource = frontend-app-xtreme-labs
transifex_langs = "ar,fr,es_419,zh_CN"

transifex_utils = ./node_modules/.bin/transifex-utils.js
i18n = ./src/i18n
transifex_input = $(i18n)/transifex_input.json
tx_url1 = https://www.transifex.com/api/2/project/edx-platform/resource/$(transifex_resource)/translation/en/strings/
tx_url2 = https://www.transifex.com/api/2/project/edx-platform/resource/$(transifex_resource)/source/

Expand All @@ -17,21 +14,11 @@ precommit:
requirements:
npm install

i18n.extract:
# Pulling display strings from .jsx files into .json files...
rm -rf $(transifex_temp)
npm run-script i18n_extract

i18n.concat:
# Gathering JSON messages into one file...
$(transifex_utils) $(transifex_temp) $(transifex_input)

extract_translations: | requirements i18n.extract i18n.concat
extract_translations: | requirements

# Despite the name, we actually need this target to detect changes in the incoming translated message files as well.
detect_changed_source_translations:
# Checking for changed translations...
git diff --exit-code $(i18n)

# Pushes translations to Transifex. You must run make extract_translations first.
push_translations:
Expand Down
75 changes: 0 additions & 75 deletions README-template-frontend-app.rst

This file was deleted.

64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Fronend App Xtreme Labs

## Introduction

This MFE application for Xtreme Labs Project offers an extensive range of features and a user-friendly interface for any given course with the Xtreme Labs feature enabled.

## Cloning and Startup

### Node setup

It's important to note that this MFE is build with Node v16, so we shall ensure that that's the proper and only version instaled in our workspace.
To do so please execute the following commands in your Ubuntu's terminal

``` bash
# installs nvm (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

# download and install Node.js (you may need to restart the terminal)
nvm install 16

# verifies the right Node.js version is in the environment
node -v # should print 'v16.20.2'

# verifies the right NPM version is in the environment
npm -v # should print '8.19.4'
```

Once this was done, please excute `nvm ls` it shall show an output like this (please be aware of the version pointed by an arrow)

``` bash
xps-9315 ~/home $ nvm ls
-> v16.20.2
default -> 16 (-> v16.20.2)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v16.20.2) (default)
stable -> 16.20 (-> v16.20.2) (default)
lts/* -> lts/iron (-> N/A)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.1 (-> N/A)
lts/erbium -> v12.22.12 (-> N/A)
lts/fermium -> v14.21.3 (-> N/A)
lts/gallium -> v16.20.2
lts/hydrogen -> v18.20.3 (-> N/A)
lts/iron -> v20.15.0 (-> N/A)
```

If there's any other prior or further version installed, please remove it with `nvm uninstall vXX.XX.X`

### Project setup

Clone this repo into the `/src` folder of your devstack installation, once it has been cloned, follow the next command:

`cd frontend-app-xtreme-labs && npm install`

It would place you onto the repository folder and install de dependencies nedeed for the project to run. With that just execute
`npm start`. There shall be a frontend running in http://localhost:2004/

## Testing

- Jest test: `npm test`
- Lint test: `npm run lint`
76 changes: 0 additions & 76 deletions README.rst

This file was deleted.

10 changes: 0 additions & 10 deletions codecov.yml

This file was deleted.

5 changes: 0 additions & 5 deletions docs/how_tos/i18n.rst

This file was deleted.

Loading

0 comments on commit a00db07

Please sign in to comment.