-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from berkmancenter/dev
Merge release 3.1.0 to main
- Loading branch information
Showing
66 changed files
with
30,584 additions
and
3,152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,9 +11,7 @@ JWT_SECRET=thisisasamplesecret | |
JWT_ACCESS_EXPIRATION_MINUTES=30 | ||
# Number of days after which a refresh token expires | ||
JWT_REFRESH_EXPIRATION_DAYS=30 | ||
|
||
# Secret used to encrypt generated passwords | ||
AUTH_TOKEN_SECRET=6dba17141c3ce22d67f9ebdb937644e617f999b8 | ||
JWT_RESET_PASSWORD_EXPIRATION_MINUTES=120 | ||
|
||
# SMTP configuration options for the email service | ||
# For testing, you can use a fake SMTP service like Ethereal: https://ethereal.email/create | ||
|
@@ -22,3 +20,6 @@ SMTP_PORT=587 | |
SMTP_USERNAME=email-server-username | ||
SMTP_PASSWORD=email-server-password | ||
EMAIL_FROM=[email protected] | ||
|
||
# This is used to build links for the reset password and channel archive emails | ||
APP_HOST=http://localhost:3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,57 @@ | ||
# Threads server | ||
# Threads API | ||
|
||
## Description | ||
|
||
This is the backend API for [berkmancenter/threads_client](https://github.com/berkmancenter/threads_client). | ||
|
||
## Installation | ||
|
||
### Using Docker | ||
|
||
- Create file `.env.local` and copy contents of `.env.example`. Feel free to change the port number in the file but make sure to make changes on fronend env file to reflect the correct port number. Also, if you change the port number, make sure to change the port numbers in `docker-compose.yml` as well. The port number for socket io is defined implicitly in the app as `5555` and can be changed by making change to file `/src/websockets/index.js` | ||
- Edit `docker-compose.dev.yml` file to add the following block to the `node-app` service | ||
|
||
``` | ||
env_file: | ||
- .env.local | ||
``` | ||
|
||
the full block should then look like this: | ||
|
||
``` | ||
services: | ||
node-app: | ||
env_file: | ||
- .env.local | ||
``` | ||
|
||
- Run below docker compose command to start the server | ||
|
||
``` | ||
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --build | ||
``` | ||
|
||
## Running locally | ||
|
||
1. Start by copying `.env.example` to `.env`. | ||
2. Install `mongodb` | ||
3. Run MongoDB with `mongod` | ||
4. Install all dependencies with `npm install`. | ||
5. Run `npm run dev` to serve the API locally. | ||
|
||
## Tests | ||
|
||
### Unit and integration tests | ||
|
||
Unit and integration tests can be run with `npm run test`, and a coverage report can be seen with `npm run coverage`. | ||
|
||
### Stress tests | ||
|
||
Stress tests can be run from the client repo in the [k6 directory](https://github.com/berkmancenter/threads_client/blob/main/k6). | ||
|
||
## Deployment | ||
|
||
1. Pull the latest code from Github (currently the dev branch) | ||
2. Configure .env and install dependencies | ||
3. Run `npm run start` to serve the API with [PM2](https://pm2.keymetrics.io/docs/usage/process-management/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ services: | |
- node-network | ||
|
||
mongodb: | ||
platform: linux/x86_64 | ||
image: mongo:3.2.19 | ||
ports: | ||
- '27017:27017' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.