To run this website in your local, your system must have Node.js LTS installed.
Firstly, clone the github repo to your local system.
git clone https://github.com/devops-dynamics/devops-dynamics-website
cd devops-dynamics-website
Create a .env.local file in the root directory and add your environment variables.
| key | value | note |
|---|---|---|
| DATABASE_URL | <your_database_url> | Supbase Database URL |
| DIRECT_URL | <your_direct_url> | Supabse Direct URL |
| TOKEN_SECRET | <your_token_secret> | Token secret for authentication |
| BASE_URL | <your_base_url> | For local development use "http://localhost:3000" |
| NEXT_PUBLIC_BASE_URL | <your_base_url> | same as base url |
You can follow the .env.example file.
-
docker-compose -f docker-compose.local.yml --profile dev down --volumes --remove-orphans -
docker-compose -f docker-compose.local.yml --profile dev up
-
docker-compose -f docker-compose.local.yml --profile build down --volumes --remove-orphans -
docker-compose -f docker-compose.local.yml --profile build up
-
- First Login to your Supabase Account and Go to Dashboard https://supabase.com/
-
- Click on
New Projectand Choose Organization (if not already created , create one).
- Click on
-
- Fill the details (project name, database password & region) and click on
Create New Project.
- Fill the details (project name, database password & region) and click on
-
- After finishing setting up the project, Click on
Connect
- After finishing setting up the project, Click on
-
- In the
URItab, set theModetoTransactionand copy the URI string. Paste it into your.env.localfile & this will be yourDATABASE_URL. Replace[YOUR-PASSWORD]with your database password.
-
Append
?pgbouncer=true&connection_limit=1to the end of the connection string. -
Note: The
connection_limit=1parameter is only required if you are using Prisma from a serverless environment.
DATABASE_URL="postgres://[db-user].[project-ref]:[db-password]@aws-0-[aws-region].pooler.supabase.com:6543/[db-name]?pgbouncer=true&connection_limit=1" - In the
-
- Now set the
ModetoSessionand copy the URI string. Paste it into your .env.local file & This will be yourDIRECT_URL. Replace[YOUR-PASSWORD]with your database password.
DIRECT_URL="postgres://[db-user].[project-ref]:[db-password]@aws-0-[aws-region].pooler.supabase.com:5432/[db-name]" - Now set the
For more details visit : https://supabase.com/partners/integrations/prisma
This project uses GitHub Actions for continuous integration (CI) and to automate testing of commits. Here’s how you can use it:
The GitHub Actions workflow automatically triggers on every push to the staging branch. The build process will:
- Checkout the code from the repository.
- Set up Docker and build the Docker image.
- Run tests and ensure the build succeeds.
You can manually trigger the workflow using the workflow_dispatch event, which is useful for testing specific commits or branches.
To manually trigger the workflow:
- Go to the Actions tab in your GitHub repository.
- Select the “Staging - Build Docker Image” workflow.
- Click on the “Run workflow” button and specify the branch and commit ID to use in the image tag.
After pushing your code, review the status of the GitHub Actions workflow:
- Go to the Actions tab in your GitHub repository.
- Select the relevant workflow run to see the details.
- Review the logs to ensure the build and tests have passed.
If the workflow fails:
- Review the logs in the GitHub Actions workflow for any error messages.
- Fix the issues in your code or configuration.
- Push the changes again, which will automatically re-trigger the workflow.