This repository is a practice fullstack development using NextJS for Frontend, NodeJS backed, and PostgreSQL database
This is based on https://www.youtube.com/watch?v=NaqNk2TbeRE
This is a User Management App allowing users to do the following:
- create enter a user and email and save it to the database.
- update user and email.
- delete a user in the database.
- Download Docker Desktop: Go to the Docker Desktop for Windows page and download the installer.
- Run the Installer: Double-click the downloaded
Docker Desktop Installer.exe
to run the installer. - Follow the Installation Wizard: Follow the prompts in the installation wizard to complete the setup.
- Start Docker Desktop: Once installed, start Docker Desktop from the Start menu.
- Download Docker Desktop: Visit the Docker Desktop for Mac page and download the installer.
- Run the Installer: Open the downloaded .dmg file and drag the Docker icon to the Applications folder.
- Start Docker Desktop: Open Docker from the Applications folder and follow the prompts to complete the setup.
- Update Your Packages:
sudo apt-get update sudo apt-get install \ ca-certificates \ curl \ gnupg \ lsb-release
- Add Docker’s Official GPG Key:
sudo mkdir -p /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
- Set Up the Repository:
echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
- Install Docker Engine:
sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
- Verify Installation:
sudo docker run hello-world
-
run command in CLI
docker compose build
docker compose up -d
-
Once containers are running. migrate prisma schema, run command
docker exec -it backend npx prisma migrate dev --name init
- This will create the Table "User" in the database
-
To check table in the database if it is created after prisma migration, run command to go into psql database
docker exec -it db psql -U user
user#\c mydb
user#\dt
- To check relationsuser#select * from "User";
- This will show empty rows in the table.
- access http://localhost:3000 in your web browser