| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
New version of Topcoder Community website.
Often you may note that the file named .exchange-rates.cache, located in the root folder of the app, got updated without you touching it. In such case, please, don't hesitate to keep and commit its updated version. It is a cache of real-world currency exchange rates. Keeping it up-to-date, and preserving between restarts of the app (no matter in which mode) saves a lot of calls to https://openexchangerates.com, thus allowing us to stay within the limits of their free plan.
In case of merge conflicts, just commit the version of cache file that has a more recent timestamp among its data fields.
If you need any operations related to currency conversions, pay attention to the /src/shared/services/money.js service.
Disclaimer: Current instructions are biased towards Ubuntu 16.04. Hovewer, similar recipes should work for other OS. Should you encounter and overcome any tricky issues on other OS, you are welcome to add notes/hints into this file.
You should have the following prerequisites:
Install dependencies with one of the following commands:
Run linters and unit tests with following commands:
Set environment variables:
CMS-backed segments use Payload's Contentful-compatible API. Application- owned routes do not wait for CMS routing data. To use CMS content locally, configure the legacy compatibility identifiers/keys and an explicit Payload host; there is no external provider fallback:
See Payload CMS compatibility environment setup for supported spaces, S3 asset configuration, and article-vote write-through.
To build the App's frontend run one of (the result of build will be output into /build folder in both cases):
To run the App use:
If you run the App locally against development Topcoder backend you should access the App as local.topcoder-dev.com:3000. Prior doing this you should add into your /etc/hosts the line 127.0.0.1 local.topcoder-dev.com. To login into development Topcoder backend use accounts.topcoder-dev.com/members to login. Log out at www.topcoder-dev.com, or just wipe out auth cookies.
If you run the App locally against production Topcoder backend you should run it at the port 80 and access the App as local.topcoder.com. Prior doing this you should add into your /etc/hosts the line 127.0.0.1 local.topcoder.com. The easiest way to allow the App to listen at the port 80 on Ubuntu 16.04 is (no guarantees, how safe is it):
Development dependencies include StyleFMT. You can execute $ npm run lint:scss -- --fix to automatically correct you stylesheets to comply with Stylelint rules (but it can fail for some rules). To automatically correct js files, you can use npm run lint:js -- --fix.
Access to Wipro community demands proper authorization. In development environment (both local and remote) the test user dan_developer / dantopcoder123 is authorized to access this community. So login at https://accounts.topcoder-dev.com/member in the same browser before you do anything.
It is intended that Wipro community is accessed as wipro.topcoder-dev.com in dev (both local and remote) and wipro.topcoder.com in prod. Thus, to deploy it locally you should have in your /etc/hosts the alias 127.0.0.1 wipro.topcoder-dev.com, and run the app with the command NODE_CONFIG_ENV=development PORT=80 npm run dev. Take into account the following:
To run the App at port 80 you may need extra configuration (see in the end of the previous section);
Once you have added this alias to your /etc/hosts, it is extremely easy to forget about it and to be totally confused when failing to access the remotely deployed dev version of the App (because wipro.topcoder-dev.com is used in both places). Thus we recommend to comment out this alias in /etc/hosts whenever you don't need it!!! Technically, it makes total sense just to run the local dev version of the App at, say, local.wipro.topcoder-dev.com:3000, and the code does support it... the problem is that, as of now, Topcoder's accounts-app does not allow to authenticated from such subdomain/port, thus you won't be permitted to access.
As of now, this community can be also rapidly accessed at local.topcoder-dev.com/community/wipro/. It should be fine to use it during development, just keep in mind that you should use relative links to navigate inside the community, as our primary goal is to ensure it is properly funcional at wipro.topcoder-dev.com.
We use https://logentries.com to track the logs. Log Entries API token should be provided via the LOG_ENTRIES_TOKEN environment variable, which will override the default values set in /config/default.json (sample account for local setup testing), and in /config/production.json (empty token) - with empty token Log Entries will not be used.
Change the property in URL.COMMUNITY_API in config.
Change the property in URL.EMAIL_VERIFY_URL in config.
Note: Server-side rendering is supported. It means, if you go to /src/server/App.jsx and remove the line <_script type="application/javascript" src="/bundle.js"></script>, which loads JS bundle in the page, when you start the App and load any page, you'll still see a properly rendered page (without any interactivity). It means that loading of JS bundle and initialization of ReactJS do not block the proper rendering of the page.
Setup of this App is not finished yet. Here is a brief summary of current configuration and problems found on the way.
This App already contains:
Pending low-priority stuff (these are important, but can be added along the way):
Deploy scripts are setup to use AWS ECS + CircleCI. Make sure the following environment variables are setup in CircleCI:
Folowing environment variables should be set to configure M2M communication between Community App server and TC APIs. At the moment of writing, it is expected that these credentials give full access to the TC Groups API. XXX is a placeholder for one of DEV, PROD, PRODBETA - API environment given credentials relate to.
[https://github.com/topcoder-platform/community-app/blob/master/CHANGELOG.md](Check the latest changes)
Please check the https://github.com/topcoder-platform/community-app/blob/master/CONTRIBUTING.md for guidelines on rules to be followed.
| Back | FazBrowse Home | New Git URL |