-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
3,173 additions
and
2,847 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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
|
||
# production | ||
/build | ||
yarn-error.log | ||
pnpm-error.log | ||
|
||
# misc | ||
.DS_Store | ||
|
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 |
---|---|---|
@@ -1,24 +1,24 @@ | ||
# See https://help.github.com/ignore-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
.env | ||
|
||
/node_modules | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# IDE Configs | ||
/.idea | ||
|
||
# See https://help.github.com/ignore-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
.env | ||
|
||
/node_modules | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
|
||
npm-debug.log* | ||
pnpm-debug.log* | ||
pnpm-error.log* | ||
|
||
# IDE Configs | ||
/.idea | ||
|
||
TODO.txt |
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,23 +1,25 @@ | ||
FROM node:16 | ||
FROM node:18 | ||
|
||
ENV NODE_ENV=production | ||
WORKDIR /srv/app | ||
|
||
RUN npm install -g pnpm | ||
|
||
RUN chown node:node . | ||
|
||
USER node | ||
|
||
# Node has the uid 1000 | ||
COPY --chown=node:node package.json yarn.lock ./ | ||
COPY --chown=node:node package.json pnpm-lock.yaml ./ | ||
|
||
RUN yarn --frozen-lockfile --production=false | ||
RUN pnpm install --frozen-lockfile | ||
|
||
COPY --chown=node:node ./ ./ | ||
|
||
# Build api | ||
RUN yarn build | ||
RUN pnpm build | ||
|
||
# Prunes devDependencies | ||
RUN yarn install --production --ignore-scripts --prefer-offline | ||
RUN pnpm install --production --ignore-scripts --prefer-offline | ||
|
||
CMD yarn start | ||
CMD pnpm start |
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,50 +1,50 @@ | ||
|
||
# UA Bouffe API | ||
[![Build status](https://github.com/ungdev/UA-bouffe-api/actions/workflows/ci.yml/badge.svg)](https://github.com/ungdev/UA-bouffe-api/actions/workflows/ci.yml) | ||
|
||
API du microservice [UA Bouffe](https://github.com/ungdev/UA-bouffe) | ||
|
||
## Installation | ||
### Prérequis | ||
- NodeJS | ||
- Yarn | ||
- MySQL | ||
### Base de données | ||
Créer la base de données uabouffe | ||
``` | ||
CREATE DATABASE uabouffe CHARACTER SET utf8; | ||
``` | ||
### Installation de l'API et des dépendances | ||
``` | ||
git clone https://github.com/ungdev/UA-bouffe-api | ||
cp .env.example .env | ||
yarn | ||
yarn seed | ||
``` | ||
## Développement | ||
### Démarrer l'API en développement | ||
``` | ||
yarn 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 | ||
``` | ||
yarn lint-fix | ||
``` | ||
### Démarrer l'API en production | ||
``` | ||
yarn build | ||
yarn start | ||
``` | ||
|
||
### CI/CD | ||
La pipeline de CI/CD est assurée par GitHub Actions. | ||
|
||
A chaque push sur master, GitHub Action lint le code, le build et trigger okd pour déployer le code en production ainsi que Slack pour notifier l'avancée de la vérification | ||
Il se passe en moyenne 5 minutes entre un push et un déploiement. | ||
|
||
### Diagramme de séquence lors d'une commande | ||
![Diagramme de séquence](./docs/sequence.svg) | ||
|
||
### Licence | ||
Le code est sous licence MIT. | ||
|
||
# UA Bouffe API | ||
[![Build status](https://github.com/ungdev/UA-bouffe-api/actions/workflows/ci.yml/badge.svg)](https://github.com/ungdev/UA-bouffe-api/actions/workflows/ci.yml) | ||
|
||
API du microservice [UA Bouffe](https://github.com/ungdev/UA-bouffe) | ||
|
||
## Installation | ||
### Prérequis | ||
- NodeJS | ||
- Pnpm | ||
- MySQL | ||
### Base de données | ||
Créer la base de données uabouffe | ||
``` | ||
CREATE DATABASE uabouffe CHARACTER SET utf8; | ||
``` | ||
### Installation de l'API et des dépendances | ||
``` | ||
git clone https://github.com/ungdev/UA-bouffe-api | ||
cp .env.example .env | ||
pnpm | ||
pnpm seed | ||
``` | ||
## 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 | ||
``` | ||
pnpm lint-fix | ||
``` | ||
### Démarrer l'API en production | ||
``` | ||
pnpm build | ||
pnpm start | ||
``` | ||
|
||
### CI/CD | ||
La pipeline de CI/CD est assurée par GitHub Actions. | ||
|
||
A chaque push sur master, GitHub Action lint le code, le build et trigger okd pour déployer le code en production ainsi que Slack pour notifier l'avancée de la vérification | ||
Il se passe en moyenne 5 minutes entre un push et un déploiement. | ||
|
||
### Diagramme de séquence lors d'une commande | ||
![Diagramme de séquence](./docs/sequence.svg) | ||
|
||
### Licence | ||
Le code est sous licence MIT. |
Oops, something went wrong.