This repository is a monorepo managed with Nx containing projects built with Next.js and NestJS.
- Getting Started
- Project Structure
- Available Scripts
- Running the Projects
- Building the Projects
- Docker Setup
- Testing
- Linting
- Using Nx
- License
To get started with this monorepo, follow these steps:
-
Clone the repository:
git clone https://github.com/System-Garcia/verse.git cd verse
-
Install dependencies:
npm install
-
Make sure you have Docker installed and running on your machine for database support.
-
For each application, copy the
.env.template
file to.env
and fill in the necessary environment variables:For the frontend (Next.js) application:
cp apps/frontend/.env.template apps/frontend/.env
For the backend (NestJS) application:
cp apps/backend/.env.template apps/backend/.env
-
Start the Docker containers for the database:
npm run start:docker
-
Run seeder:
npm run seed
Now you are ready to run the projects.
This repository contains the following projects:
- apps/frontend: A Next.js application.
- apps/backend: A NestJS application.
In the root directory, you can run the following scripts:
npm start
: Starts the Next.js application in development mode.npm run start:next
: Starts the Next.js application in development mode.npm run start:nest
: Starts the NestJS application in development mode.npm run build
: Builds both the Next.js and NestJS applications.npm run build:next
: Builds the Next.js application.npm run build:nest
: Builds the NestJS application.npm run start:docker
: Starts the Docker containers for the backend.npm run stop:docker
: Stops the Docker containers for the backend.npm run test
: Runs tests for both the Next.js and NestJS applications.npm run test:next
: Runs tests for the Next.js application.npm run test:nest
: Runs tests for the NestJS application.npm run lint
: Lints both the Next.js and NestJS applications.npm run lint:next
: Lints the Next.js application.npm run lint:nest
: Lints the NestJS application.
To run the Next.js application:
npm start
To run the NestJS application:
npm run start:nest
To build both the Next.js and NestJS application:
npm run build
To build Next.js application:
npm run build:next
To build NestJS application:
npm run build:nest
This monorepo uses Docker for database managment. To start the database:
- Make sure Docker is installed and running.
- Run the comman:
npm run start:docker
To stop docker containers: npm run stop:docker
To run tests for both the Next.js and NestJS applications:
npm run test
To run tests for the Next.js application:
npm run test:next
To run tests for the NestJS application:
npm run test:nest
To lint both the Next.js and NestJS applications:
npm run lint
To lint the Next.js application:
npm run lint:next
To lint the NestJS application:
npm run lint:nest
To execute tasks with Nx use the following syntax:
npx nx <target> <project> <...options>
You can also run multiple targets:
npx nx run-many -t <target1> <target2>
..or add -p
to filter specific projects
npx nx run-many -t <target1> <target2> -p <proj1> <proj2>
Targets can be defined in the package.json
or projects.json
. Learn more in the docs.
Nx comes with local caching already built-in (check your nx.json
). On CI you might want to go a step further.
Run npx nx graph
to show the graph of the workspace.
It will show tasks that you can run with Nx.
This project is licensed under the MIT License. See the LICENSE file for details.