add instructions for testing with local auth

This commit is contained in:
mvpratt 2023-03-24 10:32:42 -06:00 committed by keyan
parent 70551706d7
commit 1a763a9ac3
2 changed files with 37 additions and 1 deletions

View File

@ -9,7 +9,7 @@ We're discussing if it's possible to provide SN on nostr and/or a hybrid approac
2. `git clone git@github.com:stackernews/stacker.news.git sn && cd sn`
3. `docker-compose up --build`
You should then be able to access the site at `localhost:3000` and any changes you make will hot reload. If you want to login locally or use lnd you'll need to modify `.env.sample` appropriately. If you have trouble please open an issue so I can help and update the README for everyone else.
You should then be able to access the site at `localhost:3000` and any changes you make will hot reload. If you want to login locally or use lnd you'll need to modify `.env.sample` appropriately. More details [here](https://github.com/stackernews/stacker.news/tree/master/docs/local-auth.md). If you have trouble please open an issue so I can help and update the README for everyone else.
# stack
The site is written in javascript using Next.js, a React framework. The backend API is provided via graphql. The database is postgresql modelled with prisma. The job queue is also maintained in postgresql. We use lnd for our lightning node. A customized Bootstrap theme is used for styling.

36
docs/local-auth.md Normal file
View File

@ -0,0 +1,36 @@
# Local Auth
You must be logged in to test features like posting, replying, tipping, etc.
### Login with Email
- First, follow the local development instructions in the README.md
- Create a Sendgrid account (or other smtp service)
- Update your .env file
```
LOGIN_EMAIL_SERVER=smtp://apikey:<sendgrid_api_key>@smtp.sendgrid.net:587
LOGIN_EMAIL_FROM=<sendgrid_email_from>
```
- Open http://localhost:3000
- Click "sign up" and enter your email address
- Check your email
- Click the link (looks like this):
```
http://localhost:3000/api/auth/callback/email?email=satoshi%40gmail.com&token=110e30a954ce7ca643379d90eb511640733de405f34a31b38eeda8e254d48cd7
```
### Login with Github
- [Create a new OAuth app](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app) in your Github account
- Set the callback URL to: `http://localhost:3000/api/auth/callback/github`
- Update your .env file
```
GITHUB_ID=<Client ID>
GITHUB_SECRET=<Client secret>
```
- Signup and login as above