Skip to content

mmmohajer/aplus

Repository files navigation

Setup:

  1. Setup Development environment:

    • Clone the repository

    • SETUP ON MAC/Linux:

    1. Got to root folder and run ./automation.sh in terminal
    2. Choose Option 1 --> Make initial setup on Mac/Linux
    • SETUP ON WINDOWS:
    1. Create a python virtual env: python -m venv venv
    2. Activate virtual environment --> venv\Scripts\activate
    • pip install --upgrade pip
    • pip install -r api/requirements-windows-local.txt
    • Go to api folder and run python manage.py collectstatic
    • Go to client folder and run npm install
    • Go to root folder and run ./automation.sh in terminal
    • Choose Option 2 --> Make initial setup on Windows

    Then, Do the following part, in ordet to be able to use docker in your development environment:

    1. Go to the root folder and run docker-compose -f docker-compose-dev.yml up --build -d

Note:
You might need to change the database name and database password in /api/config folder and env variables inside /config folder.

Note: In order to use celery with your application put USE_CELERY=1 in the environment variables.

Note: In order to send activation email after registration, put SEND_ACTIVATION_EMAIL=1 in the environment variables.


  1. Test production environment on your local PC:
    • Run docker-compose -f docker-compose-prod.yml up -build -d

  1. Test performance of production environment on your local PC:
    • Run following commands:
      docker-compose -f docker-compose-prod.yml up -build -d
      cd api
      locust -f locustfiles/browse_api.py

  1. Setup Production environment:

    • Create the following subfolders:
      ./api/vol/static/
      ./api/vol/media/
    • Go to root folder and run ./automation.sh in terminal
    • Choose Option 7 --> Copy environment variables in server
    • Then you need to add ssl config to your domain, so take the following steps:
    1. Create following subfolders:
    • ./nginx/certbot/conf/

    • ./nginx/certbot/www/
      2.docker-compose -f docker-compose-createSSL.yml up --build -d
      3.And then change domains and email in init-letsencrypt.sh
      4.Then run ./init-letsencrypt.sh

    • Now your app is ready to be run on server: To do so, first clear all volumes, images, and containersof docker, useing the following 3 commands:

    1. Run docker container rm -f $(docker container ls -a -q)
    2. Run docker image rm -f $(docker image ls -a -q)
    3. Run docker volume prune
    • Now everything is ready for your app to be served:
      Run docker-compose -f docker-compose-prod-ssl.yml up --build -d

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published