A BookStore app based on React(Typescript oriented using ViteJS), XState(State Management), ExpressJS(Server), NodeJS(Backend), MongoDB(Database) and graphQL.
- Setup the code
- Install dependencies
- Run application
- Set up nodemon.json file:
MONGO_USER="your mongoDB username"
MONGO_PASSWORD="your mongoDB password"
MONGO_DB="your mongoDB database name"
- Install Dependencies:
npm install
cd frontend/
npm install
To build the frontend application use the below command on your terminal/shell in root directory.
cd frontend/
npm run build
Directly build command if you are in frontend directory.
npm run build
To start running the application on browser we have to start backend and frontend seprately.
run start command in root directory in one terminal
npm start
And then it will be running on http://localhost:3000
And our backend server is ready.
You will get DATABASE CONNECTED
once database is connected.
run dev command in frontend directory in another terminal to run in developer's mode
cd frontend/
npm run dev
if you are in frontend directory
npm run dev
and the development mode app can be accessed on http://localhost:5173/
cd frontend/
npm run preview
Or you can preview the builded app from frontend directory directly
npm run preview
and the preview of app can be accessed on http://localhost:4173/
using node v19.1.0 (npm v8.19.3)