Skip to content

tobslob/task-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task Tracker Application

This repository contains a FastAPI backend and a React frontend. Both services can be started together using Docker Compose or separately for development.

Prerequisites

Cloning the Repository

To clone the repository and its submodule (task-tracker-frontend), run the following commands:

git clone --recurse-submodules https://github.com/tobslob/task-tracker.git
cd task-tracker

If you have already cloned the repository without the submodule, you can initialize and update the submodule with:

git submodule init
git submodule update

Running the Application with Docker

From the repository root run:

docker-compose up --build

You might likely face this sh: react-scripts: command not found after running npm start after build.

Solution

cd task-tracker-frontend
npm install
cd ../ #back to the repository root
docker-compose down
docker-compose up

The backend will be available on http://localhost:8000 and the React frontend on http://localhost:3000.

Running the Application Without Docker

Backend Setup

  1. Navigate to the backend directory:

    cd backend
  2. Create and activate a Python virtual environment (recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install Python dependencies:

    pip install -r requirements.txt
  4. Seed the database with sample data (required for first-time setup):

    python seed_db.py
  5. Start the FastAPI server:

    uvicorn app.main:app --reload

    The backend will be available on http://localhost:8000.

Frontend Setup

  1. Navigate to the task-tracker-frontend directory:

    cd task-tracker-frontend
  2. Install Node.js dependencies:

    npm install
  3. Start the React development server:

    npm start

    The frontend will be available on http://localhost:3000.

The compose configuration seeds the SQLite database on startup using seed_db.py so the app loads with sample data. On the first run it also creates a superuser defined by the environment variables SUPERUSER_EMAIL, SUPERUSER_PASSWORD and SUPERUSER_NAME (defaults are set in docker-compose.yml). If the account already exists the seeder will skip it so you can safely restart the containers.

If you need to allow additional origins for CORS, update the BACKEND_CORS_ORIGINS variable in docker-compose.yml to a JSON list, for example:

BACKEND_CORS_ORIGINS: '["http://localhost:3000", "http://localhost:3001"]'

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages