Skip to content

Commit

Permalink
Merge 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
MacB committed Jul 10, 2024
2 parents fd891f8 + 8452675 commit 59c712d
Show file tree
Hide file tree
Showing 127 changed files with 10,172 additions and 6,378 deletions.
8 changes: 7 additions & 1 deletion .env-copy
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ IS_BOOTSTRAP_NODE=false
USE_EPHEMERAL_ID=false
IPV4=127.0.0.1
HTTP_MESSAGES_MAX_PAGE_SIZE=500
DATA_DIR=data
DATA_DIR=anon
CACHE_DIR=cache
AUTO_SYNC=true
ROOT_ADVERTISEMENT_TIMEOUT=60000
Expand All @@ -19,3 +19,9 @@ HTTP_PORT=0
API_PORT=0
TOTAL_STORIES=20
TOTAL_USERS=20
ENSDATA_KEY=ensdata
CF_IMAGES_SECRET=secret
VAPID_PRIVATE_KEY=private-key
VAPID_PUBLIC_KEY=public-key
TG_CHANNEL_ID=abc
TG_CHANNEL_TOKEN=abc
21 changes: 0 additions & 21 deletions .github/workflows/prettier.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ node_modules
src/public/previews
cache
dbtest
src/fingerprint.mjs
src/web/node_modules
src/public/assets/*
src/public/manifest.json
Expand Down
29 changes: 29 additions & 0 deletions contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Contributors' guide!
Hey, thanks for considering to help us out with the project. Before starting to code you need to get a few things set up.

1. Create two directories in the root of of the repository with `mkdir anon cache`
2. Create a .env file from our template `.env-copy` with `cp .env-copy .env`
3. Set your `OPTIMISM_RPC_HTTP_HOST` in the `.env` files
4. Install the dependencies for the API with `npm i` and for the UI `cd src/web && npm i`
5. Sync with the network using `npm run sync` and when you see it is looping over the same block/address it means we are probably done getting up to date with the network's state.
6. Start the server using `npm run dev:anon`

```bash
# This is a script to automate the 'Getting started' guide, help us improve it!
mkdir anon cache
cp .env-copy .env
replacement="OPTIMISM_RPC_HTTP_HOST=YOUR_PRIVATE_URL_HERE"
sed -i "1s/.*/$replacement/" .env # sed magic to replace the first line of the .env file with the OPTIMISM stuff
npm i
cd src/web && npm i && cd ..
npm run sync
npm run dev:anon
```
## Project layout
We use ES module (`.mjs` extension) for their simplicity and convenience. The most important files (according to me lol) are:
- `api.mjs` - define the functions used to return the standard JSON messages for the API!*
- `http.mjs` - define the REST routes for the API, you can see how the functions for the feeds, stories, and comments are used.

Those files are kind of the center of the project which allows you to understand why all the others exist.

Thanks for the help!
3 changes: 0 additions & 3 deletions ecosystem.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ module.exports = {
name: "kiwinews",
script: "npm run start",
env: {
THEME_COLOR: "limegreen",
THEME_EMOJI: "🥝",
THEME_NAME: "Kiwi News",
DEBUG: "*attestate*",
NODE_ENV: "production",
THEME: "kiwi",
Expand Down
5 changes: 5 additions & 0 deletions funding.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"opRetro": {
"projectId": "0x5b054742b09f8ce4092a15700ef9781520a6ff2928ba5ee09c78ad4dd8817b85"
}
}
Loading

0 comments on commit 59c712d

Please sign in to comment.