-
Notifications
You must be signed in to change notification settings - Fork 7
Setup Guide
Back End Setup Guide
-
Clone BE repository and run
yarn install --production=false
to install all required dependencies (dev environment specified for @types) -
Create Docker PostgreSQL container.
- Use
docker pull postgres:12.1-alpine
to download image.
PostgreSQL Docker image - https://hub.docker.com/_/postgres - Run image using the following command:
docker run --name ss-postgres --publish 5432:5432 postgres:12.1-alpine
(12.1-alpine is the current version as of 3.12.20.
It may be a different version now. Use the above link to check version and change run command as needed)
- Use
-
Add the following environment variables in a .env file:
PORT=4000 SALT=10 SECRET_SIGNATURE=Its a secret (example - create your own) STRIPE_API=STRIPE_KEY DATABASE_URL=postgresql://postgres:1234@localhost:5432/postgres GOOGLE_APPLICATION_CREDENTIALS='YOUR_GOOGLE_CLOUD_VISION_SERVICE_ACCOUNT_API_INFORMATION'
-
Generate, and run, a migration file using the following command:
- Note: with typeorm entities, do not generate migrations.
yarn typeorm-dev migration:run
-
Install Python dependencies
pipenv install
This will convert the requirements.txt to Pipfile and Pipfile.lock, these should be in the .gitignore and should not be uploaded to Github. -
Start backend
pipenv run yarn dev
Please follow this written tutorial to Install Python (latest version) pip and pipenv included - > https://github.com/LambdaSchool/CS-Wiki/wiki/Installing-Python-3-and-pipenv
After Installing Python open Powershell / your preferred terminal other than GitBash and ensure you receive a version response for the following commands:
$ python3 --version OR python --version
$ pipenv --version
If you receive an error message for pipenv such as the one below you will need to follow the next set of numbered sets.
pipenv : The term 'pipenv' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + pipenv install
- Run Powershell as ADMIN
- run
$ pip uninstall pipenv
then run$ pip install pipenv
- Inside of a non-ADMIN Powershell run
$ pipenv --version
to ensure it installed properly.You may now continue to run
$ pipenv install
in the repositories root directory.
- yarn dev to start the local server
- pipenv run yarn dev to start the local server in the Python virtual environment with environment variables
- yarn build to build the production version
- yarn start to start built production version
- pipenv run yarn start to start built production version with Python VE and EV. Only use this locally.
- pipenv run yarn test to start server using testing environment with Python environment variables
- yarn typorm to use typeorm CLI commands on a staging or production environment
- yarn typeorm-dev to use typeorm CLI commands on the development environment
- yarn connection to output connection information for a staging or production database