/CIS-front

Site public du carrefour des innovations sociales

Primary LanguageJavaScriptMIT LicenseMIT

SOCIAL CONNECT
-alias-
CARREFOUR DES INNOVATIONS SOCIALES


PRESENTATION

The official website for the project SocialConnect / aka (in French) Carrefour des Innovations Sociales


alt text


INSTALLATION WALKTHROUGH

LOCALLY

  1. clone or download the repo

  2. install MongoDB locally or get the URI of the MongoDB you're using

  3. go to your cis folder

  4. use Python 2

  5. install python pip and virtualenv

     $ sudo apt install python-pip
     $ sudo apt install virtualenv
    
  6. install a virtual environment

     $ virtualenv venv
    
  7. install the libraries

     $ sudo pip install -r requirements.txt
    
  8. if you encounter problems installing the requirements try to install the 'cryptography' library following those steps : [install crypto]

     $ pip install cryptography --global-option=build_ext --global-option="-L/usr/local/opt/openssl/lib" --global-option="-I/usr/local/opt/openssl/include"
    
  9. update the app/backend/config_secret_vars_example.py file with your mongoDB URI (if you're not using default mongoDB connection)

  10. got to your /cis folder and run :

     $ python run_cis_front.py --mode=testing
    
  11. Install Node.js and npm

  12. Build the front-end

     $ cd cis/app/frontend
     $ npm install
     $ npm run build
    
  13. (if you encounter problems while building try this)

     $ rm -rf cis/app/frontend/node_modules
     $ npm install 
     $ npm run build
    
  14. check in your browser at localhost:8100

PRODUCTION

  1. get a server - check digital ocean, OVH, ...
  2. optionnal : get a domain name : check OVH, namecheap, godaddy.... + setup DNS
  3. follow (most of) these instructions
  4. create a app/backend/config_secret_vars_prod.py file based on config_secret_vars_example.py structure
  5. go to app folder and create a virtual env (for instance called "venv")
  6. set up the gunicorn service and NGINX accordingly
  7. ... pray for all that to work as expected, and keep calm...

PRODUCTION : update code and deploy

cd /<your_app_folder>/<username>/app_cis/cis
git pull origin master
cd app/frontend
npm ci
npm run build
sudo systemctl restart cis_front

Creating the first admin account

Go to /register, create an account, then:

# Connect to MongoDB
mongo
# => mongo shell prompts

# Use cis-front database
use cis_front

# list users
db.users.find()

# get the id of the user you want to move to admin
# abcdef

# Modify user
db.users.updateOne({_id: ObjectId('abcdef')}, {$set: {userAuthLevel: 'admin'}})

Then, you can login with your admin user which can change settings of other users


TECHNICAL POINTS

Tech stack


CREDITS

OpenScraper's team thanks :

Contacts - maintainance :


SCREENSHOTS (development)

landing page

alt text



login

alt text



register

alt text



home for connected user

alt text



search engine for connected user

alt text



backoffice to manage users

alt text



backoffice to manage feedbacks

alt text