Skip to content

Latest commit

 

History

History
284 lines (178 loc) · 4.84 KB

SETUP.md

File metadata and controls

284 lines (178 loc) · 4.84 KB

Loggsy Setup Guide

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

Node.js (Frontend)

I've also mentioned the Exact version used in development

Python (Backend)

I've also mentioned the Exact version used in development

Clone the repository

You can also download the repository as a zip file and extract it

  • Clone the repository
git clone https://github.com/McTechie/loggsy/loggsy

Setting up the environment variables

Frontend
  • Rename the .env.example file to .env.local file in the client 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

Frontend

  • Install pnpm (Package Manager)

You can use npm or yarn as well, but I have used pnpm

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

Backend

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

Frontend

  • Install pnpm (Package Manager)

You can use npm or yarn as well, but I have used pnpm

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


Backend

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