Skip to content

Installation

Nithin_Kamineni edited this page Apr 20, 2022 · 1 revision

Guide

To set this project and run it. Clone the repo to your local environment using the following command.

git clone https://github.com/Nithin-Kamineni/peekNshop.git

FrontEnd

To run the frontend angular application you need to have node js installed in your environment.

To check if you already have Node js use the following command in your terminal: node -v and npm -v

The -v command results in the version of node or npm installed on your system if you have a version number that means you already have node installed. if you have an error then please install node js from here.

Once you have node js go to the directory where you cloned this project then use the following commands:

cd client

This command below installs all the packages and sets up create react app

npm install

After the installation is complete use the command.

ng serve

To run the cypress tests, use the command below.

./node_modules/.bin/cypress

To run the unit tests, use the command.

npx cyprus run

This starts a local server that hosts the react application at localhost:4200.

Backend

Backend is developed in GoLang ( version 1.17.6) and SQLite in-memory relational database is used to persist the data. MUX framework is used for performing http operations and GORM library is used for object relational mapping.

Pre-requisites

Golang(preferably 1.17.6) and GCC(for Windows based systems) should be installed. SQLite is included in macOS and Mac OS X by default. It is located in the /usr/bin directory and is called sqlite3. SQLite should be installed on Windows based system

Starting the server

Navigate to the backend folder in the project setup and run the command go get . . This makes sure all the dependancies required are downloaded. Then issue the command go run main.go to start the server on port 8080 by default.

To download the GORM and sqlite driver manually, run the command go get -u gorm.io/gorm followed by go get -u gorm.io/driver/sqlite

Running the project

Step 1: Introduction and Environment Setup for GoLang (Windows & Mac)

Step 2: Angular Project Setup in Visual Studio Code

Step 3: Arrange the files according to the file paths given below

  • peekNshop
    • client

      go to client and run "npm i" t install all npm libraries

      • api

      run the cleint using command "ng serve" to launch cleint side webite

      • src

      visit http://localhost:4200/ to view the project

    • server

      install go

      • bin
      • controllers
      • models
      • pkg
      • src
      • utils
      • main.go

      run main.go file using "go run main.go" in termianal in the directory of server

      • Users.db
Clone this wiki locally