Coder Social home page Coder Social logo

taxi-app's Introduction

START PROJECT FOR TESTING(FULLY DOCKERIZED):

NOTE THAT client/cypress.json should point to dockerized client through dockerized nginx: "baseUrl": "http://localhost:8080" NOTE THAT taxi-server in docker-compose.local.yml should point to test.env file for testing with cypress

  • ~$ git clone https://github.com/jonndoe/taxi-app.git

  • ~$ cd taxi-app

  • ~/taxi-app$ sudo docker-compose -f docker-compose.local.yml up --build

  • ~/taxi-app$ sudo docker-compose -f docker-compose.local.yml exec taxi-server python manage.py migrate

  • ~/taxi-app$ sudo docker-compose -f docker-compose.local.yml exec taxi-server python manage.py test trips.tests

  • ~/taxi-app$ cd client/

  • ~/taxi-app/client$ npx cypress open

check if db tables exists:

  • ~/taxi-app$ sudo docker-compose -f docker-compose.local.yml exec taxi-database psql -U taxi

START PROJECT FOR DEVELOPMENT( with dockerized postgres and dockerized redis ):

NOTE THAT client/cypress.json should point to NOT dockerized client: "baseUrl": "http://localhost:3000" NOTE THAT taxi-server in docker-compose.local.yml should point to test.env file for testing with cypress

  • ~$ git clone https://github.com/jonndoe/taxi-app.git

  • ~$ cd taxi-app

  • ~/taxi-app$ sudo docker-compose -f docker-compose.postgres.redis.yml up

  • ~/taxi-app/server$ python taxi/manage.py migrate

  • ~/taxi-app/server$ python taxi/manage.py runserver

  • ~/taxi-app/client$ npm start

  • ~/taxi-app/client$ npx cypress open

SOME NOTES:

To reset the database, start by running the following command in your terminal, while your Docker containers are running:

  • $ docker-compose exec taxi-database psql -U taxi -d test

Then run the following command to delete the users and their related data:

  • TRUNCATE trips_user CASCADE;

  • ~/taxi-app$ sudo docker-compose -f docker-compose.local.yml exec taxi-server python taxi/manage.py createsuperuser

RUNNING THE POSTGRES DATABASE LOCALLY ON DOCKER (EXAMPLE 1)

  1. Install docker image postgres:11

  2. Start a docker container with that postgres image. $ sudo docker run --rm --name pg-docker -e POSTGRES_PASSWORD=docker -e POSTGRES_DB=somebase -e POSTGRES_USER=docker -p 5432:5432 -v $home/docker/volumes/postgres:/var/lib/postgresql/data postgres:11

  3. Create a databe with name 'everycheese' in potgresql $ createdb -h localhost --username=docker everycheese

  4. SET env variable directly to the system: $ export DATABASE_URL=postgres://docker:[email protected]:5432/everycheese

  5. $ pip install -r requirements.txt

  6. $ python manage.py migrate

RUNNING THE POSTGRES DATABASE LOCALLY ON DOCKER (EXAMPLE 2)

  1. Run docker-compose to up postgres and redis:

    $ sudo docker-compose -f docker-compose.postgres.redis.yml up --build

  2. Connect to postgresql container to check if it works:

    $ psql -h localhost -p 5432 -d docker -U docker --password

taxi-app's People

Contributors

jonndoe avatar dependabot[bot] avatar

Stargazers

rmpythoncode avatar Chinmay Dali avatar

Watchers

James Cloos avatar AmrElsayedEG avatar Ismael Grebo avatar  avatar

Forkers

chinmay-395

taxi-app's Issues

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.