Skip to content

Commit

Permalink
Merge pull request #40 from KrustyC/chore/remove-netlify
Browse files Browse the repository at this point in the history
chore: removed netlify
  • Loading branch information
KrustyC authored Feb 3, 2024
2 parents 34bdeab + 6271e73 commit b71feb0
Show file tree
Hide file tree
Showing 224 changed files with 9,965 additions and 21,970 deletions.
15 changes: 15 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
NEXT_PUBLIC_BASE_URL=http://localhost:3000
DISABLE_CACHE=true

CONTENTFUL_SPACE_ID=
CONTENTFUL_ACCESS_TOKEN=
CONTENTFUL_PREVIEW_ACCESS_TOKEN=

POSTGRES_PRISMA_URL=
POSTGRES_URL_NON_POOLING=

DRAFT_MODE_SECRET_TOKEN=

PROJECT_PASSWORD_COOKIE_SECRET=

REBUILD_PROJECTS_INDEX_API_KEY=
74 changes: 23 additions & 51 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,56 +1,28 @@
{
"plugins": [
"@typescript-eslint",
"prettier"
],
"extends": [
"next/core-web-vitals",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"extends": ["next/core-web-vitals", "prettier"],
"plugins": ["simple-import-sort"],
"rules": {
// I suggest you add those two rules:
"react-hooks/exhaustive-deps": 0,
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-explicit-any": "error",
"prettier/prettier": "error"
},
"settings": {
"import/resolver": {
"alias": {
"map": [
[
"@/components",
"src/components"
],
[
"@/hooks/*",
"src/hooks/*"
],
[
"@/contexts/*",
"src/contexts/*"
],
[
"@/layouts/*",
"src/layouts/*"
],
[
"@/types/*",
"src/types/*"
],
[
"@/utils/*",
"src/utils/*"
]
],
"extensions": [
".ts",
".js",
".jsx",
".json"
"import/newline-after-import": ["error", { "count": 1 }],
// increase the severity of rules so they are auto-fixable
"simple-import-sort/imports": [
"error",
{
"groups": [
// Packages `react` related packages come first.
["^react", "^@?\\w"],
// Internal packages.
["^(@)(/.*|$)"],
// Side effect imports.
["^\\u0000"],
// Parent imports. Put `..` last.
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
// Other relative imports. Put same-folder imports and `.` last.
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
// Style imports.
["^.+\\.?(css)$"]
]
}
}
],
"simple-import-sort/exports": "error"
}
}
}
49 changes: 49 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

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

jobs:
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: "20"
cache: "npm"
- name: Install dependencies
run: npm install
- name: Run typecheck
run: npm run typecheck

lint:
runs-on: ubuntu-latest
needs: typecheck
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: "20"
cache: "npm"
- name: Install dependencies
run: npm install
- name: Run lint
run: npm run lint

format:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: "20"
cache: "npm"
- name: Install dependencies
run: npm install
- name: Run prettier
run: npm run format
7 changes: 1 addition & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,13 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

# env files
.env
.env.local
.env.old

# netlify
/.netlify/
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.11.0
5 changes: 2 additions & 3 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"semi": true,
"trailingComma": "es5",
"singleQuote": false,
"tabWidth": 2,
"useTabs": false
"semi": true,
"singleQuote": false
}
20 changes: 5 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,17 @@

This is the website for https://beatricecox.com a Web Designer based in London.

[![Netlify Status](https://api.netlify.com/api/v1/badges/c26bf3d2-7ba8-48a8-975a-d7916a8a021f/deploy-status)](https://app.netlify.com/sites/beatricecox/deploys)

## Prerequisites

- [NodeJs](https://nodejs.org/en/) - v16+
- [Docker](https://nodejs.org/en/) / this is only used if you want to pull up the local mongo using docker-compose, otherwise you can install mongo directly into your machin
- [NodeJs](https://nodejs.org/en/) - v20+
- [Docker](https://docs.docker.com/) / this is only used if you want to pull up the local postgres using docker-compose, otherwise you can install postgres directly into your machin

## Getting Started

First, run the development server:

```bash
netlify dev
```
First of all make sur eyou have copied `.env` into `.env.local`, and updtated all the values according to your local values. Once that is done, make sure to run the postgres database with `docker-compose up`. On a different terminal now simply run `npm run dev` and the app will start on port 3000.

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

## API

This project is making use of Netlify Functions to expose its API. All functions are kept inside `./netlify/functions`. Netlify automatically provision Lambda functions for each file inside the aforementioned folder.

### Deploy on Netlify
### Deploy on Vercel

This website is deployed and served through netlify, any push on `master` will automatically trigger a deployment to the production website.
This website is deployed and served through Vercel, any push on `master` will automatically trigger a deployment to the production website.
14 changes: 14 additions & 0 deletions codegen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { CodegenConfig } from "@graphql-codegen/cli";

const config: CodegenConfig = {
overwrite: true,
schema: "./schema.graphql",
generates: {
"src/types/new-generated/": {
preset: "client",
plugins: [],
},
},
};

export default config;
12 changes: 12 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: "3.9"
services:
beatrice-cox-pg-db:
image: postgres:16.1-alpine3.19
ports:
- 54320:5432
volumes:
- ~/apps/postgres:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=an_amazing_password
- POSTGRES_USER=beatrice
- POSTGRES_DB=beatricedb
12 changes: 0 additions & 12 deletions docker-compose.yml

This file was deleted.

16 changes: 0 additions & 16 deletions netlify.toml

This file was deleted.

77 changes: 0 additions & 77 deletions netlify/functions/admin-build-projects-index.ts

This file was deleted.

Loading

0 comments on commit b71feb0

Please sign in to comment.