This Nx workspace contains the following applications:
- Backend application built with Nest.js for server-side functionality.
- Two front-end applications using Next.js for client-side functionality.
You can check the Nx read me file here: Nx Workspace
In the root folder run npm install
npm install
- To enhance your development experience, we highly recommend installing the Nx Console extension in Visual Studio Code (VSCode).
- The Nx Console is a powerful tool that provides a user-friendly interface to navigate and manage your Nx workspace.
- With the Nx Console, you can efficiently run commands, generate code, analyze dependencies, and access various Nx features.
- Open Visual Studio Code.
- Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window or press
Ctrl+Shift+X
(Windows/Linux) orCmd+Shift+X
(Mac). - In the Extensions view, search for
Nx Console
using the search bar. Click on the "Install" button next to theNx Console
extension by Nrwl. - Once installed, you can access the Nx Console by clicking on the Nx Console icon in the Activity Bar on the side of the window or press
Ctrl+Shift+N
(Windows/Linux) orCmd+Shift+N
(Mac).
# apps/api
- api:serve
npx nx run api:serve --configuration=development
- database:seed
nx run database:seed:run
# apps/web
- To run web app use command
npx nx run web:serve --configuration=development
- To run remotion studio use command
npx nx run web:remotion:studio
- To create a new Next app use
nx g @nx/next:app my-new-app
- To run remotion studio from libs folder use command
npx nx run remotion-composition-studio:remotion:studio
-
PostgreSQL Installation:
- Download and install PostgreSQL from the official website: PostgreSQL
- Follow the installation instructions for your operating system.
- During the installation, set up a superuser password and remember it for future use.
-
pgAdmin Installation:
- Download and install pgAdmin from the official website: pgAdmin
- Follow the installation instructions for your operating system.
- Launch pgAdmin after installation and configure it to connect to your PostgreSQL server using the superuser credentials set during the PostgreSQL installation.
-
Docker Installation:
- If you prefer to use Docker to run your database, install Docker from the official website: Docker
-
Running PostgreSQL with Docker:
-
Once Docker is installed, open your terminal or command prompt.
-
Pull the official PostgreSQL image from Docker Hub:
docker pull postgres
-
Run a PostgreSQL container:
docker run -d --name postgres-db -e POSTGRES_PASSWORD=<your_password> -p 5432:5432 postgres
Replace
<your_password>
with your preferred PostgreSQL password.
-
-
Connecting to the Dockerized PostgreSQL:
- You can now use the same credentials to connect to the PostgreSQL database either with pgAdmin or in your Nx applications.
-
Backend Application:
-
Open a terminal or command prompt and navigate to the
apps/backend
directory. -
Install the backend application's dependencies:
npm install
-
Start the backend application:
npm run start
-
The backend server will be running on http://localhost:3000.
-
-
Frontend Applications:
-
Each front-end application has its own directory within the
apps
folder. -
To run each front-end application, open a terminal or command prompt and navigate to the respective front-end app directory (e.g.,
apps/frontend-app1
). -
Install the front-end application's dependencies:
npm install
-
Start the front-end application:
npm run dev
-
The front-end application will be running on http://localhost:4000 for app1 and http://localhost:5000 for app2 (change the port numbers accordingly).
-
-
Accessing the Applications:
-
The backend and front-end applications are now running.
-
You can access the backend API and front-end applications from your browser or API clients like Postman or Insomnia.
-
Frontend App1: http://localhost:4000
-
Frontend App2: http://localhost:5000
-
Backend API: http://localhost:3000
-
That's it! You have successfully installed PostgreSQL and pgAdmin, set up a Dockerized database, and run the backend and front-end applications in your Nx workspace. Happy coding! 🚀