|
1 | | -# How to setup and run Nimbus dev environment with local Thunderstore |
2 | | - |
3 | | -## Preparations |
4 | | -This quide expects you to have setup your Thunderstore Django project for development on some level. Please setup the Thunderstore project before continuing. |
5 | | - |
6 | | -## Setup nginx proxy for local data ingress/egress |
7 | | -1. Add the following to your hosts (on windows, google what how to achive same on other OS') |
8 | | -``` |
9 | | -127.0.0.1 thunderstore.temp |
10 | | -127.0.0.1 new.thunderstore.temp |
11 | | -``` |
12 | | - |
13 | | -2. Boot up the nginx proxy with the following command; `docker compose -f tools/ts-dev-proxy/docker-compose.yml up` |
14 | | - |
15 | | -3. Boot up your Thunderstore backend and ensure it's running in port 81 (it's normally 80). The following [line](https://github.com/thunderstore-io/Thunderstore/blob/f06b9b438ea6e990881e60339d34bde1a480d073/docker-compose.yml#L123) in your Thunderstore projects docker-compose, should be `- "127.0.0.1:81:8000"` |
16 | | - |
17 | | -## Setup Nimbus for development |
18 | | - |
19 | | -1. Clone the repo `git@github.com:thunderstore-io/thunderstore-ui.git` |
20 | | - |
21 | | -2. Setup FontAwesome token. One way to do it is to add a `.npmrc` file with the following contents, under `thunderstore-ui/build-secrets/.npmrc` |
22 | | -``` |
23 | | -@fortawesome:registry = "https://npm.fontawesome.com/" |
24 | | -//npm.fontawesome.com/:_authToken = YOUR_FA_TOKEN |
25 | | -``` |
26 | | - |
27 | | -3. Run `yarn install` first on the repo root (`thunderstore-ui` folder) and then again in the `thunderstore-ui/apps/cyberstorm-remix` folder. |
28 | | - |
29 | | -4. Add `.env.development` and/or `.env.production` files. You can copy the `.env` file, rename and edit the values to your needs. Here's a example of the file contents: |
30 | | -``` |
31 | | -VITE_SITE_URL=http://thunderstore.temp |
32 | | -VITE_BETA_SITE_URL=http://new.thunderstore.temp |
33 | | -VITE_API_URL=http://thunderstore.temp |
34 | | -VITE_COOKIE_DOMAIN=.thunderstore.temp |
35 | | -VITE_AUTH_BASE_URL=http://thunderstore.temp |
36 | | -VITE_AUTH_RETURN_URL=http://new.thunderstore.temp |
37 | | -__VITE_ADDITIONAL_SERVER_ALLOWED_HOSTS=.thunderstore.temp |
38 | | -``` |
39 | | - |
40 | | -5. Run the build/start server script or the dev server script |
41 | | - |
42 | | -Build and start |
43 | | -``` |
44 | | -yarn workspace @thunderstore/cyberstorm-remix build |
45 | | -yarn workspace @thunderstore/cyberstorm-remix start --port 3000 --host 0.0.0.0 |
46 | | -``` |
47 | | - |
48 | | -Dev script |
49 | | -``` |
50 | | -yarn workspace @thunderstore/cyberstorm-remix dev --port 3000 --host 0.0.0.0 |
51 | | -``` |
52 | | - |
53 | | -## Finally |
54 | | -You should now have the fully local Nimbus dev environment setup and running in `http://new.thunderstore.temp` and the Django site should be running in `http://thunderstore.temp`. You might need to go to `http://new.thunderstore.temp/communities` as Nimbus doesn't have a landing page yet. |
55 | | - |
56 | | -# How to setup ts-proxy as a backend for this project |
57 | | -**Keep in mind that when using the ts-proxy, the sessions and actions will be made against the actual production Thunderstore** |
58 | | - |
59 | | -1. Open hosts file as administrator (`C:\Windows\System32\drivers\etc`) and add this `127.0.0.1 thunderstore.temp` there |
60 | | -2. Download and install Docker and docker-compose. For windows people, Docker for Windows should be enough. |
61 | | -3. Open up a terminal and navigate to `thunderstore-ui/tools/ts-proxy` |
62 | | -4. Run `docker compose up` |
63 | | -5. Add these to your `.env.development` or `.env.production` |
64 | | -``` |
65 | | -PUBLIC_SITE_URL=http://thunderstore.temp |
66 | | -PUBLIC_API_URL=http://thunderstore.temp:81 |
67 | | -``` |
68 | | -6. Run the Nimbus project normally |
| 1 | +# Cyberstorm Remix (Nimbus) |
| 2 | + |
| 3 | +This is the Remix application that powers the new Thunderstore frontend (codenamed Nimbus). |
| 4 | + |
| 5 | +## Quick Start (Docker) |
| 6 | + |
| 7 | +The easiest way to run the full stack (Backend + Frontend) is using Docker. |
| 8 | + |
| 9 | +1. **Clone Repositories** |
| 10 | + Ensure you have both `Thunderstore` (Backend) and `thunderstore-ui` (Frontend) cloned side-by-side. |
| 11 | + ```bash |
| 12 | + # Example structure |
| 13 | + # C:\projects\Thunderstore |
| 14 | + # C:\projects\thunderstore-ui |
| 15 | + ``` |
| 16 | + |
| 17 | +2. **Start Backend** |
| 18 | + ```bash |
| 19 | + cd ../Thunderstore |
| 20 | + docker compose up -d |
| 21 | + docker compose exec django python manage.py setup_dev_env |
| 22 | + ``` |
| 23 | + (If you have some pre-existing containers, please do `docker compose down -v`, `docker compose up -d --build` and `docker compose exec django python manage.py setup_dev_env`) |
| 24 | + |
| 25 | +3. **Start Frontend** |
| 26 | + ```bash |
| 27 | + cd ../thunderstore-ui |
| 28 | + docker compose -f docker-compose.remix.development.yml up -d |
| 29 | + ``` |
| 30 | + (If you have some pre-existing containers, please do `docker compose -f docker-compose.remix.development.yml down -v` and `docker compose -f docker-compose.remix.development.yml up -d --build`) |
| 31 | + |
| 32 | +4. **Open Browser** |
| 33 | + - **Frontend**: [http://new.localhost](http://new.localhost) |
| 34 | + - **Backend**: [http://localhost](http://localhost) |
| 35 | + |
| 36 | +## Manual Setup |
| 37 | + |
| 38 | +If you prefer running Node locally instead of in Docker: |
| 39 | + |
| 40 | +1. **Install Dependencies**: `yarn install` (in repo root) |
| 41 | +2. **Configure Env**: Copy `.env.example` to `.env` in `apps/cyberstorm-remix`. |
| 42 | +3. **Run Dev Server**: |
| 43 | + ```bash |
| 44 | + yarn workspace @thunderstore/cyberstorm-remix dev --port 3000 --host 0.0.0.0 |
| 45 | + ``` |
0 commit comments