Skip to content

Commit

Permalink
Merge pull request #37 from ungdev/up_dep
Browse files Browse the repository at this point in the history
Upgrade dependencies and migrate to Nextjs
  • Loading branch information
Zalk0 authored Nov 30, 2023
2 parents 4d2c7d2 + 4fd7e46 commit a45736c
Show file tree
Hide file tree
Showing 71 changed files with 8,135 additions and 18,512 deletions.
26 changes: 13 additions & 13 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Windows-style newlines
[*]
end_of_line = lf
insert_final_newline = false
charset = utf-8
indent_style = space
indent_size = 2
trim_trailing_whitespace=true
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
# Unix-style newlines
end_of_line = lf
insert_final_newline = false
charset = utf-8
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
8 changes: 3 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
# React dotenv

NODE_ENV=development
PORT=8081

# Pour désactiver l'ouverture dans un nouvel onglet
BROWSER=none


# App dotenv. These variables are used DURING react build.
# Page dotenv. These variables are used DURING next build.
# For this reason, the values below will only be used with
# `pnpm dev`. For values used along with `pnpm build`, check
# the Dockerfile (docker build arguments)

REACT_APP_API_URI=http://localhost:3001
REACT_APP_API_TIMEOUT=5000
NEXT_PUBLIC_API_URI=http://localhost:3001
NEXT_PUBLIC_API_TIMEOUT=5000
15 changes: 11 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
{
"parser": "@typescript-eslint/parser",
"extends": [
"react-app",
"next/core-web-vitals",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"prettier"
],
"plugins": ["@typescript-eslint", "react-hooks", "prettier"],
"plugins": [
"@typescript-eslint",
"react-hooks",
"prettier"
],
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
Expand All @@ -23,8 +27,11 @@
"@typescript-eslint/explicit-module-boundary-types": "off",
"no-console": "error",
"no-alert": "error",
"linebreak-style": ["warn", "unix"],
"react/require-default-props": "error",
"linebreak-style": [
"warn",
"unix"
],
"react/require-default-props": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"react/no-unescaped-entities": "off",
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: CI
on: [push, pull_request]
on: [ push, pull_request ]

jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16]
node-version: [ 20 ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
Expand All @@ -24,14 +24,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16]
node-version: [ 20 ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
Expand Down
14 changes: 13 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

# misc
.DS_Store

# local env files
.env*.local
.env

# debug
Expand All @@ -23,8 +26,17 @@ pnpm-error.log*
# CRA Typescript file generated
src/*.d.ts

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

TODO.txt
bouffe-captures/

# IDE
.idea/
.idea/

# next.js
/.next/
/out/

20 changes: 10 additions & 10 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 120,
"tabWidth": 2,
"arrowParens": "always",
"endOfLine": "crlf",
"jsxBracketSameLine": true
}
{
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 120,
"tabWidth": 2,
"arrowParens": "always",
"endOfLine": "crlf",
"jsxBracketSameLine": true
}
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM node:16
FROM node:20

ENV NODE_ENV=production

ARG API_URI=http://localhost:3001
ENV REACT_APP_API_URI $API_URI
ENV NEXT_PUBLIC_API_URI $API_URI

ARG API_TIMEOUT=5000
ENV REACT_APP_API_TIMEOUT $API_TIMEOUT
ENV NEXT_PUBLIC_API_TIMEOUT $API_TIMEOUT

WORKDIR /srv/app

Expand All @@ -19,7 +19,7 @@ USER node
# Node has the uid 1000
COPY --chown=node:node package.json pnpm-lock.yaml ./

RUN pnpm install --frozen-lockfile
RUN pnpm install --frozen-lockfile --production=false

COPY --chown=node:node ./ ./

Expand All @@ -29,4 +29,4 @@ RUN pnpm build
# Prunes devDependencies
RUN pnpm install --production --ignore-scripts --prefer-offline

CMD pnpm start
CMD pnpm start
42 changes: 21 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
MIT License
Copyright (c) 2019 UNG
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.
MIT License

Copyright (c) 2019-2023 UNG

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.
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# UA Bouffe API
[![Build Status](https://travis-ci.org/ungdev/UA-bouffe.svg?branch=master)](https://travis-ci.org/ungdev/UA-bouffe)
# UA Bouffe Front
[![Build status](https://github.com/ungdev/UA-bouffe-front/actions/workflows/ci.yml/badge.svg)](https://github.com/ungdev/UA-bouffe-front/actions/workflows/ci.yml)

Console de vente de l'UTT Arena

Expand All @@ -11,27 +11,39 @@ Console de vente de l'UTT Arena
- Pnpm

### Installation de l'application
Voir [UA-bouffe](https://github.com/ungdev/UA-bouffe)

Anciennes instructions :
```
git clone https://github.com/ungdev/UA-bouffe
git clone https://github.com/ungdev/UA-bouffe-front
cp .env.example .env
pnpm
pnpm i
```

## Développement

### Démarrer l'API en développement

```
pnpm dev
```

### Avant de commit
Afin de garder une certaine cohérence dans le code, on utilise EsLint et Prettier. Il faut donc bien lint le code avant de commit

Afin de garder une certaine cohérence dans le code, on utilise EsLint et Prettier. Il faut donc bien lint le code avant
de commit

```
pnpm lint-fix
pnpm lint:fix
```

### Démarrer l'API en production

```
pnpm build
pnpm start
```

### Licence

Le code est sous licence MIT.
Loading

0 comments on commit a45736c

Please sign in to comment.