Skip to content

Commit d00715a

Browse files
authored
Merge pull request #987 from topcoder-platform/PM-462_platform-ui-deployment-docs
PM-462 platform UI deployment docs
2 parents 318981f + ee0d667 commit d00715a

File tree

81 files changed

+300
-22
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+300
-22
lines changed

src/apps/admin/src/index.ts

-4
This file was deleted.

src/apps/dev-center/src/dev-center-pages/community-app/landing-page/dev-center-get-started/GetStartedCardsContainer/GetStartedCardsContainer.tsx

+19-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { FC } from 'react'
22

3+
import { BookOpenIcon } from '@heroicons/react/outline'
34
import { LinkButton } from '~/libs/ui'
45

56
import { ApiCornerIcon, ApiIcon, CommunityAppCornerIcon, CommunityAppIcon } from '../../../../../assets/i'
@@ -29,15 +30,31 @@ const GetStartedCardsContainer: FC = () => (
2930
<DevCenterCard
3031
cornerIcon={<ApiCornerIcon />}
3132
icon={<ApiIcon />}
32-
title='Platform UI Storybook'
33+
title='Platform UI'
3334
titleClass={styles.apiTitle}
34-
description='Explore the Platform UI Storybook for UI development.'
35+
description='Check out instructions on how to get started with the Platform UI.'
3536
button={(
3637
<LinkButton
3738
primary
3839
size='lg'
3940
label='get started'
4041
className={styles.button}
42+
to={`${rootRoute}/platform-ui`}
43+
/>
44+
)}
45+
/>
46+
<DevCenterCard
47+
cornerIcon={<ApiCornerIcon />}
48+
icon={<BookOpenIcon className='icon-mx' />}
49+
title='Platform UI Storybook'
50+
titleClass=''
51+
description='Explore the Platform UI Storybook for UI development.'
52+
button={(
53+
<LinkButton
54+
primary
55+
size='lg'
56+
label='explore'
57+
className={styles.button}
4158
to={`${rootRoute}/storybook`}
4259
/>
4360
)}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
# Platform UI
2+
3+
The Platform UI is the official Topcoder web app to host all modern user interfaces to be used by all users.
4+
5+
All future user interfaces at Topcoder will be implemented here. Pre-existing user interfaces will be ported to here over time until this is the only user interface any user sees when interacting with Topcoder.
6+
7+
## Local Environment Setup
8+
9+
### Install VS Code
10+
11+
Preferably, use the VS Code IDE for development.
12+
13+
[https://code.visualstudio.com/download](https://code.visualstudio.com/download)
14+
15+
### GIT
16+
17+
Install git on your local machine. This is trivial for working in the community.
18+
You can follow these guides for installing GIT:
19+
20+
- [Windows](https://local.topcoder-dev.com/devcenter/getting-started#23-install-git)
21+
- [Linux](https://local.topcoder-dev.com/devcenter/getting-started#197-install-git)
22+
23+
### nvm
24+
25+
Use the node version manager [nvm](https://github.com/nvm-sh/nvm/blob/master/README.md) to easily and safely manage the required version of NodeJS (aka, node). Download and install it per the instructions for your development operating system. Installing a version of node via `nvm` will also install `npm`.
26+
27+
> **NOTE:** If the nvm command is not working it might be because the installation failed to update your paths variable properly. To try and fix this try installing nvm again using sudo.
28+
29+
Once nvm is installed, run:
30+
31+
```sh
32+
nvm install <insert node version>
33+
```
34+
35+
At the root of the project directory you'll notice a file called `.nvmrc` which specifies the node version used by the project. The command `nvm use` will use the version specified in the file if no version is supplied on the command line.
36+
See [the nvm Github README](https://github.com/nvm-sh/nvm/blob/master/README.md#nvmrc) for more information on setting this up.
37+
38+
> **NOTE:** The current node version mentioned in the `.nvmrc` is `22.13.0`
39+
40+
You can verify the versions of `nvm`, `node`, and `npm` using the commands below.
41+
42+
| Command | Supported Version |
43+
| ------------- | ----------------- |
44+
| `% npm -v` | 10.9.2 |
45+
| `% node -v` | v22.13.0 |
46+
47+
> **NOTE:** The `yarn start` command requires the `NVM_DIR` env variable is set.
48+
49+
```sh
50+
export NVM_DIR=~/.nvm
51+
```
52+
53+
### Hosting
54+
55+
You will need to add the following line to your hosts file. The hosts file is normally located at `/etc/hosts` (Mac & Linux) or %SYSTEMROOT%\System32\drivers\etc\hosts (Windows). Do not overwrite the existing localhost entry also pointing to 127.0.0.1.
56+
57+
```
58+
127.0.0.1 local.topcoder-dev.com
59+
```
60+
61+
### Building and serving the application
62+
63+
1. Open a terminal
64+
2. Run the following commands
65+
66+
```sh
67+
git clone https://github.com/topcoder-platform/platform-ui.git
68+
cd platform-ui
69+
yarn install
70+
yarn start
71+
```
72+
73+
3. Go to https://local.topcoder-dev.com
74+
75+
> **NOTE**: The site must run on port 443 in order for auth0 to work and for the site to load properly. Mac users will need to run the app with elevated permissions, as in:
76+
77+
```sh
78+
sudo yarn start
79+
```
80+
81+
Run following command to allow node to run apps on ports lowert than 500 (Mac & Linux):
82+
83+
```sh
84+
sudo setcap 'cap_net_bind_service=+ep' `which node`
85+
```
86+
87+
### Local SSL
88+
89+
SSL is required for authentication to work properly.
90+
91+
The `yarn start` command serves the site using the cert and key in the /ssl directory, which authorize the `https://local.topcoder-dev.com` URL.
92+
93+
By overriding the app to use **port 443**, you can use the authorized URL and trust the root CA to avoid SSL errors in the browser.
94+
95+
> **NOTE:** Mac and Linux users will require running the app with elevated permissions in order to use a port lower than 500.
96+
97+
Easy way to overcome elevated permissions is to make use of:
98+
99+
```sh
100+
sudo setcap 'cap_net_bind_service=+ep' `which node`
101+
```
102+
103+
For easier development, it is recommended that you add this certificate to your trusted root authorities and as a trused cert in your browser. Google your browser and OS for more info on how to trust cert authorities.
104+
105+
Otherwise, you will need to override the exception each time you load the site. Firefox users may need to user an incognito browser in order to override the exception.
106+
107+
## yarn Commands
108+
109+
| Command | Description |
110+
| ------------------- | -------------------------------------------------------------------------------------- |
111+
| yarn start | Serve dev mode build with the default config |
112+
| yarn build | Build dev mode build with the default config and outputs static files in /build |
113+
| yarn build:prod | Build prod mode build with the prod config and outputs static files in /build |
114+
| yarn demo | Serves the built files (by running yarn:build) for local testing |
115+
| yarn lint | Run eslint against js/x and ts/x files and outputs report |
116+
| yarn lint:fix | Run eslint against js/x and ts/x files, fixes auto-fixable issues, and outputs report |
117+
| yarn sb | Start the storybook dev server |
118+
| yarn sb:build | Build the assets for storybook |
119+
120+
## App specific setup
121+
122+
Each Application can have its own setup requirements. Please see each apps's README for further information.
123+
124+
### Applications hosted under Platform UI
125+
126+
#### Platform App
127+
This is the "router" app under the whole sum of all Platform UI applications. It will just load all applications and serve one based on the specific route
128+
It also renders the [Universal Navigation](https://github.com/topcoder-platform/universal-navigation)'s header & footer.
129+
130+
Located `src/apps/platform`.
131+
132+
#### Account Settings
133+
App that manages user's own settings.
134+
135+
Located `src/apps/accounts`.
136+
137+
#### Dev Center
138+
A community-led project to document how to work with Topcoder internal applications.
139+
140+
Located `src/apps/dev-center`.
141+
142+
#### Gamification Admin
143+
Application that allows administrators to CRUD badges and de/assign them to specific users.
144+
145+
Located `src/apps/gamification-admin`.
146+
147+
#### Learn
148+
Application that serves 3rd-party educational content.
149+
150+
Located `src/apps/learn`.
151+
152+
#### Onboarding App
153+
Application that helps new users with the onboarding on our platform.
154+
155+
Located `src/apps/onboarding`.
156+
157+
#### Profiles App
158+
Application that allows users to manage their own profile data, and allows visitors to view user details and participation statistics for a specific member.
159+
160+
Located `src/apps/profiles`.
161+
162+
#### Talent Search App
163+
This is an internal app for finding members based on skills and other search facets.
164+
165+
Located `src/apps/talent-search`.
166+
167+
#### Skills Manager
168+
Admin app that allows one to manage the standardized skills.
169+
170+
Located `src/apps/skills-manager`.
171+
172+
#### Self Service
173+
Application that allows customers to submit/start challenges self-service.
174+
175+
Located `src/apps/self-service`.
176+
177+
#### Wallet App
178+
This app allows members to manage details regarding their payments.
179+
180+
Located `src/apps/wallet`.
181+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
@import "@libs/ui/styles/includes";
2+
@import '../../../styles/variables';
3+
4+
.contentLayout {
5+
width: 100%;
6+
padding-bottom: 0;
7+
8+
.contentLayout-outer {
9+
width: 100%;
10+
11+
.contentLayout-inner {
12+
width: 100%;
13+
overflow: visible;
14+
15+
padding-top: $sp-4;
16+
17+
h4 {
18+
margin-top: $sp-4;
19+
}
20+
21+
table {
22+
th {
23+
font-weight: bold;
24+
}
25+
td {
26+
border: 1px solid;
27+
padding: $sp-1 $sp-4;
28+
}
29+
}
30+
}
31+
}
32+
}
33+
34+
@include ltelg {
35+
.contentLayout {
36+
.contentLayout-outer {
37+
padding: 0 $sp-4;
38+
}
39+
}
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import * as React from 'react'
2+
3+
import { Breadcrumb, BreadcrumbItemModel, ContentLayout } from '~/libs/ui'
4+
5+
import { rootRoute, toolTitle } from '../../../dev-center.routes'
6+
import { LayoutDocHeader, MarkdownDoc } from '../../../dev-center-lib/MarkdownDoc'
7+
import useMarkdown from '../../../dev-center-lib/hooks/useMarkdown'
8+
9+
import gettingStartedGuide from './GettingStartedGuide.md'
10+
import styles from './GettingStartedGuide.module.scss'
11+
12+
export const GettingStartedGuide: React.FC = () => {
13+
const { doc, toc, title }: ReturnType<typeof useMarkdown> = useMarkdown({ uri: gettingStartedGuide })
14+
const breadcrumb: Array<BreadcrumbItemModel> = React.useMemo(() => [
15+
{ name: toolTitle, url: rootRoute || '/' },
16+
{ name: title, url: '#' },
17+
], [title])
18+
19+
return (
20+
<ContentLayout
21+
contentClass={styles.contentLayout}
22+
outerClass={styles['contentLayout-outer']}
23+
innerClass={styles['contentLayout-inner']}
24+
>
25+
26+
<Breadcrumb items={breadcrumb} />
27+
<LayoutDocHeader title={title} subtitle='Getting started Guide' />
28+
<MarkdownDoc doc={doc} toc={toc} />
29+
</ContentLayout>
30+
)
31+
}
32+
33+
export default GettingStartedGuide

src/apps/dev-center/src/dev-center.routes.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import { lazyLoad, LazyLoadedComponent, PlatformRoute } from '~/libs/core'
44
const Storybook: LazyLoadedComponent
55
= lazyLoad(() => import('./dev-center-pages/platform-ui-app/storybook/Storybook'))
66

7+
const PlatformUIGettingStarted: LazyLoadedComponent
8+
= lazyLoad(() => import('./dev-center-pages/platform-ui-app/getting-started/GettingStartedGuide'))
9+
710
const GettingStartedGuide: LazyLoadedComponent
811
= lazyLoad(() => import('./dev-center-pages/community-app/getting-started/GettingStartedGuide'))
912

@@ -24,6 +27,10 @@ export const devCenterRoutes: ReadonlyArray<PlatformRoute> = [
2427
element: <Storybook />,
2528
route: '/storybook',
2629
},
30+
{
31+
element: <PlatformUIGettingStarted />,
32+
route: '/platform-ui',
33+
},
2734
{
2835
element: <GettingStartedGuide />,
2936
route: '/getting-started',

src/apps/platform/src/platform.routes.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { profilesRoutes } from '~/apps/profiles'
88
import { talentSearchRoutes } from '~/apps/talent-search'
99
import { accountsRoutes } from '~/apps/accounts'
1010
import { onboardingRoutes } from '~/apps/onboarding'
11-
import { adminRoutes } from '~/apps/admin'
11+
import { skillsManagerRoutes } from '~/apps/skills-manager'
1212
import { walletRoutes } from '~/apps/wallet'
1313
import { walletAdminRoutes } from '~/apps/wallet-admin'
1414

@@ -39,6 +39,6 @@ export const platformRoutes: Array<PlatformRoute> = [
3939
...walletRoutes,
4040
...walletAdminRoutes,
4141
...accountsRoutes,
42-
...adminRoutes,
42+
...skillsManagerRoutes,
4343
...homeRoutes,
4444
]
File renamed without changes.
File renamed without changes.

src/apps/admin/src/AdminApp.tsx renamed to src/apps/skills-manager/src/SkillsManagerApp.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import { Outlet, Routes } from 'react-router-dom'
44
import { routerContext, RouterContextData } from '~/libs/core'
55
import { SharedSwrConfig } from '~/libs/shared'
66

7-
import { toolTitle } from './admin.routes'
7+
import { toolTitle } from './skills-manager.routes'
88

9-
const AdminApp: FC<{}> = () => {
9+
const SkillsManagerApp: FC<{}> = () => {
1010
const { getChildRoutes }: RouterContextData = useContext(routerContext)
1111

1212
return (
@@ -19,4 +19,4 @@ const AdminApp: FC<{}> = () => {
1919
)
2020
}
2121

22-
export default AdminApp
22+
export default SkillsManagerApp

src/apps/skills-manager/src/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export {
2+
skillsManagerRoutes,
3+
rootRoute as skillsManagerRootRoute,
4+
} from './skills-manager.routes'

0 commit comments

Comments
 (0)