The frontend is in client folder and backend is in server folder. They are separate apps that needs to be installed and run individually.
Frontend is using nextjs. Basically React. And backend is the standard nodejs + express + mysql.
For the backend to work, you need to create the relevant SQL database too. Assuming you already have MySQL in your machine.
cd into the server folder and install the application's dependencies.
cd server
npm installcd into the server/db folder and execute the sql commands in order
- createDB.sql (Create the database)
- createTable.sql (Create the table/s)
Many ways to do this. I did it by
cd server/db
mysql
source createDB.sql
source createTable.sqlseed table by executing the script seed.js by
node seed.jsFor the app to connect to the database in your local machine, you need to configure some parameters in the .env file, you can see .env.example for an example. Basically add your database user and password values into .env.
After successful installation, you should be able to run the app with 'npm run dev' and access the app at localhost:8081.
npm run devThe frontend package manager is yarn as opposed to npm (which we used in the backend), you might need to install yarn in your machine.
npm install -g yarncd into the client folder and install the application's dependencies.
cd client
yarn installAfter successful installation, you should be able to run the app with 'yarn dev' and access the app at localhost:3000.
yarn devTo see the whole thing working together, you need to start both applications concurrently and the frontend should be able to retrieve 'users' data, at page /users from your backend.
Start backend
cd server
npm run devStart frontend
cd client
yarn devGo to localhost:3000 and you should see everything working.