This the backend part of the 'Cabinet dentaire' project, Built using express js and prisma and postgres.
git clone [email protected]:hadarisas/cabinet_dentaire_backend.git
cd cabinet_dentaire_backend
npm i
npm i -g nodemon
docker build -t postgres_db_cabinet .
mkdir postgres_db_data
docker run -d --name cabinet_db_container -v /absolute_path_to_postgres_db_data:/var/lib/postgresql/data -p 5432:5432 postgres_db_cabinet
cp example_env.txt .env
npx prisma db push
npm run seed
npx prisma studio
# Install Homebrew if you don't have it
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install mkcert
brew install mkcert
# Install nss (for Firefox)
brew install nss
# Create and install the local CA
mkcert -install
# Create certificates for localhost
mkcert localhost 127.0.0.1 ::1
# Using chocolatey
choco install mkcert
# Or using scoop
scoop bucket add extras
scoop install mkcert
# Ubuntu/Debian
sudo apt install libnss3-tools
sudo apt install mkcert
# Or download the binary directly
curl -JLO "https://dl.filippo.io/mkcert/latest?for=linux/amd64"
chmod +x mkcert-v*-linux-amd64
sudo cp mkcert-v*-linux-amd64 /usr/local/bin/mkcert
# Create and install the local CA
mkcert -install
# Create certificates for localhost
mkcert localhost 127.0.0.1 ::1
This will generate two files: localhost+2.pem (the certificate) and localhost+2-key.pem (the private key)
npm run dev
For the API documentation, you can use the following link (if you use another port than 3000, replace it in the link):
http://localhost:3000/docs-api
router.use(authJwt.verifyToken);
in the routes files and uncomment
router.use(authJwt.authenticateToken);