Code Monkey home page Code Monkey logo

carpoolear_backend's Introduction

Carpoolear backend

Carpoolear es la primera aplicación argentina de Facebook que permite a los usuarios de dicha red social compartir viajes en automóvil con otros usuarios de su entorno.

Es una customización ad-hoc para Argentina de la filosofía carpooling, la cual consiste en compartir nuestros viajes en auto con otras personas de forma cotidiana. El carpooling es una práctica popular en Estados Unidos y Europa, donde se realiza de manera organizada para lograr aumentar el número de viajes compartidos y que estos sean concretados con otras personas además de nuestros vecinos y amigos.

Carpoolear on Docker

  1. Depending on your operating system, you may need to add permissions to these folders:

    sudo chmod 777 -R storage/
    sudo chmod 777 -R public/
  2. Building and running docker images:

    docker-compose up

    NOTE: if you have trouble running Docker, try removing the composer-install y database-seed-and-migrate sections from docker-compose.yml and trying again.

  3. Set your .env (use .env.example as an example)

  4. (OPTIONAL: only if you removed composer-install y database-seed-and-migrate from docker-compose.yml in a previous step). Go to Docker UI, go to the carpoolear_backend container, enter the Terminal for that container, and execute the following commands:

    1. composer update
    2. php artisan migrate
    3. php artisan db:seed --class=TestingSeeder
    4. php artisan config:clear
    5. php artisan georoute:build
  5. Now start your frontend and enjoy carpoolear!

Docker compose file: You can start a develop environment with just one command with docker-compose:

docker-compose up -d

docker-compose.yml:

version: '2'

services:
  carpoolear_db:
    image: mysql
    container_name: carpoolear_db
    environment:
      MYSQL_DATABASE: carpoolear
      MYSQL_USER: carpoolear
      MYSQL_PASSWORD: carpoolear
      MYSQL_ROOT_PASSWORD: carpoolear
    volumes:
      - ./.db:/var/lib/mysql
    networks:
      - esnet 

  carpoolear_backend:
    build: ./backend
    container_name: carpoolear_backend
    environment:
      APP_ENV: local
      APP_DEBUG: "true"
      SERVER_PORT: 8080
      DB_HOST: carpoolear_db
      DB_DATABASE: carpoolear
      DB_USERNAME: carpoolear
      DB_PASSWORD: carpoolear
      APP_KEY: qwertyuiopasdfghjklzxcvbnm123456
      JWT_KEY: qwertyuiopasdfghjklzxcvbnm123456
      API_PREFIX: api
      API_VERSION: v1
      MAIL_DRIVER: log
    ports:
      - 8080:8080
    volumes:
      - ./backend:/app
    networks:
      - esnet 
networks:
  esnet:  

Start coding (old way)

Clone repository (remember to make your own fork)

git clone https://github.com/STS-Rosario/carpoolear_backend.git

Install dependencies

composer install

Configure the database access in the .env file

cp .env.example .env

Generate laravel key

php artisan key:generate

Give read/write access to the storage folder

chmod -R ugo+rw storage/

Generate the database

php artisan migrate

You will need to use a local webserver and point it to the public folder

Happy coding!

Contributing

Troubleshooting

[PDOException] - SQLSTATE[HY000] [2002] No such file or directory
  • check if the mysql server is running
  • change your .env file to DB_HOST=127.0.0.1 instead of localhost
[PDOException]                                                                          
PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password]
  • create or alter your mysql user to use mysql_native_password
create user username@localhost identified with mysql_native_password by 'password';
alter user 'username'@'localhost' identified with mysql_native_password by 'password';

License

The Carpoolear backend is open-sourced software licensed under the GPL 3.0.

carpoolear_backend's People

Contributors

adalessandro avatar agustinramirodiaz avatar fernandolguevara avatar fpfarina avatar gonzalogm avatar iagoq avatar kamdjouduplex avatar laravel-shift avatar liquid36 avatar martinacostadev avatar miguelbalparda avatar p4bl1t0 avatar rodrigomed avatar stsrosario avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

