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
npm install
Create a .env.local file in the root directory and add your environment variables.
| key | value | note |
|---|---|---|
| DATABASE_URL | <your_database_url> | Supabase Database URL |
| DIRECT_URL | <your_direct_url> | Supabase 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 |
| NEXT_PUBLIC_SUPABASE_URL | <supabase_api_key> | Project URL |
| NEXT_PUBLIC_SUPABASE_ANON_KEY | <supabase_anon_key> | Public Anon Key |
You can follow the .env.example file.
npm run dev
-
npm run build -
npm run start
-
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). -
Fill the details (project name, database password & region) and click on
Create New Project. -
After finishing setting up the project, Click on
Connect -
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" -
-
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 from side bar select
Project Settingsand go toAPIin configuration section. -
Copy the
Project URLand paste it into your .env file asNEXT_PUBLIC_SUPABASE_URL -
Again use the
publicanonkey fromProject API KeysasNEXT_PUBLIC_SUPABASE_ANON_KEY
For more details visit : https://supabase.com/partners/integrations/prisma
-
From side bar, Go to
Storageand create a new bucket. -
Name the bucket, check
Public Bucketand Save it. -
Now update
Policies. -
Add bucket name to
.envfile. -
Edit the next.config.mjs file (optional).
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.
Before pushing your code, run tests locally to catch any issues early:
npm testMake sure all tests pass before pushing your changes.
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.