This guide will help you setup Loggsy on your local machine.
I have used MacOS for the development of Loggsy, so the commands may differ for other operating systems.
Prerequisites
I've also mentioned the Exact version used in development
- Node.js v16.14.2
I've also mentioned the Exact version used in development
- Python v3.10.6
You can also download the repository as a zip file and extract it
- Clone the repository
git clone https://github.com/McTechie/loggsy/loggsy
Frontend
-
Rename the
.env.example
file to.env.local
file in theclient
directory -
Replace
<backend_url_here>
with the URL of your backend server
If you intend to run the backend server on your local machine, then use
http://localhost:8000/api
as the backend URL
Backend
- Navigate to the
server/server
directory
cd server/server
- Create a
.env
file in the directory
touch .env
- Copy the following code and paste it in the
.env
file
DATABASE_NAME=
DATABASE_HOST=
DATABASE_PORT=
DATABASE_USER=
DATABASE_PASSWORD=
- Replace the values with the credentials of your PostgreSQL database
MacOS
- Install pnpm (Package Manager)
You can use
npm
oryarn
as well, but I have usedpnpm
npm install -g pnpm
- Install dependencies
cd client
pnpm install
- Run the development server
pnpm dev
- Open the browser and go to
http://localhost:3000
You may see an error in the browser, but don't worry, it will be fixed once the backend server is running.
Simply refresh the page once the backend server is running.
- To stop the server, Press
Ctrl + C
in the terminal where the server is running
Method 1: Using a virtual environment (Preferred)
- Install virtualenv (Skip if you have already installed it)
pip3 install virtualenv
- Create a virtual environment
cd server
virtualenv venv
- Activate the virtual environment
source venv/bin/activate
- Install dependencies
pip3 install -r requirements.txt
- Run the Django development server
python3 manage.py runserver
-
Open the browser and go to
http://localhost:8000
to verify that the server is running -
To stop the server, Press
Ctrl + C
in the terminal where the server is running -
Finally, deactivate the virtual environment by running the following command
deactivate
Method 2: Without using a virtual environment
- Install dependencies
cd server
pip3 install -r requirements.txt
- Run the Django development server
python3 manage.py runserver
-
Open the browser and go to
http://localhost:8000
to verify that the server is running -
To stop the server, Press
Ctrl + C
in the terminal where the server is running
Windows
- Install pnpm (Package Manager)
You can use
npm
oryarn
as well, but I have usedpnpm
npm install -g pnpm
- Install dependencies
cd client
pnpm install
- Run the development server
pnpm dev
-
Open the browser and go to
http://localhost:3000
-
To stop the server, Press
Ctrl + C
in the terminal where the server is running
Method 1: Using a virtual environment (Preferred)
- Create a virtual environment
cd server
python -m venv venv
- Activate the virtual environment
venv\Scripts\activate
- Install dependencies
pip install -r requirements.txt
- Run the Django development server
python manage.py runserver
-
Open the browser and go to
http://localhost:8000
to verify that the server is running -
To stop the server, Press
Ctrl + C
in the terminal where the server is running -
Finally, deactivate the virtual environment by running the following command
deactivate
Method 2: Without using a virtual environment
- Install dependencies
cd server
pip install -r requirements.txt
- Run the Django development server
python manage.py runserver
-
Open the browser and go to
http://localhost:8000
to verify that the server is running -
To stop the server, Press
Ctrl + C
in the terminal where the server is running