Before you begin, ensure you have the following installed on your system:
Find Server Here: [https://github.com/Nrhine/instock-joseph-api]
git clone https://github.com/Nrhine/instock-joseph.git
git clone https://github.com/Nrhine/instock-joseph-api.git
- In the root directory of the project, you'll find a file named
.env.sample
. - Create a copy of this file and name it
.env
. - Do this for both server and client side.
cp .env.sample .env
- Open the
.env
file and fill in the required environment variables with your specific values. - We used 'http://localhost:5173' for the client side .env and 8080 for the port number in the server side .env
Install dependencies for both the server and client:
# Install server dependencies
npm install
# Install client dependencies
npm install
- On the server side run:
npx knex migrate:latest
- Seed the migrated database:
npx knex seed:run
You'll need to start both the server and client sides of the application.
- Start the server:
npm run dev
This will start the Express server, typically on http://localhost:8080
(check the console output for the exact URL and replace port number with the one you chose in the server side .env file).
- In a new terminal window, start the client:
npm run dev
This will start the React development server, typically on http://localhost:5173
Open your web browser and visit http://localhost:5173/
to view the React frontend. The frontend should now be connected to the Express backend. Check routes in App.jsx to ensure you are using the correct URL.
- Make sure all required environment variables are properly set in the
.env
file for both the client and server to function correctly.
If you encounter any issues:
- Ensure all dependencies are installed correctly.
- Check that your
.env
file is set up properly with all required variables. - Make sure no other processes are using the required ports.
For any other problems, please open an issue in the GitHub repository.