-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from SivaramPg/swapi-reborn
V2: Swapi Reborn
- Loading branch information
Showing
338 changed files
with
12,318 additions
and
14,133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Dockerfile | ||
.dockerignore | ||
node_modules | ||
npm-debug.log | ||
README.md | ||
.next | ||
.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
NODE_VERSION=18 | ||
YARN_VERSION=1 | ||
NODE_VERSION=20 | ||
BUN_VERSION=1.1.5 | ||
|
||
DOMAIN_BASE_URL= |
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Code quality | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
quality: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Biome | ||
uses: biomejs/setup-biome@v2 | ||
with: | ||
version: latest | ||
- name: Run Biome | ||
run: biome ci . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,7 @@ yarn-error.log* | |
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
|
||
|
||
.env* | ||
!.env.example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bunx lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
src | ||
public | ||
|
||
**/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
:80 { | ||
log { | ||
format console | ||
} | ||
|
||
file_server | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
FROM oven/bun:1.1.5-alpine AS base | ||
|
||
# Install dependencies only when needed | ||
FROM base AS deps | ||
WORKDIR /app | ||
|
||
# Install dependencies based on the preferred package manager | ||
COPY package.json bun.lockb ./ | ||
RUN bun install --ignore-scripts | ||
|
||
|
||
# Rebuild the source code only when needed | ||
FROM base AS builder | ||
WORKDIR /app | ||
COPY --from=deps /app/node_modules ./node_modules | ||
COPY . . | ||
|
||
ENV NEXT_TELEMETRY_DISABLED 1 | ||
|
||
RUN bun run --bun build | ||
|
||
# Production image, copy all the files and run next | ||
FROM caddy:2.4.5-alpine AS runner | ||
|
||
RUN addgroup --system --gid 1001 nodejs | ||
RUN adduser --system --uid 1001 nextjs | ||
|
||
COPY Caddyfile /etc/caddy/Caddyfile | ||
COPY --from=builder --chown=nextjs:nodejs /app/out /srv/ | ||
|
||
USER nextjs | ||
|
||
EXPOSE 80 | ||
|
||
CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.6.1/schema.json", | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"files": { | ||
"ignoreUnknown": true | ||
}, | ||
"formatter": { | ||
"enabled": true, | ||
"formatWithErrors": false, | ||
"indentStyle": "tab", | ||
"indentWidth": 2, | ||
"lineWidth": 80, | ||
"lineEnding": "lf", | ||
"ignore": [] | ||
}, | ||
"javascript": { | ||
"formatter": { | ||
"arrowParentheses": "always", | ||
"jsxQuoteStyle": "double", | ||
"semicolons": "asNeeded", | ||
"trailingComma": "all", | ||
"quoteProperties": "asNeeded", | ||
"bracketSpacing": true, | ||
"bracketSameLine": false | ||
} | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
services: | ||
swapi.info: | ||
ports: | ||
- 3000:3000 | ||
build: | ||
context: . | ||
dockerfile: Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,23 @@ | ||
/** @type {import('next-sitemap').IConfig} */ | ||
module.exports = { | ||
siteUrl: 'https://swapi.info', | ||
output: 'export', | ||
generateIndexSitemap: false, | ||
exclude: '/api*', | ||
const sitemapConfig = { | ||
siteUrl: "https://swapi.info", | ||
output: "export", | ||
generateIndexSitemap: false, | ||
exclude: [ | ||
"/api/*", | ||
"/films", | ||
"/films/*", | ||
"/people", | ||
"/people/*", | ||
"/planets", | ||
"/planets/*", | ||
"/species", | ||
"/species/*", | ||
"/starships", | ||
"/starships/*", | ||
"/vehicles", | ||
"/vehicles/*", | ||
], | ||
} | ||
|
||
module.exports = sitemapConfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
output: 'export', | ||
output: "export", | ||
} | ||
|
||
module.exports = nextConfig | ||
export default nextConfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,44 @@ | ||
{ | ||
"name": "sw-api", | ||
"version": "0.1.0", | ||
"private": true, | ||
"scripts": { | ||
"dev": "next dev", | ||
"build": "next build", | ||
"start": "next start", | ||
"lint": "next lint", | ||
"postbuild": "next-sitemap" | ||
}, | ||
"dependencies": { | ||
"@types/node": "20.11.25", | ||
"@types/react": "18.2.64", | ||
"@types/react-dom": "18.2.21", | ||
"autoprefixer": "10.4.18", | ||
"bright": "^0.8.4", | ||
"clsx": "^2.0.0", | ||
"eslint": "8.57.0", | ||
"eslint-config-next": "14.1.3", | ||
"next": "14.1.3", | ||
"next-sitemap": "^4.1.8", | ||
"postcss": "8.4.35", | ||
"react": "18.2.0", | ||
"react-dom": "18.2.0", | ||
"tailwindcss": "3.4.1", | ||
"typescript": "5.4.2", | ||
"use-clipboard-copy": "^0.2.0" | ||
} | ||
"name": "swapi-reborn", | ||
"version": "2.0.0", | ||
"private": true, | ||
"scripts": { | ||
"dev": "next dev", | ||
"build": "next build", | ||
"start": "next start", | ||
"postbuild": "next-sitemap", | ||
"prepare": "husky" | ||
}, | ||
"dependencies": { | ||
"bright": "^0.8.5", | ||
"clsx": "^2.0.0", | ||
"next": "14.2.3", | ||
"next-sitemap": "^4.2.3", | ||
"next-themes": "^0.3.0", | ||
"react": "18.3.1", | ||
"react-dom": "18.3.1", | ||
"tailwind-merge": "^2.3.0", | ||
"use-clipboard-copy": "^0.2.0", | ||
"zod": "^3.23.5" | ||
}, | ||
"devDependencies": { | ||
"@biomejs/biome": "^1.6.2", | ||
"@types/bun": "^1.1.1", | ||
"@types/node": "20.11.25", | ||
"@types/react": "18.2.64", | ||
"@types/react-dom": "18.2.21", | ||
"autoprefixer": "10.4.18", | ||
"husky": "^9.0.11", | ||
"lint-staged": "^15.2.2", | ||
"postcss": "8.4.35", | ||
"tailwindcss": "3.4.1", | ||
"typescript": "5.4.2" | ||
}, | ||
"lint-staged": { | ||
"*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}": [ | ||
"biome check --apply --no-errors-on-unmatched", | ||
"biome format --write --no-errors-on-unmatched", | ||
"biome lint --apply --no-errors-on-unmatched" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module.exports = { | ||
plugins: { | ||
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
plugins: { | ||
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,59 @@ | ||
{ | ||
"title": "A New Hope", | ||
"episode_id": 4, | ||
"opening_crawl": "It is a period of civil war.\r\nRebel spaceships, striking\r\nfrom a hidden base, have won\r\ntheir first victory against\r\nthe evil Galactic Empire.\r\n\r\nDuring the battle, Rebel\r\nspies managed to steal secret\r\nplans to the Empire's\r\nultimate weapon, the DEATH\r\nSTAR, an armored space\r\nstation with enough power\r\nto destroy an entire planet.\r\n\r\nPursued by the Empire's\r\nsinister agents, Princess\r\nLeia races home aboard her\r\nstarship, custodian of the\r\nstolen plans that can save her\r\npeople and restore\r\nfreedom to the galaxy....", | ||
"director": "George Lucas", | ||
"producer": "Gary Kurtz, Rick McCallum", | ||
"release_date": "1977-05-25", | ||
"characters": [ | ||
"https://swapi.info/api/people/1", | ||
"https://swapi.info/api/people/2", | ||
"https://swapi.info/api/people/3", | ||
"https://swapi.info/api/people/4", | ||
"https://swapi.info/api/people/5", | ||
"https://swapi.info/api/people/6", | ||
"https://swapi.info/api/people/7", | ||
"https://swapi.info/api/people/8", | ||
"https://swapi.info/api/people/9", | ||
"https://swapi.info/api/people/10", | ||
"https://swapi.info/api/people/12", | ||
"https://swapi.info/api/people/13", | ||
"https://swapi.info/api/people/14", | ||
"https://swapi.info/api/people/15", | ||
"https://swapi.info/api/people/16", | ||
"https://swapi.info/api/people/18", | ||
"https://swapi.info/api/people/19", | ||
"https://swapi.info/api/people/81" | ||
], | ||
"planets": [ | ||
"https://swapi.info/api/planets/1", | ||
"https://swapi.info/api/planets/2", | ||
"https://swapi.info/api/planets/3" | ||
], | ||
"starships": [ | ||
"https://swapi.info/api/starships/2", | ||
"https://swapi.info/api/starships/3", | ||
"https://swapi.info/api/starships/5", | ||
"https://swapi.info/api/starships/9", | ||
"https://swapi.info/api/starships/10", | ||
"https://swapi.info/api/starships/11", | ||
"https://swapi.info/api/starships/12", | ||
"https://swapi.info/api/starships/13" | ||
], | ||
"vehicles": [ | ||
"https://swapi.info/api/vehicles/4", | ||
"https://swapi.info/api/vehicles/6", | ||
"https://swapi.info/api/vehicles/7", | ||
"https://swapi.info/api/vehicles/8" | ||
], | ||
"species": [ | ||
"https://swapi.info/api/species/1", | ||
"https://swapi.info/api/species/2", | ||
"https://swapi.info/api/species/3", | ||
"https://swapi.info/api/species/4", | ||
"https://swapi.info/api/species/5" | ||
], | ||
"created": "2014-12-10T14:23:31.880000Z", | ||
"edited": "2014-12-20T19:49:45.256000Z", | ||
"url": "https://swapi.info/api/films/1" | ||
"title": "A New Hope", | ||
"episode_id": 4, | ||
"opening_crawl": "It is a period of civil war.\r\nRebel spaceships, striking\r\nfrom a hidden base, have won\r\ntheir first victory against\r\nthe evil Galactic Empire.\r\n\r\nDuring the battle, Rebel\r\nspies managed to steal secret\r\nplans to the Empire's\r\nultimate weapon, the DEATH\r\nSTAR, an armored space\r\nstation with enough power\r\nto destroy an entire planet.\r\n\r\nPursued by the Empire's\r\nsinister agents, Princess\r\nLeia races home aboard her\r\nstarship, custodian of the\r\nstolen plans that can save her\r\npeople and restore\r\nfreedom to the galaxy....", | ||
"director": "George Lucas", | ||
"producer": "Gary Kurtz, Rick McCallum", | ||
"release_date": "1977-05-25", | ||
"characters": [ | ||
"https://swapi.info/api/people/1", | ||
"https://swapi.info/api/people/2", | ||
"https://swapi.info/api/people/3", | ||
"https://swapi.info/api/people/4", | ||
"https://swapi.info/api/people/5", | ||
"https://swapi.info/api/people/6", | ||
"https://swapi.info/api/people/7", | ||
"https://swapi.info/api/people/8", | ||
"https://swapi.info/api/people/9", | ||
"https://swapi.info/api/people/10", | ||
"https://swapi.info/api/people/12", | ||
"https://swapi.info/api/people/13", | ||
"https://swapi.info/api/people/14", | ||
"https://swapi.info/api/people/15", | ||
"https://swapi.info/api/people/16", | ||
"https://swapi.info/api/people/18", | ||
"https://swapi.info/api/people/19", | ||
"https://swapi.info/api/people/81" | ||
], | ||
"planets": [ | ||
"https://swapi.info/api/planets/1", | ||
"https://swapi.info/api/planets/2", | ||
"https://swapi.info/api/planets/3" | ||
], | ||
"starships": [ | ||
"https://swapi.info/api/starships/2", | ||
"https://swapi.info/api/starships/3", | ||
"https://swapi.info/api/starships/5", | ||
"https://swapi.info/api/starships/9", | ||
"https://swapi.info/api/starships/10", | ||
"https://swapi.info/api/starships/11", | ||
"https://swapi.info/api/starships/12", | ||
"https://swapi.info/api/starships/13" | ||
], | ||
"vehicles": [ | ||
"https://swapi.info/api/vehicles/4", | ||
"https://swapi.info/api/vehicles/6", | ||
"https://swapi.info/api/vehicles/7", | ||
"https://swapi.info/api/vehicles/8" | ||
], | ||
"species": [ | ||
"https://swapi.info/api/species/1", | ||
"https://swapi.info/api/species/2", | ||
"https://swapi.info/api/species/3", | ||
"https://swapi.info/api/species/4", | ||
"https://swapi.info/api/species/5" | ||
], | ||
"created": "2014-12-10T14:23:31.880000Z", | ||
"edited": "2014-12-20T19:49:45.256000Z", | ||
"url": "https://swapi.info/api/films/1" | ||
} |
Oops, something went wrong.