Skip to content

perfettiful/TaskHola

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TaskHola Logo

License Version Docker

Description

TaskHola is a simple task manager mobile application built with the Django REST Framework and Expo React Native framework. It allows users to create, retrieve, update, and delete tasks. The application is built using the following technologies:

  • Docker Docker for containerization
  • PostgreSQL PostgreSQL as the database
  • Django Django REST Framework for the backend RESTful API
  • Expo Expo with React Native for a cross-platform mobile app
  • Grafana Grafana for monitoring and database management

Installation

Prerequisites

  • Docker and Docker Compose
  • Node.js and npm
  • Expo CLI
  • EAS CLI
  • iOS Simulator or Android Emulator

React Native App Setup

  1. Clone the repository:

    git clone https://github.com/perfettiful/TaskHola.git
    cd TaskHola/taskhola-mobile
  2. Install dependencies:

    npm install
  3. Install EAS CLI:

    npm install -g eas-cli
  4. Configure EAS:

    eas build:configure
  5. Run the app:

    npm run start:dev
  6. Run tests:

    npm run test
  7. Create a Production Build:

    npm run build

Django Backend Setup with Docker

  1. Navigate to the backend directory:

    cd TaskHola/taskhola-backend
  2. Copy the example environment file:

    cp .env.example .env
  3. Fill in Desired Credentials for .ENV Variables:

       PROJECT_NAME=
    
       GRAFANA_CONTAINER_NAME=
       GRAFANA_PORT=3000
       GF_SECURITY_ADMIN_USER=
       GF_SECURITY_ADMIN_PASSWORD=
    
       POSTGRES_CONTAINER_NAME=
       POSTGRES_PORT=5432
       POSTGRES_USER=
       POSTGRES_PASSWORD=
       POSTGRES_DB=tasks_db
  4. Build and run the Docker container:

    docker-compose up --build
  5. Access the Django API:

    • The Django Admin panel will be available at http://localhost:8000/admin
      • Username: set in .env file
      • Password: set in .env file
    • The REST API docs will be available at http://localhost:8000/api/tasks

Accessing Grafana Locally

  1. To access Grafana locally, open your web browser and navigate to: http://localhost:3000

  2. The default login credentials are:

    • Username: set in .env file
    • Password: set in .env file

React Native App Production Setup

  1. Login and Configure Expo Account on Expo

  2. Generaate a Production Build:

  • Run npm run build to create a production build
  1. Ensure you have your environment variables set for production.

    • deploy-exp.yml workflow uses SSH for deployment, ensure you have the following secrests set in your Github repository:
    • EXPO_TOKEN
  2. Deploy the Production Build:

    • Deploy on trigger using deploy-exp.yml workflow
  3. Access the Production Build in Expo Dashboard:

Backend Production Setup

  1. Provision your choice of Virtual Private Server (VPS)

  2. Configure Firewall and Security Groups for SSH and HTTP/HTTPS

  3. Ensure you have your environment variables set for production.

    • deploy-api.yml workflow uses SSH for deployment, ensure you have the following secrests set in your Github repository:
    • SERVER_HOST
    • SERVER_USER
    • SERVER_PASS
  4. Use a reverse proxy (like Caddy or Nginx) to serve your application.

       monitor.taskhola.app {
          reverse_proxy grafana:3000
       }
    
       api.taskhola.app {
          reverse_proxy web:8000
       }
  5. Build the Docker images for production on Github Actiuon Trigger: deploy-api.yml

  6. Configure DNS recordss for your domain/ subdomains:

Contact & Connect


About

Full Stack iOS Expo app implementation with Django Backend and Grafana monitoring. Live REST API docs:

Resources

Stars

Watchers

Forks