Skip to content

Commit

Permalink
first commit: created project based on scaffold
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsingal committed Jul 10, 2023
0 parents commit 011956a
Show file tree
Hide file tree
Showing 176 changed files with 37,224 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true

[*.{js,json,yml}]
charset = utf-8
indent_style = space
indent_size = 2
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.yarn/** linguist-vendored
/.yarn/releases/* binary
/.yarn/plugins/**/* binary
/.pnp.* binary linguist-generated
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
.pnp.*

/node_modules
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.15
11 changes: 11 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const tailwindPlugin = require('prettier-plugin-tailwindcss');

const config = {
semi: true,
tabWidth: 2,
printWidth: 100,
singleQuote: true,
plugins: [tailwindPlugin],
};

module.exports = config;
874 changes: 874 additions & 0 deletions .yarn/releases/yarn-3.6.0.cjs

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
yarnPath: .yarn/releases/yarn-3.6.0.cjs
nodeLinker: node-modules
23 changes: 23 additions & 0 deletions Dockerfile.client
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM node:18-alpine
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
ENV NODE_ENV development

WORKDIR /app
COPY .yarn ./.yarn
COPY package.json .yarnrc.yml yarn.lock ./

WORKDIR /app/client
COPY ./client/package.json ./
RUN yarn install

ENV NEXT_TELEMETRY_DISABLED 1

COPY ./client .
RUN chown -R node:node /app/client
USER node

EXPOSE 3000
ENV PORT 3000

CMD ["yarn", "dev"]
21 changes: 21 additions & 0 deletions Dockerfile.cms
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM node:18-alpine
# Installing libvips-dev for sharp Compatibility
RUN apk update && apk add --no-cache build-base gcc autoconf automake zlib-dev libpng-dev nasm bash vips-dev
ENV NODE_ENV=development

WORKDIR /app/
COPY .yarn ./.yarn
COPY package.json .yarnrc.yml yarn.lock ./

WORKDIR /app/cms
COPY ./cms/package.json ./
RUN yarn install

ENV PATH /app/node_modules/.bin:$PATH

COPY ./cms .
RUN chown -R node:node /app/cms
USER node
RUN ["yarn", "build"]
EXPOSE 1337
CMD ["yarn", "dev"]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Vizzuality

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.
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# AFOCO

Description on progress...

## Usage

### Client

Start the client with:

```bash
yarn client dev
```

### Server CMS

Start the server with:

```bash
yarn cms dev
```

### Types for API

To generate the types for the API, run:

```bash
yarn types build
```

## Usage with Docker (recommended)

To run the app with docker, run:

```bash
docker-compose up --build
```

Open the app in http://localhost:3000 for the client and http://localhost:1337 for the CMS.

NOTE: Docker is recommended for development, but not for production (yet).
4 changes: 4 additions & 0 deletions client/.browserlistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# defaults means > 0.5%, last 2 versions, Firefox ESR, not dead
defaults
not IE 11
maintained node versions
21 changes: 21 additions & 0 deletions client/.env.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Public url. Canonical url of the project.
NEXT_PUBLIC_URL=http://localhost:3000

# API Url.
# Development, Preview, Production
# Depending on the environment we will use different urls. It can be the same for the storybook and for the project.
NEXT_PUBLIC_API_URL=https://api-url.com

# Mapbox token
# Development, Preview, Production
# corresponding to the account used for this project. It can be the same for the storybook and for the project.
NEXT_PUBLIC_MAPBOX_API_TOKEN=

# Google Analytics tracking ID.
# Development, Preview, Production
# If you're working with an Google Analytics 4 property, you have a Measurement ID instead of a Tracking ID.
NEXT_PUBLIC_GA_TRACKING_ID=UA-000000-2

# Recoil: Remove warnings about duplicate atoms due to hot-reloading
# Development
RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED=false
3 changes: 3 additions & 0 deletions client/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.next
/node_modules
/public
108 changes: 108 additions & 0 deletions client/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"next/core-web-vitals"
],
"ignorePatterns": [
"src/types/generated/*"
],
"rules": {
"no-console": [1, { "allow": ["info", "error", "debug"] }],
"import/order": [
"warn",
{
"groups": ["builtin", "external", "internal", "parent", "sibling"],
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
},
"pathGroups": [
{
"pattern": "react",
"group": "builtin",
"position": "before"
},
{
"pattern": "react**",
"group": "builtin"
},
{
"pattern": "@react**",
"group": "builtin"
},
{
"pattern": "next/**",
"group": "builtin",
"position": "after"
},
{
"pattern": "node_modules/**",
"group": "builtin"
},
{
"pattern": "@/env.mjs",
"group": "internal",
"position": "before"
},
{
"pattern": "@/lib/**",
"group": "internal",
"position": "before"
},
{
"pattern": "@/data/**",
"group": "internal",
"position": "before"
},
{
"pattern": "@/store",
"group": "internal",
"position": "before"
},
{
"pattern": "@/store/**",
"group": "internal",
"position": "before"
},
{
"pattern": "@/types/**",
"group": "internal",
"position": "before"
},
{
"pattern": "@/app/**",
"group": "internal",
"position": "before"
},
{
"pattern": "@/hooks/**",
"group": "internal",
"position": "before"
},
{
"pattern": "@/constants/**",
"group": "internal",
"position": "before"
},
{
"pattern": "@/containers/**",
"group": "internal",
"position": "before"
},
{
"pattern": "@/components/**",
"group": "internal"
},
{
"pattern": "@/services/**",
"group": "internal",
"position": "after"
}
],
"pathGroupsExcludedImportTypes": ["react"]
}
]
}
}
42 changes: 42 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 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

# vercel
.vercel

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


.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
.pnp.*
34 changes: 34 additions & 0 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
```

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

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
15 changes: 15 additions & 0 deletions client/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": true,
"tailwind": {
"config": "tailwind.config.js",
"css": "src/styles/globals.css",
"baseColor": "slate",
"cssVariables": true
},
"aliases": {
"components": "@/components",
"utils": "@/lib/classnames"
}
}
Loading

0 comments on commit 011956a

Please sign in to comment.