Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mskian committed Dec 6, 2023
0 parents commit a1e22be
Show file tree
Hide file tree
Showing 41 changed files with 5,803 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
29 changes: 29 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: build-test

on:
pull_request:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Cache node modules
uses: actions/[email protected]
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- uses: actions/[email protected]
with:
node-version: '18.x'
- name: use yarn
run: |
yarn install
yarn build
31 changes: 31 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: vercel-deploy

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

on:
push:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Cache node modules
uses: actions/[email protected]
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- uses: actions/[email protected]
with:
node-version: '18.x'
- name: install vercel CLI
run: yarn global add vercel
- name: Deploy Project Vercel
run: vercel deploy --prod --token=${{ secrets.VERCEL_TOKEN }}
44 changes: 44 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local
.env

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# PWA
**/public/workbox-*.js
**/public/workbox-*.js.map
**/public/sw.js
**/public/sw.js.map
**/public/worker-*.js
**/public/worker-*.js.map
15 changes: 15 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.cache
package.json
package-lock.json
public
LICENSE
README.md
public
static
yarn.lock
out
build
node_modules
.next
.github
.vercel
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"arrowParens": "avoid",
"semi": false
}
15 changes: 15 additions & 0 deletions .vercelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.vercel
vendor
composer.json
composer.lock
procfile
app.json
LICENSE
README.md
.github
.gitignore
test.js
.env
renovate.json
dist
out
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (c) 2023 Santhosh Veer

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Tamil SMS

![build-test](https://github.com/mskian/next-tamil-sms/workflows/build-test/badge.svg)

Random Tamil Kavithai Collections - Tamil SMS Blog and kavithai index Database.

> Tamil Kavithai index Database - kavithai and kadhal kavithai.
⚛ React + Next JS | 🌩 Vercel

## Features 🍔

- React + Next JS
- Tailwind CSS
- Power Packed with React and Next Modules
- Next JS API Router for fetch Kavithai data
- PWA Support
- Vercel Cache

## Installation 📦

- Clone this repo or Download

```sh
git clone https://github.com/mskian/next-tamil-sms
cd next-tamil-sms
yarn
```

- Test the site

```sh
yarn dev
```

- Build the site

```sh
yarn build
```

- Test the production Build on Localhost

```sh
yarn start
```

## Contributing 🙌

Your PR's are Welcome

## LICENSE ☑

MIT
57 changes: 57 additions & 0 deletions app/api/kadhal/route.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { NextResponse } from "next/server"

const dummy_json = [{
id: "Data Not Found",
content: "Data Not Found",
}]

export const fetchCache = 'force-no-store'
export const revalidate = 0
export const dynamic = 'force-dynamic'

export async function GET() {
try {
const str = process.env.KADHAL_URL
const response = await fetch(str, {
headers: {
"User-Agent":
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
},
next: { revalidate: 0 }
})

const kavithai_data = await response.json()

if (response.status == 200) {
return NextResponse.json(kavithai_data, {
status: 200,
headers: {
"X-Frame-Options": "DENY",
"X-XSS-Protection": "1; mode=block",
"X-Content-Type-Options": "nosniff",
"Strict-Transport-Security": "max-age=63072000",
},
})
} else {
return NextResponse.json(dummy_json, {
status: 404,
headers: {
"X-Frame-Options": "DENY",
"X-XSS-Protection": "1; mode=block",
"X-Content-Type-Options": "nosniff",
"Strict-Transport-Security": "max-age=63072000",
},
})
}
} catch (error) {
return NextResponse.json(dummy_json, {
status: 404,
headers: {
"X-Frame-Options": "DENY",
"X-XSS-Protection": "1; mode=block",
"X-Content-Type-Options": "nosniff",
"Strict-Transport-Security": "max-age=63072000",
},
})
}
}
57 changes: 57 additions & 0 deletions app/api/kavithai/route.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { NextResponse } from "next/server"

const dummy_json = [{
id: "Data Not Found",
content: "Data Not Found",
}]

export const fetchCache = 'force-no-store'
export const revalidate = 0
export const dynamic = 'force-dynamic'

export async function GET() {
try {
const str = process.env.KAVITHAI_URL
const response = await fetch(str, {
headers: {
"User-Agent":
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
},
next: { revalidate: 0 }
})

const kavithai_data = await response.json()

if (response.status == 200) {
return NextResponse.json(kavithai_data, {
status: 200,
headers: {
"X-Frame-Options": "DENY",
"X-XSS-Protection": "1; mode=block",
"X-Content-Type-Options": "nosniff",
"Strict-Transport-Security": "max-age=63072000",
},
})
} else {
return NextResponse.json(dummy_json, {
status: 404,
headers: {
"X-Frame-Options": "DENY",
"X-XSS-Protection": "1; mode=block",
"X-Content-Type-Options": "nosniff",
"Strict-Transport-Security": "max-age=63072000",
},
})
}
} catch (error) {
return NextResponse.json(dummy_json, {
status: 404,
headers: {
"X-Frame-Options": "DENY",
"X-XSS-Protection": "1; mode=block",
"X-Content-Type-Options": "nosniff",
"Strict-Transport-Security": "max-age=63072000",
},
})
}
}
Binary file added app/favicon.ico
Binary file not shown.
17 changes: 17 additions & 0 deletions app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

body {
font-size: 16px;
font-family: 'Baloo Thambi 2', cursive;
height: 100vh;
color: rgba(0, 0, 0, 0.6);
font-weight: 600;
line-height: 1.618;
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: grayscale;
}
p {
line-height: 1.6;
}
Loading

0 comments on commit a1e22be

Please sign in to comment.