Skip to content

Commit 35baf14

Browse files
committed
fix miscellaneous files
1 parent 0652aa4 commit 35baf14

File tree

5 files changed

+30
-57
lines changed

5 files changed

+30
-57
lines changed

README.md

100755100644
Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ This is the frontend application for creating and managing challenges.
1313
- UI for creating challenges
1414

1515
## Related repos
16-
- [Challenge API](https://github.com/topcoder-platform/challenge-api)
17-
- [ES Processor](https://github.com/topcoder-platform/challenge-processor-es) - Updates data in ElasticSearch
18-
- [Legacy Processor](https://github.com/topcoder-platform/legacy-challenge-processor) - Moves data from DynamoDB back to Informix
19-
- [Legacy Migration Script](https://github.com/topcoder-platform/legacy-challenge-migration-script) - Moves data from Informix to DynamoDB
20-
- [Accounts App](https://github.com/appirio-tech/accounts-app)
16+
- [Challenge API](https://github.com/topcoder-platform/challenge-api) - The API endpoint for challenges
17+
- [Resources API](https://github.com/topcoder-platform/resources-api) - The API endpoint for resources
18+
- [Challenge ES Processor](https://github.com/topcoder-platform/challenge-processor-es) - Updates challenge data in ElasticSearch
19+
- [Resource ES Processor](https://github.com/topcoder-platform/resource-processor-es) - Updates resource data in Elasticsearch
2120

2221
## Prerequisites
2322
- [NodeJS](https://nodejs.org/en/) (v10.15+)
@@ -26,46 +25,36 @@ This is the frontend application for creating and managing challenges.
2625

2726
## Configuration
2827

29-
You can see the configuration paramaters below.
3028
Production configuration is in `config/constants/production.js`
3129
Development configuration is in `config/constants/development.js`
3230

33-
- `ACCOUNTS_APP_CONNECTOR_URL`: The url of Accounts app connector
34-
- `ACCOUNTS_APP_LOGIN_URL`: The url of Accounts app login page
35-
- `COMMUNITY_APP_URL`: The base url of community app
36-
- `MEMBER_API_URL`: The members api endpoint
37-
- `MEMBER_API_V3_URL`: v3 members api endpoint
38-
- `DEV_APP_URL`: (Development) The URL to start the app from (eg http://local.topcoder-dev.com)
39-
- `CHALLENGE_API_URL`: The challenge API URL
40-
- `PROJECT_API_URL`: The project API URL
41-
- `API_V3_URL`: The API v3 URL
31+
## Local Deployment Instructions
4232

43-
## Local Deployment
33+
1. First install dependancies
4434

45-
### Foreman Setup
35+
```bash
36+
npm install
37+
```
4638

47-
To install foreman follow this [link](https://theforeman.org/manuals/1.24/#3.InstallingForeman)
39+
1. copy the environment file in docs/dev.env to /.env
4840

49-
To know how to use foreman follow this [link](https://theforeman.org/manuals/1.24/#2.Quickstart)
41+
1. add `127.0.0.1 local.topcoder-dev.com` to your /etc/hosts file
5042

51-
### Development
43+
1. If you are using local instances of the API's, change the DEV_API_HOSTNAME in configs/constants/development.js to match your local api endpoint.
44+
- For example change it to 'http://localhost:3000/',
5245

53-
To run the app in development mode run
46+
1. Run the app in development mode
5447

5548
```bash
5649
npm run dev
5750
```
5851

59-
You can access the app from [http://localhost:3000](http://localhost:3000)
52+
You can access the app from [http://local.topcoder-dev.com:3001/](http://local.topcoder-dev.com:3001/)
6053

6154
The page will reload if you make edits.
6255

6356
You will also see any lint errors in the console.
6457

65-
`NOTE`: Redirection from login page doesn't work with localhost urls because account app doesn't allow it, in order to test it you can add `127.0.0.1 local.topcoder-dev.com` to your /etc/hosts file and access the app from
66-
67-
[http://local.topcoder-dev.com:3000](http://local.topcoder-dev.com:3000) address
68-
6958
### Lint check
7059

7160
To test the app for lint errors

config/constants/development.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const DEV_API_HOSTNAME = 'https://api.topcoder-dev.com' // 'http://localhost:3000
1+
const DEV_API_HOSTNAME = 'https://api.topcoder-dev.com'
22

33
module.exports = {
44
ACCOUNTS_APP_CONNECTOR_URL: 'https://accounts.topcoder-dev.com/connector.html',

config/constants/production.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1+
import DEV_API_HOSTNAME from './development'
2+
const PROD_API_HOSTNAME = 'https://api.topcoder.com'
3+
14
module.exports = {
25
ACCOUNTS_APP_CONNECTOR_URL: process.env.ACCOUNTS_APP_CONNECTOR_URL || 'https://accounts.topcoder.com/connector.html',
36
ACCOUNTS_APP_LOGIN_URL: 'https://accounts.topcoder.com/member',
47
COMMUNITY_APP_URL: 'https://www.topcoder.com',
5-
MEMBER_API_URL: 'https://api.topcoder.com/v4/members',
6-
MEMBER_API_V3_URL: 'https://api.topcoder.com/v3/members',
8+
MEMBER_API_URL: `${PROD_API_HOSTNAME}/v4/members`,
9+
MEMBER_API_V3_URL: `${PROD_API_HOSTNAME}/v3/members`,
710
DEV_APP_URL: 'https://submission-review.topcoder.com',
8-
CHALLENGE_API_URL: 'https://api.topcoder.com/v5',
9-
PROJECT_API_URL: 'https://api.topcoder.com/v4',
10-
API_V4_URL: 'https://api.topcoder-dev.com/v4',
11-
API_V3_URL: 'https://api.topcoder-dev.com/v3'
11+
CHALLENGE_API_URL: `${PROD_API_HOSTNAME}/v5/challenges`,
12+
CHALLENGE_TIMELINE_TEMPLATES_URL: `${PROD_API_HOSTNAME}/v5/timelinetemplates`,
13+
CHALLENGE_TYPES_URL: `${PROD_API_HOSTNAME}/v5/challengetypes`,
14+
CHALLENGE_PHASES_URL: `${PROD_API_HOSTNAME}/v5/challengephases`,
15+
PROJECT_API_URL: `${PROD_API_HOSTNAME}/v5/projects`,
16+
GROUPS_API_URL: `${PROD_API_HOSTNAME}/v5/groups`,
17+
PLATFORMS_V4_API_URL: `${DEV_API_HOSTNAME}/v4/platforms`,
18+
TECHNOLOGIES_V4_API_URL: `${DEV_API_HOSTNAME}/v4/technologies`
1219
}

docs/dev.env

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1 @@
1-
{
2-
ACCOUNTS_APP_CONNECTOR_URL: '',
3-
ACCOUNTS_APP_LOGIN_URL: '',
4-
COMMUNITY_APP_URL: '',
5-
MEMBER_API_URL: '',
6-
MEMBER_API_V3_URL: '',
7-
DEV_APP_URL: '',
8-
CHALLENGE_API_URL: '',
9-
PROJECT_API_URL: '',
10-
API_V4_URL: '',
11-
API_V3_URL: ''
12-
}
1+
PORT=3001

docs/prod.env

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)