https://github.com/elliotbraem/everything
Infrastructure for a user owned internet: apps and packages for creating and defining things
https://github.com/elliotbraem/everything
everything near
Last synced: 4 months ago
JSON representation
Infrastructure for a user owned internet: apps and packages for creating and defining things
- Host: GitHub
- URL: https://github.com/elliotbraem/everything
- Owner: elliotBraem
- License: unlicense
- Created: 2024-10-21T16:45:38.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-06T20:05:38.000Z (over 1 year ago)
- Last Synced: 2025-03-30T03:35:00.401Z (about 1 year ago)
- Topics: everything, near
- Language: TypeScript
- Homepage: https://allthethings.testnet.page
- Size: 2.46 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
everything
apps and packages for creating and defining things
Table of Contents
- [Getting Started](#getting-started)
- [Installing dependencies](#installing-dependencies)
- [Running the app](#running-the-app)
- [Building for production](#building-for-production)
- [Running tests](#running-tests)
- [Learn more about NEAR](#learn-more-about-near)
- [Contributing](#contributing)
## Getting Started
### Installing dependencies
```bash
pnpm install
```
### Running the app
First, make sure a web4 proxy server is running (see [setup](#running-web4-locally)):
```bash
pnpm run web4:start:testnet
```
Then start the dev server. This will run the app and the express proxy server.
```bash
pnpm run dev
```
### Building for production
```bash
pnpm run build
```
### Running tests
```bash
pnpm run test
```
See the full [testing guide](./playwright-tests/README.md).
## Project Structure
This project is a structured as a monorepo with [Turborepo](https://github.com/vercel/turborepo).
```cmd
.
├── apps
│ ├── api
│ └── www
├── packages
│ ├── config-eslint
│ ├── config-typescript
```
It consists of several components:
- [Vite](https://vitejs.dev/) project using [near-vite-starter template](https://github.com/NEARBuilders/near-vite-start), bundle stored on [NEARFS](https://github.com/vgrichina/nearfs), served through [Web4](https://web4.near.page/)
- Web4 NEAR login to authorize a local-first session with [Jazz](https://jazz.tools/) for data storage and sync
- Types stored on-chain in the [social-db](https://github.com/NearSocial/social-db)
- Express proxy server for Open AI requests to gpt-4o-mini for NLP and structured outputs
- Automatic form generation based on JSON Schemas, using [react-jsonschema-form](https://rjsf-team.github.io/react-jsonschema-form/docs/)
## Learn more about NEAR
To learn more about NEAR, take a look at the following resources:
- [NEAR Developer Portal](https://dev.near.org/) - homebase for near developers.
- [NEAR Documentation](https://docs.near.org) - learn about NEAR.
- [Frontend Docs](https://docs.near.org/build/web3-apps/quickstart) - learn about this example.
You can check out [the NEAR repository](https://github.com/near) - your feedback and contributions are welcome!
## Running web4 locally
1. Install [mkcert](https://mkcert.dev/).
2. Install local certificate authority (this allows browser to trust self-signed certificates):
```bash
mkcert -install
```
3. Create `*.near.page` SSL certificate and store these at the project root:
```bash
mkcert "*.near.page"
```
4. Run `web4` man-in-the-middle proxy locally:
```bash
IPFS_GATEWAY_URL=https://ipfs.near.social NODE_ENV=mainnet WEB4_KEY_FILE=./_wildcard.near.page-key.pem WEB4_CERT_FILE=./_wildcard.near.page.pem npx web4-near
```
5. May have to configure hosts on MacOS:
```bash
sudo sh -c 'echo "127.0.0.1 every.near.page" >> /etc/hosts'
```
6. Run the web4 proxy server for designated network
```bash
pnpm run web4:start:testnet
```
## Deploy to web4
To deploy the main app, go to `/apps/www`, then follow the below:
1. Build the project
```cmd
pnpm run build
```
2. Create a web4 subaccount of your master account (this will be your domain).
```cmd
near account create-account fund-myself web4.MASTER_ACCOUNT.testnet '1 NEAR' autogenerate-new-keypair save-to-keychain sign-as MASTER_ACCOUNT.testnet network-config testnet sign-with-keychain send`
```
Be sure to "Store the access key in legacy keychain"!
3. Run web4-deploy to upload production bundle to nearfs and deploy it to a minimum-web4 contract to your account.
```cmd
npx github:vgrichina/web4-deploy dist web4.MASTER_ACCOUNT.testnet --deploy-contract --nearfs
```
Deploy shoudl be accessible and your website accessible at
`testnet`: MASTER_ACCOUNT.testnet.page
`mainnet`: MASTER_ACCOUNT.near.page
## Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
If you're interested in contributing to this project, please read the [contribution guide](./CONTRIBUTING).