carpoolear_backend's Issues

Configure Github Actions

Hola equipo,

Vi la convocatoria para programadores para ayudar a mejorar el proyecto. Aunque actualmente no trabajo con PHP, tengo mucha experiencia en desarrollo y configuration, testing, y ayudar en proyectos open source, etc. Les voy a abrir algunos issues para ayudar a coordinar un poco. Si me dan mas autorizaciones puedo hacer triage, cambiar Settings de Github para que sea mas facil que otros programadores se sumen.

TODO

Hay que configurar Github Actions o minimo cualquier CI. Veo que hay un config de Circle. Se podria usar o empezar de cero. Minimamente deberian de correr tests.

Turn on Github dependabot

To stay on top of dependency changes and security updates, we should turn on dependabot on this repo just like the other carpoolear repo. This must be done by maintainers or contributors with sufficient Github permissions to update the repo.

Help on how to enable it is here

I'm certain there will be dependency updates that we won't be able to update immediately because they would break everything. As such, it's imperative this issue isn't completed until Github Actions / CI testing is enabled.

Ir y volver en el mismo dia: user_has_another_similar_trip

Suelo viajar y volver de rosario a bs as en el mismo dia y cuando quiero volver nunca puedo solicitar viaje...
Indagando en el codigo veo que esta relacionado con "user_has_another_similar_trip" , supongo que no se estaria haciendo distincion entre el destino y origen entre un viaje y otro

SI nadie lo resuelve planeo verlo yo mas adelante

Could you share subscription service code as well?

Hi,
Thanks for sharing the code.
I loved the code :) and looking to implement something similar. However, when I click on subscribed on my local, it says end point missing. Could you please share subscription backend code as well?
Also, since it is open source, can I use your source code for personal/commercial purpose?
Thanks

Cordova Problem

Hi when i try to add android to cordova show 'Current working directory is not a Cordova-based project.'

there is a diferent brand to use ?

db migration problem

lately, I'm getting the following when I try to migrate the database

  SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'last_connection' (SQL: ALTER TABLE users CH
  ANGE nro_doc nro_doc VARCHAR(15) DEFAULT NULL COLLATE utf8_unicode_ci, CHANGE description description VARCHAR(1000) DEFAULT NU
  LL COLLATE utf8_unicode_ci, CHANGE mobile_phone mobile_phone VARCHAR(50) DEFAULT NULL COLLATE utf8_unicode_ci, CHANGE image im
  age VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, CHANGE banned banned TINYINT(1) DEFAULT '0' NOT NULL, CHANGE is_admin i
  s_admin TINYINT(1) DEFAULT '0' NOT NULL, CHANGE active active TINYINT(1) DEFAULT '0' NOT NULL, CHANGE last_connection last_con
  nection DATETIME DEFAULT 'CURRENT_TIMESTAMP' NOT NULL, CHANGE has_pin has_pin TINYINT(1) DEFAULT '0' NOT NULL, CHANGE is_membe
  r is_member TINYINT(1) DEFAULT '0' NOT NULL, CHANGE monthly_donate monthly_donate TINYINT(1) DEFAULT '0' NOT NULL)


Unable to access "/app/trip "application on local installation

I installed the source code "carpoolear_backend" locally following the instructions.
The home page is displayed at http: //carpoolear.local.
However, when I try to access the link http: //carpoolear.local/app/trip, a message "File does not exist at path ...\carpoolear_backend\public\app\index.html".
Indeed, this file does not exist in the "public/app" directory.
Could you provide it?

Error in localhost

Hi,

when I put in htacess :
Header set Access-Control-Allow-Origin "*"

I have many error like this in console :
/api/trips?is_passenger=false&page=1&page_size=20 500 (Internal Server Error)
/api/users/my-trips?as_driver=false 500 (Internal Server Error)
/api/users/requests 500 (Internal Server Error)

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.