Skip to content

Commit

Permalink
Merge branch 'master' into moderation
Browse files Browse the repository at this point in the history
  • Loading branch information
Somnath-Chattaraj authored Jul 30, 2024
2 parents 6d0b663 + 8eb00ad commit 298fe59
Show file tree
Hide file tree
Showing 14 changed files with 7,408 additions and 3 deletions.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/custom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Custom issue template
about: Describe this issue template's purpose here.
title: ''
labels: ''
assignees: ''

---


20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
62 changes: 62 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: CI Build

on:
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'npm'

- name: Cache frontend node modules
uses: actions/cache@v3
with:
path: frontend/node_modules
key: ${{ runner.os }}-frontend-${{ hashFiles('frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-frontend-
- name: Cache backend node modules
uses: actions/cache@v3
with:
path: backend/node_modules
key: ${{ runner.os }}-backend-${{ hashFiles('backend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-backend-
- name: Install dependencies (frontend)
run: npm install
working-directory: frontend

- name: Install dependencies (backend)
run: npm install
working-directory: backend

- name: Build frontend
run: npm run build
working-directory: frontend

- name: Build backend
run: npm run build
working-directory: backend

- name: Set up Prisma
run: npx prisma generate
working-directory: backend

- name: Run Prisma Migrate
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
run: npx prisma migrate deploy
working-directory: backend
31 changes: 31 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build and Deploy to Docker Hub

on:
push:
branches:
- master

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Check Out Repo
uses: actions/checkout@v2

- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and Push Docker image
uses: docker/build-push-action@v2
with:
context: ./backend
file: ./backend/Dockerfile
push: true
tags: somnath910/statuscode1:latest # Replace with your Docker Hub username and repository

- name: Verify Pushed Image
run: docker pull somnath910/statuscode1:latest # Replace with your Docker Hub username and repository
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.DS_Store
node_modules
.env
package-lock.json
7 changes: 7 additions & 0 deletions backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
npm-debug.log
.git
.gitignore
Dockerfile
.dockerignore
.env
26 changes: 26 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Use the official Node.js image as a base image
FROM node:latest

# Set the working directory in the container
WORKDIR /app

# Copy package.json and package-lock.json (if available)
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy the rest of the application code
COPY . .

# Build the TypeScript code
RUN npm run build

# Run Prisma Migrate and Generate Prisma Client
RUN npx prisma generate

# Expose the port the app runs on
EXPOSE 3000

# Command to run the application
CMD ["node", "dist/index.js"]
Loading

0 comments on commit 298fe59

Please sign in to comment.