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-imagesCreate uploads volume. It will be containing images uploaded from the admin part.
docker volume create uploadsTo launch dev development use command:
npm install
npm run devThis 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
/apithe same as the/uploadsfolder.
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.jsUsers 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.pemanddocker/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
.envfile to.prod.env.
- DB_SYNCHRONIZE is typeorm
synchronizeoption. - DB_LOGGING is typeorm
loggingoption. - 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 prodIt 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.