Giter Site home page Giter Site logo

tekiens-net's Introduction

Tekiens.net

Tekiens.net by Atilla, le site de la vie étudiante de CY Tech. Le but de ce site est de centraliser les informations concernant les associations et les événements de l'école.

Prérequis

Debian / Ubuntu

$ apt-get update
$ apt-get install python3 python3-setuptools python3-venv npm
$ npm install -g n
$ n stable

Installer un système de gestion de base de données :

$ apt-get install mariadb-server

ou

$ apt-get install mysql-server

Arch (btw)

pacman -S python3 npm

Installer un système de gestion de base de données (arch recommande MariaDB):

pacman -S mariadb

Nix(OS)

Installer direnv (https://direnv.net/) (optionnel)

Commandes utiles :

Commande Description
direnv allow Autorise la configuration du shell automatique
direnv reload Reload le shell
devenv shell Configure le shell (si direnv non installé)
devenv up Lance tous les processus (mysql, backend, frontend)

Installation (Non nécéssaire avec Nix + direnv)

$ cd back
$ chmod 777 data
$ python3 -m venv venv
$ venv/bin/pip install -r requirements.txt
$ cd ../front
$ npm install
$ cd ..

Mise en place de MariaDB

Installation et démarrage de MariaDB

sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
sudo systemctl enable mariadb.service
sudo systemctl start mariadb.service
sudo mariadb-secure-installation

puis suivre les étapes d'installation sécurisée de MariaDB.

Création d'un utilisateur

mariadb -u root -p
CREATE USER 'tekiens_net'@'localhost' IDENTIFIED BY '[PASSWORD]';
GRANT ALL PRIVILEGES ON tekiens_net.* TO 'tekiens_net'@'localhost';
quit

Création de la BDD

mariadb -u tekiens_net -p
CREATE DATABASE tekiens_net CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
USE tekiens_net;
SOURCE init.sql
#SOURCE sample.sql # pour un avoir des données d'exemple
SHOW TABLES;

Vous devriez avoir un résultat similaire à:

MariaDB [tekiens_net]> SHOW TABLES;
+-----------------------+
| Tables_in_tekiens_net |
+-----------------------+
| assos                 |
| events                |
| sessions              |
+-----------------------+
3 rows in set (0.001 sec)

Création du dotenv

Créer un fichier .env dans le dossier back avec les identifiants de la base de données sous la forme suivante :

DATABASE_HOST=localhost
DATABASE_USER=tekiens_net
DATABASE_PASS=supermotdepasse
DATABASE_NAME=tekiens_net

Compilation du front-end

$ cd front
$ npm run build
$ cd ..

Lancement en mode développement

$ cd back
$ venv/bin/python3 -m flask run
$ cd ..

Lancement en mode production avec Apache2

$ apt-get update
$ apt-get install apache2 libapache2-mod-wsgi-py3
$ a2enmod wsgi
$ cp apache2.conf /etc/apache2/sites-available/tekiens-net.conf
$ # edit tekiens-net.conf with your own path
$ a2ensite tekiens-net
$ service apache2 restart

Si le projet est servi par un reverse proxy, créer un fichier .env.local dans le dossier front avec le sous-chemin du projet sous la forme suivante :

VITE_BASE_URL=/sous-chemin

Échantillon de données

Pour ajouter un échantillon de données, exécuter le script sample.sql dans la base de données et copier les images du dossier back/data.sample dans le dossier back/data :

$ cp back/data.sample/* back/data/
$ chown -R www-data:www-data back/data/*

API

Voir api.md.

tekiens-net's People

Contributors

louis-grandel avatar melvi-l avatar polnio avatar ptlc2 avatar ptlc8 avatar

Stargazers

 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.