Skip to content
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

add sonarqube integration #2

Merged
merged 2 commits into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI Workflow

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

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

strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Adjust NODE_VERSION as desired
ARG NODE_VERSION=19.0.0
FROM node:${NODE_VERSION}-slim as base
FROM node:${NODE_VERSION}-slim AS base

LABEL fly_launch_runtime="Next.js"

Expand All @@ -14,11 +14,11 @@ ENV NODE_ENV="production"


# Throw-away build stage to reduce size of final image
FROM base as build
FROM base AS build

# Install packages needed to build node modules
RUN apt-get update -qq && \
apt-get install -y build-essential pkg-config python-is-python3
apt-get install -y build-essential pkg-config python-is-python3 && apt-get clean

# Install node modules
COPY --link package-lock.json package.json ./
Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
Live: https://avrasya.fly.dev/
Live: https://avrasya.fly.dev/

[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=ThinkThread_avrasya-website&metric=bugs)](https://sonarcloud.io/summary/new_code?id=ThinkThread_avrasya-website)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=ThinkThread_avrasya-website&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=ThinkThread_avrasya-website)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=ThinkThread_avrasya-website&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=ThinkThread_avrasya-website)
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=ThinkThread_avrasya-website&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=ThinkThread_avrasya-website)
[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=ThinkThread_avrasya-website&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=ThinkThread_avrasya-website)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=ThinkThread_avrasya-website&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=ThinkThread_avrasya-website)
[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=ThinkThread_avrasya-website&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=ThinkThread_avrasya-website)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=ThinkThread_avrasya-website&metric=coverage)](https://sonarcloud.io/summary/new_code?id=ThinkThread_avrasya-website)
2 changes: 1 addition & 1 deletion app/get-started/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";
import ReactCodeMirror from "@uiw/react-codemirror";
import { FaGithub, FaNpm } from "react-icons/fa";
import { FaNpm } from "react-icons/fa";
import { javascript } from '@codemirror/lang-javascript';
import { json } from '@codemirror/lang-json';
import Link from "next/link";
Expand Down
2 changes: 0 additions & 2 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
@tailwind components;
@tailwind utilities;

:root {
}

@media (prefers-color-scheme: dark) {
:root {
Expand Down
19 changes: 14 additions & 5 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,30 @@ import HeaderContainer from '@/components/HeaderContainer'

const inter = Inter({ subsets: ['latin'] })

interface Props {
readonly children: React.ReactNode
}

export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
}: Props) {

return (
<html lang="en">
<head>
<title>Avrasya Web Framework</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Avrasya Web Framework" />
<meta name="keywords" content="Avrasya, Web, Framework, React, Next, Tailwind, TypeScript" />
<meta name="description" content="Avrasya is a fast and unique Node.js web framework designed for building web applications and APIs. Avrasya stands out with its simple usage, performance, and extensibility." />
<meta name="keywords" content="avrasya, web, framework, nodejs, javascript, typescript, react, nextjs, fast, unique, simple, performance, extensibility" />
<meta name="author" content="Muhtalip Dede" />
<meta name="theme-color" content="#000000" />
<meta name="og:title" content="Avrasya Web Framework" />
<meta name="og:description" content="Avrasya is a fast and unique Node.js web framework designed for building web applications and APIs. Avrasya stands out with its simple usage, performance, and extensibility." />
<meta name="og:type" content="website" />
<meta name="og:url" content="https://avrasya.fly.dev" />
<meta name="og:site_name" content="Avrasya Web Framework" />
<meta name="og:image" content="https://avrasya.fly.dev/avrasya.png" />
<meta name="publish_date" content="2023-11-11" />
<link rel="icon" href="/favicon.ico" />
<link rel="manifest" href="/manifest.json" />
</head>
Expand Down
4 changes: 2 additions & 2 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ export default function Home() {
<h1 className="xl:text-6xl text-5xl text-left text-transparent bg-clip-text bg-gradient-to-r from-red-500 to-blue-500">
The
</h1>
<h1 className="xl:text-6xl text-5xl text-left text-transparent bg-clip-text bg-gradient-to-r from-blue-500 to-green-500">
<h2 className="xl:text-6xl text-5xl text-left text-transparent bg-clip-text bg-gradient-to-r from-blue-500 to-green-500">
Simple
</h1>
</h2>
<h2 className="xl:text-6xl text-5xl text-left text-transparent bg-clip-text bg-gradient-to-r from-green-500 to-orange-500">
Node.js
</h2>
Expand Down
6 changes: 3 additions & 3 deletions components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function Header({ isOpen, setIsOpen }: HeaderProps) {
</Link>
</div>
<div className="flex flex-row items-center space-x-4">
<button onClick={() => setIsOpen(!isOpen)} className="flex flex-row items-center rounded-md">
<button onClick={() => setIsOpen(!isOpen)} className="flex flex-row items-center rounded-md" id="menu-button" aria-label="Menu">
<svg className="w-6 h-6 text-gray-100 dark:text-gray-100" fill="none" stroke="currentColor" viewBox="0 0 24 24">
{isOpen ? <>
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 18L18 6M6 6l12 12" />
Expand Down Expand Up @@ -68,13 +68,13 @@ export default function Header({ isOpen, setIsOpen }: HeaderProps) {
</a>
{currentLanguage === 'tr' ? <>
<div className="flex flex-row items-center space-x-4">
<button onClick={() => handlerChangeLanguage('tr')} className="flex flex-row items-center rounded-md">
<button onClick={() => handlerChangeLanguage('tr')} className="flex flex-row items-center rounded-md" id="menu-button" aria-label="Menu">
<Image src="https://cdn.countryflags.com/thumbs/turkey/flag-400.png" width="32" height="32" alt='Türkçe' />
</button>
</div>
</> : <>
<div className="flex flex-row items-center space-x-4">
<button onClick={() => handlerChangeLanguage('en')} className="flex flex-row items-center rounded-md">
<button onClick={() => handlerChangeLanguage('en')} className="flex flex-row items-center rounded-md" id="menu-button" aria-label="Menu">
<Image src="https://cdn.countryflags.com/thumbs/united-states-of-america/flag-400.png" width="32" height="32" alt='English' />
</button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion components/HeaderModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function HeaderModal({isOpen, setIsOpen}: HeaderModalProps) {
<h3 className="text-2xl font-medium leading-6 text-gray-900" id="modal-title">
Avrasya
</h3>
<button type="button" className="bg-white rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500" data-dismiss="modal" aria-label="Close" onClick={() => setIsOpen(false)}>
<button type="button" className="bg-white rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500" data-dismiss="modal" aria-label="Close" onClick={() => setIsOpen(false)} id="close-button">
<span className="sr-only">Close</span>
<svg className="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke="currentColor" aria-hidden="true">
Expand Down
Binary file added public/avrasya.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sonar.projectKey=ThinkThread_avrasya-website
sonar.organization=thinkthread