unitaryfund / unitary.fund

πŸ•ΈοΈ πŸ’› Unitary Fund Website πŸ’› πŸ•ΈοΈ
https://unitary.fund
50 stars 56 forks source link

Add docs on running website locally #358

Closed natestemen closed 1 year ago

natestemen commented 1 year ago

I might be missing these somewhere, but I have not found any developer docs on spinning up the site locally (what commands do I need to run locally to install all the things, get it running, rebuild, etc). As a little bit of context, I am familiar with npm, but not astro.

cc @joshdavenport, @WrathfulSpatula

natestemen commented 1 year ago

cc @nathanshammah

natestemen commented 1 year ago

Tried further to get this up and running tonight, but I'm stuck. Here's what I did

  1. npm i in root of repo successfully installs dependencies
  2. npm start fails with
    [config] Astro found issue(s) with your configuration:
    ! experimental  Invalid experimental key: `redirects`.
    Make sure the spelling is correct, and that your Astro version supports this experiment.
    See https://docs.astro.build/en/reference/configuration-reference/#experimental-flags for more information..
  3. Fixed this by removing these three lines from the astro config file https://github.com/unitaryfund/unitary.fund/blob/fc9072788273a15f5018aeecb99ee539025f5b57/astro.config.mjs#L32-L34
  4. npm start then appears to work, but when visiting http://127.0.0.1:3000/, the site crashes with the following error regarding the cloudName variable. This, or a same error occur with all of the scripts in package.json.
    error   "You must supply a cloudName when initializing the asset"
    Hint:
    To get as much information as possible from your errors, make sure to throw Error objects instead of `string`. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error for more information.
    File:
    /Users/nate/code/unitary.fund/node_modules/astro/dist/core/errors/utils.js:64:19
    Code:
    63 |   } else {
    > 64 |     const error = new Error(JSON.stringify(err));
         |                   ^
      65 |     error.hint = `To get as much information as possible from your errors, make sure to throw Error objects instead of \`${typeof err}\`. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error for more information.`;
      66 |     return error;
      67 |   }

I also noticed while playing around with stuff here that typescript is not included in the package.json file, so I had to manually install that in order to check types. As stated previously, I'm not experienced in this area, so I may be doing something wrong. But when I ran npx tsc --build I did encounter quite a few errors. Is this expected?

joshdavenport commented 1 year ago

Hi both, thanks for your patience on this one. I've added content to the wiki and will be migrating existing docs and writing some further docs there also, here's the relevant page: https://github.com/unitaryfund/unitary.fund/wiki/Getting-Started

The main things to note re steps you took @natestemen are: