Skip to content

akshay/CryptoWealth

Repository files navigation

Build Status

CryptoWealth

Table of Contents

Setup

Dependencies

Instructions

  • Clone the repository and change directory to it.

  • Set up Python virtual environment. Also make sure that your working directory has no spaces in it.

python3 -m pip install virtualenv
python3 -m virtualenv env

How to run

Running on your own environment

At all times, make sure you are in Python virtual environment: (Linux/Mac) source env/bin/activate (Windows) env\Scripts\activate

Do the following only once:

  • Install back-end dependencies: python3 -m pip install -r base-requirements.txt

  • Set up front-end dependencies: npm run global-install && npm install

  • Set up database: (Mac/Linux: do createdb -h localhost && ./init-user-db.sh, Windows: do the steps in init-user-db.sh manually)

To run, you need two terminals.

  1. npm run dev

  2. (Make sure this one is in the virtual environment) ./run-django.sh

Server will be visible, by default, on port 8000 on localhost. It will auto-refresh whenever you change a relevant file.

Accessing the database

The database can be accessed @localhost:5433

  • psql -h localhost -p 5433 -U crypto crypto_dev

Contributing

Analysis

To make sure the code respects all coding guidelines you should run the static analysis before pushing any code.

Frontend (javascript analysis): npm run lint

Backend (django/python analysis): npm run analyze

Adding libraries

You must add to base-requirements.txt whenever adding a new Python package.

You must run npm i --save <package> whenever you add a new NPM package.

Git Respository Best Practices

(Note: These are necessary due to quirks of contribution graphs)

  • Always work in your own fork of the repository.

  • Create a different branch for the issue you are working on off your master branch like git checkout -b feature-name.

  • Whenever you begin work, be sure to git pull --rebase upstream master.

  • When you have completed, squash your commits into a max of 3-5 commits and git push origin feature-name.

  • Issue a PR to the master branch on the central repository. (If you issue a PR to another branch, your contributions may not be counted!)

  • In case you have a PR pending on this branch, checkout to your local master branch, checkout another feature branch and work there.

Directory Structure

.
├── package.json                                     <- Package info for NPM. Contains front-end libraries (JS/JSX) and convenient scripts.
├── .babelrc, .bootstraprc, .eslintrc, .gitignore    <- Configuration settings for Babel (JS/ES6 transpiler), Bootstrap (front-end library), ESLint (JS code analyzer) and Git respectively
├── .prospector.yml, .sass-lint.yml, .travis.yml     <- Configuration settings for Prospector (Python code analyzer), SASS Lint (CSS/SASS analyzer) and Travis CI (automated test runner) respectively
├── Procfile, runtime.txt                            <- Configuration settings for Heroku (hosting platform)
├── base-requirements.txt                            <- Base environment packages for Python (Django back-end).
├── requirements.txt                                 <- Production environment packages for Python (Django back-end).
├── init-user-db.sh                                  <- Initialization script for PostgreSQL.
├── run-django.sh                                    <- Shell script to run Django back-end.
├── webpack
│   ├── dev.config.js                                <- Development configuration for Webpack (bundles and pre-processes front-end files).
│   └── prod.config.js                               <- Production configuration for Webpack.
└── src
    ├── manage.py                                    <- Runs important Django commands such as setting up database and running server.
    ├── crypto                                       <- Main project folder for back-end.
    │   ├── urls.py                                  <- **All routes performed from the back-end**
    │   ├── wsgi.py                                  <- Initialization script.
    │   ├── utils.py                                 <- Helpful classes and methods.
    │   └── settings                                 <- **Settings and libraries used by the back-end**
    ├── base                                         <- Example of how to extend the back-end API.
    ├── accounts                                     <- An example of how to implement a feature. This organizes all code in the back-end related to accounts and authentication.
    │   ├── models.py                                <- Models for accounts. All the fields here will be inserted as-is into the database. Methods for models can also be defined.
    │   ├── serializers.py                           <- Connects the view to the model by serializing or formatting any data.
    │   ├── urls.py                                  <- Routes related to accounts API.
    │   └── views.py                                 <- Viewset for the accounts. Note that actually these don't need to be graphic templates per se, but rather just what happens when you navigate to a route.
    └── static                                       <- **Front-end files**

Further reading

Frontend

Backend

About

Cryptocurrency investments simplified.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •