Skip to content

Commit

Permalink
Merge pull request #17 from Cassiopee-Bureau-Mobile/development
Browse files Browse the repository at this point in the history
Add favicon and modify readme
  • Loading branch information
SamuelGuillemet authored Jun 26, 2023
2 parents 444fca7 + be26dba commit 23a5e9a
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 18 deletions.
31 changes: 16 additions & 15 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@

To send emails, you need to have a gmail account well configured.

- You need to have a gmail account with a email as `EMAIL_USER` in the .env file.
- You need to have a gmail account. The email will be used as `EMAIL_USER` in the .env file.

- Create a gmail project on the [google cloud platform](https://console.cloud.google.com/).
- You can follow this [tutorial](https://docs.emailengine.app/setting-up-gmail-oauth2-for-imap-api) to configure your gmail account up to the part where I goes to the _Email Engine_ website.
- Details:
- You need to create a project on the [google cloud platform](https://console.cloud.google.com/).
- Go to APIs & Services > Credentials. (You will need to create a project if you don't have one)
- Then, you need to create an OAuth 2.0 Client ID.
- Get your Client ID, `EMAIL_CLIENT_ID` in the .env file.
- Get your Client Secret, `EMAIL_CLIENT_SECRET` in the .env file.
- You need to get an app password.
- You can follow this [tutorial](https://docs.emailengine.app/setting-up-gmail-oauth2-for-imap-api) to configure your gmail account up to the part where it switches to the _Email Engine_ website.
- Details:
- You need to create a project on the [google cloud platform](https://console.cloud.google.com/).
- Go to APIs & Services > Credentials. (You will need to create a project if you don't have one)
- Then, you need to create an OAuth 2.0 Client ID.
- Get your Client ID, `EMAIL_CLIENT_ID` in the .env file.
- Get your Client Secret, `EMAIL_CLIENT_SECRET` in the .env file.
- Then you need to get an app password.
- For this, you need to go to your [google account settings](https://myaccount.google.com/).
- Then, you need to go to the security tab.
- Activate the two-step verification.
Expand Down Expand Up @@ -68,28 +69,28 @@ EMAIL_PASSWORD=
## SSL

You will need to have a SSL certificate to deploy the application.
You need to generate a certificate and a key and put them in the `docker/ssl` folder, with the name:
You need to generate a certificate and a key for your website (for example `example.com`) and put them in the `docker/ssl` folder, with the name:

- example.crt
- example.key
- `example.com.crt`
- `example.com.key`

## Deploy

Try those with sudo if you got a permission error.

```bash
$ docker compose -f docker-compose.yml -f docker-compose.prod.yml build
$ docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d
```

Try those with sudo if you got a permission error.

## Setup the database

Try those with sudo if you got a permission error, especially for the `docker exec` commands.

```bash
$ docker exec -it cassiopee-frontend /bin/sh
$ npm run deploy
$ ./node_modules/.bin/ts-node --compiler-options {\"module\":\"CommonJS\"} prisma/prod-seed.ts admin-password-to-change
$ ./node_modules/.bin/ts-node --compiler-options {\"module\":\"CommonJS\"} prisma/prod-seed.ts ADMIN-PASSWORD-TO-CHANGE
```

The first command will open a shell inside the container.
Expand Down
5 changes: 5 additions & 0 deletions frontend/prisma/prod-seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ if (!password) {
process.exit(1);
}

if (password === 'ADMIN-PASSWORD-TO-CHANGE') {
console.error('Please change the default password');
process.exit(1);
}

const prisma = new PrismaClient();

const userData: Prisma.UserCreateInput[] = [
Expand Down
Binary file removed frontend/public/favicon.ico
Binary file not shown.
Binary file added frontend/public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion frontend/public/next.svg

This file was deleted.

1 change: 0 additions & 1 deletion frontend/public/vercel.svg

This file was deleted.

7 changes: 6 additions & 1 deletion frontend/src/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ export default function Document() {
<Html
lang='fr'
className='scroll-smooth'>
<Head />
<Head>
<link
rel='icon'
href='/favicon.png'
/>
</Head>
<body className='bg-slate-50'>
<Main />
<NextScript />
Expand Down

0 comments on commit 23a5e9a

Please sign in to comment.