Follow these steps to set up and run the application with Vite.
Ensure the following are installed on your system:
- Node.js (v14.18+ recommended)
- npm (npm comes bundled with Node.js)
If you're starting from an existing repository, follow these steps:
-
Clone the repository:
git clone https://github.com/rightbrain/signup-node.git
-
Move into the project folder:
cd /signup-node/client
-
Install the required dependencies:
npm i
-
In the root directory of your project, create a
.env
file:touch .env
-
Open the
.env
file and add the following variables:VITE_API_BASE_URL=http://localhost:8080/api/v1 VITE_BASE_URL=http://localhost:8080
Run the following command to start the development server:
npm run dev
Note: First set up the backend server, then run the frontend on the browser.
- Move to the backend directory with another terminal window:
cd /server
- Install the required dependencies:
npm i
- In the root directory of your project, create a
.env
file:touch .env
- Open the
.env
file and add the following variables:MONGODB_URI=mongodb://localhost:27017/cv_bilder_DB JWT_SECRET=demo_rbs123
Install MongoDB and MongoDB Compass (Database GUI) for Ubuntu (Other platforms may require different instructions)
-
Download and install MongoDB from https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-ubuntu/#std-label-install-mdb-community-ubuntu.
-
Verify MongoDB installation:
sudo systemctl status mongod
-
Download and install MongoDB Compass from https://www.mongodb.com/try/download/compass.
-
Verify MongoDB Compass installation:
mongodb-compass --version
- Open MongoDB Compass.
mongodb-compass
- Click on the new connection button (+) button.
- With the uri set to
mongodb://localhost:27017
and set a name, finally press save & connect button. - Create a new database by selecting the new created connection. Enter a name for your database ( "cv_bilder_DB" in this case, so that it matches the name in the
.env
file). - Enter the database name and a collection name ( "users" in this case, all the other collections will be created automatically).
- Click on the "Create Database" button.
- You should now have a new database named "cv_bilder_DB" in MongoDB Compass.
-
Run the following command to start the backend server:
npm run dev
-
The backend server should start running in the background, and you should see a message indicating that the server is running at
http://localhost:8080
in your terminal.
Open a browser and visit http://localhost:5173
. You should see the CV Builder App running in development mode.