Giter VIP home page Giter VIP logo

file_system's Introduction

file_system


  1. I was unable to create a CLI for webpage so frontend won't work. However, backend is fully operational. To test, use POSTMAN to make call to http://127.0.0.1:8000/ with appropriate request according to link after sunning backend.

file system backend

  1. Install postgreSQL from https://www.postgresql.org/download/

  2. Add PostgreSQL/[version, either 12 or 13]/bin and PostgreSQL/[version, either 12 or 13]/lib to PATH (on Windows) or make it an environment variable on Mac/Linux.

  • To make environment variable use the following command
export POSTGRES_HOME=/Applications/Postgres.app/Contents/Versions/latest
export PATH=$POSTGRES_HOME/bin:$PATH
  • Confirm installation
psql --version
  1. Setup your local POSTGRES database.
  1. Connect local POSTGRES database to Django application.
  • Navigate to ./file_system_backend/file_system_backend/ directory and add a .env file with the following environment variables: environment variables
  1. Install dependencies.
  • Navigate to ./file_system_backend/ directory and run the following command
pip install -r requirements.txt
  1. Apply migrations to your local DB.
  • Navigate to ./simulator_backend/ directory and run the following command:
python manage.py migrate
  1. Run server.
python manage.py runserver
  1. You can now interact with our API by making the appropriate API calls.
  • Checkout this link for API documentation.

If you run into errors with Postgres, it will be helpful to drop the Postgres database and start from scratch:

  1. Login as a postgres superuser with the following command and type in the superuser's password(created when you first installed Postgres) when prompted.
psql --u postgres
  1. Drop simulator_backend database and create it again.
DROP DATABASE <database name>;
CREATE DATABASE <database name>;
  1. Grant all privileges to your postgres user.
GRANT ALL PRIVILEGES ON DATABASE <database name> TO <username>;
  1. Exit postgres command line.
\q
  1. Continue from Step 6 above(Apply migrations to your local DB).

file system frontend

  1. Make sure backend is running

file system CLI syntax:


All path must be absolute path to folder/file and must end with '/' in the end. For instance:

  • a valid path for FOLDER is for folder name 'root or <root/folder/> for folder name 'folder' inside 'root' folder.
  • a valid path for FILE is <root/file/> for file name 'file' in 'root' folder

  1. create filde/folder
  • format: cr [PATH] [DATA]
  • [PATH] is required but [DATA] is optional. If [DATA] is provided, server will create a file, otherwise, server will create a folder.
  • example:
    • for folder: cr root_folder/
    • for file: cr root/file/ this is a file
  1. cat file
  • format: cat [FIlE PATH]
  • [FILE PATH] is required.
  • example:
    • cat root/file/
  1. list folder
  • format: list [FOLDER PATH]
  • [FOLDER PATH] is required.
  • example:
    • list root/
  1. move folder/file
  • format: mv [PATH] [NEW DIRECTORY PATH]
  • [PATH] and [NEW DIRECTORY PATH] are required.
  • example:
    • moving folder to folder_1: mv root/folder/ root/folder_1/
  1. remove folder/file
  • format: rm [PATH]
  • [PATH] is required.
  • example:
    • rm root/folder/
  1. update folder/file
  • format: up [PATH] [NEW NAME] [DATA]
  • [DATA] is optional but [PATH] and [NEW NAME] are required. If [DATA] is provided, server will update a file, otherwise, server will update a folder or file depends on the [PATH].
  • example:
    • for file with no new data: up root/file/ file_new
    • for file with new data: up root/file/ file_new this is a test for move
    • for folder: up root/folder/ folder_new

file_system's People

Contributors

vdlphm avatar

Watchers

 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.