This project was generated using Nx.
Project consist of 4 parts:
- Admin is Angular application for administration part.
- Client is React application for the site frontend.
- API is NestJS application for the project API.
- SSR Server is Express server that renders client app on a server.
Run this command to pull all necessary docker containers.
npm run docker-pull-all-images
Create uploads volume. It will be containing images uploaded from the admin part.
docker volume create uploads
To launch dev development use command:
npm install
npm run dev
This launch all project parts except SSR in watch mode (SRR is used only on prod). Also, it creates two docker images: postgres db image and pgadmin for this db.
-
Admin part url is http://localhost:4300
-
Client url is http://localhost:4200
-
API url is http://localhost:3333, but it is proxied for admin and client as
/api
the same as the/uploads
folder.
Project admin user can be created with cli part of the api
project, after project start you need to run this command:
node dist/apps/api/cli.js
Users for pgadmin panel and database can be found inside .env file.
Before start building prod docker images, you need to make several steps to launch it.
- Create self-signed ssl certificate and its private key or put existed ones to
docker/init/site.req.pem
anddocker/init/site.key.pem
. More detailed about how to create self-signed certificates look here. Also, you can use this command.
npm run generate-cert
- Set up enviroment variables. Clone
.env
file to.prod.env
.
- DB_SYNCHRONIZE is typeorm
synchronize
option. - DB_LOGGING is typeorm
logging
option. - GMAIL_USER is user that will be used to send mail from.
- GMAIL_PASSWORD is password of the prev user.
- OWNER_EMAIL is the email to where mail will be sent.
To create production build you need to run this command:
npm run prod
It creates one intermediate image called lyubimovstudio-build
and four images that is necessary to launch the project. These four images are lyubimovstudio-db
, lyubimovstudio-api
, lyubimovstudio-server
,
lyubimovstudio-ssr
.