Code Monkey home page Code Monkey logo

dummy_codebase's Introduction

The Indegenous Library

Entire Full stack app.

Instruction for configuring the application for Development and testing:

clone the repo:

git clone https://github.com/theindegenous-tech/TheIndegenousLibrary.git

Setting up the database:

  1. Install postgreSQL

  2. Launch the postgreSQL shell using:

sudo -u postgres psql

this will login to the postgreSQL shell as user 'postgres'

  1. Create the library database using:

CREATE DATABASE library;

  1. create the admin role:

CREATE USER admin WITH PASSWORD 'admin';

  1. The following commands sets up the database :

ALTER ROLE admin SET client_encoding TO 'utf8';

ALTER ROLE admin SET default_transaction_isolation TO 'read committed';

ALTER ROLE admin SET timezone TO 'UTC';

  1. Grant permissions to admin:

GRANT ALL PRIVILEGES ON DATABASE library TO admin;

Running the backend server:

The name of the django project is backend created using:

django-admin startproject <project_name>

  1. Launch the virtual environment the below example is using pipenv however any virtual environment package can be used:

pipenv shell

It is recommended to use a virtual environment to set up the backend application in order to avoid any dependancy issue with other applications

  1. Install all required dependencies from the requirements.txt file provided using:

pip install -r requirements.txt

  1. From root, change directory to backend:

cd backend

Prepare the models for migrations using:

python manage.py makemigrations

  1. Migrate the changes to the postgreSQL database using:

python manage.py migrate

  1. Create the django superuser for manipulating the data via GUI using:

python manage.py createsuperuser

Follow the instructions and create a super user to access django-admin.

  1. run the backend server using:

python manage.py runserver

This will run the server on port 8000

django-admin can be accessed via localhost:8000/admin

Login via the superuser credentials created in step 4

Running the frontend server:

from base directory, change directory to frontend. Then:

  1. Install the required node modules using:

npm install

  1. Start the app using npm start. This will host the app on port 3000.

  2. access the website at localhost:3000

If all steps were followed and no errors were encountered, the app should be configured for development and testing.

Steps for starting the Backend server for the first time:

  1. comment out lines in backend/the_indegenous_backend/api/views : 9->17 and 65->89
  2. Follow steps 1 to 5 as usual. Reason: The code for the trie tree involves getting all the books and creating the datastructure for searching the books. This seems to run before the migrations of the models to the database thus interfering with the migration process. Upon completing the migration it should be uncommented to resume normal functionality.

dummy_codebase's People

Contributors

jagrit-indegenous avatar gwynbleidd27 avatar orb-277 avatar theindegenous-tech avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.