Skip to content

AnishkaR-byte/quick-learn

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quick Learn

Nx logo

This workspace has been generated by Nx, Smart Monorepos · Fast CI.

Description

This project is a full-stack application built with Nx, a powerful tool for creating smart monorepos and enabling fast CI. The backend of the application is developed using Nest, a progressive Node.js framework, while the frontend is built with Next.js, a popular React framework. The database used is Postgres, and TypeORM is utilized as the ORM (Object-Relational Mapping) tool.

This project combines the power of Nx, Nest, Next.js, Postgres, and TypeORM to provide a robust and efficient full-stack development experience.

Setup

Install all the dependencies needed for the project.

npm install

For the database either, you can setup everything in your system or you can use docker.

  1. Sytem setup: Install Postgresql

  2. Docker Setup:

    1. Install docker
    2. Create docker image of the database: (Here -d will create and start the containers in the background, allowing you to continue using your terminal for other tasks.)
docker-compose -f docker-compose.dev.yml up -d

After successful installation, you can seed some minimum data to the database to run your app:

npx nx seed:run quick-learn-backend

After successful seeding, you can set the env variable for the apps:

cp apps/quick-learn-backend/.env.example apps/quick-learn-backend/.env.dev
cp apps/quick-learn-frontend/.env.example apps/quick-learn-frontend/.env

update this variables to desired values.

Now, you can run the backend and frontend or you can use the nx to run multiple apps at once.

Start Backend

npx nx run quick-learn-backend:dev

Start Frontend

npx nx run quick-learn-frontend:dev

Or, run both the app at once:

npx nx run-many --target=dev

Or, you can use the predefined script in package.json. This is make the db up and at the same time it will run both the apps.

npm run dev

Hosting

Note: Before going for hosting, check if the backend app has .env.production and frontend app has .env files.

For hosting, quick-learn is using two ways. you can use whatever that suits you:

  1. Using Docker
  2. Using PM2

Using Docker

Build the base image:

docker build . -t quick-learn:nx-base

Building image for both the apps:

docker compose build

Run the apps:

docker compose up -d

Using PM2

Install pm2 globally:

npm install pm2@latest

Create build for both the apps

npm run build:frontend:production
npm run build:backend:production

Now using pm2, run both the apps:

pm start ecosystem.config.js

You can go through this pm2 docs, to monitor the pm2 running apps.

TODO: Add a well docs for using nginx for the reverse proxy.

About

Quickly get reminded about the useful things

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 96.8%
  • JavaScript 2.4%
  • Other 0.8%