- Make sure docker desktop or another tool of your liking is installed on your machine.
- Spin up a postgres database with the following command. You need to choose your own password and username:
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
- Make sure to also use that username and password inside of the
.env
file:DATABASE_URL="postgresql://dummyusr:dummypw@localhost/tech-survey
- Run the following commands to setup your db locally. For the
npm run db:seed
command you need a CSV file in the root of your project inside an 'import' folder to populate the database. You can ask your co-worker for this CSV file, or skip this if you don't want any data. Also important to note here is that you don't want to execture thenpm run db:seed
command multiple times, this will initiate the seed again and duplicate all of the data. If you want to run the seed again, you'll need to start with an empty database.
npm run db:generate
npm run db:push
npm run db:seed
- Now you should be ready to go! 🎉 You can check your local database by opening the studio of Primsa. Here you should see that the database populated with questions, roles, etc.
npm run db:studio
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
- For using next auth, we need to setup a secret. This can be done in the .env file:
NEXTAUTH_SECRET="dummy"
- Generate a new secret wit the following command:
openssl rand -base64 32
- Update the
NEXTAUTH_SECRET
variable with the new value