https://github.com/symmetric-project/node-backend
The backend for a Symmetric node. Reddit-like decentralized discussion platform.
https://github.com/symmetric-project/node-backend
backend decentralized discussion-platform go graphql open-source postgres squirrel
Last synced: 3 months ago
JSON representation
The backend for a Symmetric node. Reddit-like decentralized discussion platform.
- Host: GitHub
- URL: https://github.com/symmetric-project/node-backend
- Owner: symmetric-project
- License: mit
- Created: 2021-09-06T19:25:36.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-10-18T20:09:47.000Z (over 4 years ago)
- Last Synced: 2024-06-20T19:17:11.551Z (almost 2 years ago)
- Topics: backend, decentralized, discussion-platform, go, graphql, open-source, postgres, squirrel
- Language: Go
- Homepage:
- Size: 229 KB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.org
- License: LICENSE
Awesome Lists containing this project
README





# node-backend
The backend for a Symmetric node.
## Contributing
We have a contributing guide over [here](CONTRIBUTING.org).
## Community
You can contact us by joining our discord [here](https://discord.com/invite/AkSbP5JF).
## To run the backend server you need to:
### Create a PostgreSQL database with name of ```symmetric``` as well as set a password for the ```postgres``` user
### Create an ```.env``` file which holds sensitive data like passwords, instructions for Linux (Ubuntu, macOS and more).
Create file by running this command:
```
touch .env
```
Edit the file with any text editor and paste this:
```
MODE=dev
DATABASE_URL=postgres://postgres:REPLACE_THIS_WITH_THE_PASSWORD_OF_THE_LOCAL_SYMMETRIC_DATABASE@localhost:5432/symmetric
JWT_SECRET=REPLACE_THIS_WITH_A_RANDOMLY_GENEREATED_SHA256_STRING
COOKIE_DOMAIN_DEV=symmetric.localhost
COOKIE_DOMAIN_PROD=symmetric.REPLACE_THIS_WITH_THE_NODE_NAME.com
```
A way to generate a ```JWT_SECRET``` is to run the following command:
```
openssl rand -base64 64
```
After running it, you should see get a random string which you can use as a ```JWT_SECRET```
### Generate gqlgen
Run `gqlgen generate` in the root folder. This will generate Go types from the `schema.graphqls` file.