This repository includes the following:
- A Monorepo governed by Yarn Workspaces.
- An Express app in
packages/api
.- The Express app has persistence through a Postgres Database (Prisma as ORM).
- A React app in
packages/ui
.- The React app has routing and communicates with the Express App.
-
Clone this repository
-
Add a
packages/ui/.env
file:VITE_RUN_MODE=local VITE_LOC_BASE_URL=http://localhost:5050 VITE_USER_USERNAME=user-1 VITE_USER_PASSWORD=user-1 VITE_ADMIN_USERNAME=admin-1 VITE_ADMIN_PASSWORD=admin-1
-
Add a
packages/api/.env
file:DEBUG=demo:* NODE_ENV=local HOST_PORT=5432 DATABASE_URL="postgresql://prisma:prisma@127.0.0.1:${HOST_PORT}/demo-local" JWT_SECRET="use-any-passphrase"
-
Add a
packages/api/.env.test
file:DEBUG=none NODE_OPTIONS=--experimental-vm-modules NODE_ENV=test HOST_PORT=5432 DATABASE_URL="postgresql://prisma:prisma@127.0.0.1:${HOST_PORT}/demo-test" JWT_SECRET="use-any-passphrase"
-
Open your terminal. Change the directory to where you cloned this repository. Run
yarn
in the terminal and it will install all the dependencies. -
Then, run
yarn dev
and it will run both server and client apps.
You should be able to access the frontend (UI) at http://localhost:5173/. (The backend API server will be accessible at http://localhost:5050/)
Please see this short video that described your task.
Starting a new coding project can be intimidating, but it's important to remember that you don't need to understand every line of code in order to complete the task. Focus on understanding what you need to know to get the job done and familiarize yourself with the frameworks and libraries used in the application - a basic understanding of these tools will help you to get the job done quickly and efficiently without getting overwhelmed by details that may not be necessary.