-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update README with how to setup local enviroment for development #149
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,48 @@ | ||
# Info Support Tech Survey | ||
|
||
## Introduction | ||
## Setup for local development | ||
|
||
### Setup database | ||
|
||
1. Make sure docker desktop or another tool of your liking is installed on your machine. | ||
2. Spin up a postgres database with the following command. You need to choose your own password and username: | ||
```bash | ||
docker run --name tech-survey -e "POSTGRES_USER=dummyusr" -e "POSTGRES_PASSWORD=dummypw" -e "POSTGRES_DB=tech-survey" -d -p 5432:5432 docker.io/postgres | ||
``` | ||
3. Make sure to also use that username and password inside of the `.env` file: | ||
`DATABASE_URL="postgresql://jarne:dummyusr@dummypw/tech-survey` | ||
4. Run the following commands to setup your db locally. For the `npm run db:seed` command you need a CSV file to populate the database. You can ask your co-worker for this CSV file, or skip this if you don't want any data. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Het is hiernaast ook belangrjik dat de CSV in de There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adjusted! |
||
```bash | ||
npm run db:generate | ||
npm run db:push | ||
npm run db:seed | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Het is belangrijk dat iemand niet meerdere keren There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adjusted! |
||
``` | ||
5. Now you should be ready to go! 🎉 You can check your local database by opening the studio of Primsa: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Eventueel zou je nu kunnen noemen dat je de vragen en groepen zou moeten kunnen zien. Dit is meteen een check of het seeden goed is gegaan. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adjusted! |
||
```bash | ||
npm run db:studio | ||
``` | ||
|
||
### Setup Azure AD authentication | ||
|
||
The Azure AD credentials can be found in the `.env` file: | ||
``` | ||
AZURE_AD_CLIENT_ID="dummy" | ||
AZURE_AD_CLIENT_SECRET="dummy" | ||
AZURE_AD_TENANT_ID="dummy" | ||
``` | ||
|
||
You can go one of two ways to get your hands on these credentials: | ||
- Get them yourself from the Azure AD on the Azure Environment of your company | ||
- Ask a co-worker who has already worked on the project to sent those credentials to you in a secure manner | ||
|
||
### Setup NextAuth | ||
|
||
1. For using next auth, we need to setup a secret. This can be done in the .env file: | ||
``` | ||
NEXTAUTH_SECRET="dummy" | ||
``` | ||
2. Generate a new secret wit the following command: | ||
```bash | ||
openssl rand -base64 32 | ||
``` | ||
3. Update the `NEXTAUTH_SECRET` variable with the new value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, it's a good idea not to include your name in the (demo) source code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, that was not the intention, adjusted!