Skip to content

Aviat-at/workwise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Workwise

Workwise is a simple full-stack starter that pairs a Django backend with a React frontend. It demonstrates containerized development with Docker and Docker Compose while providing a minimal landing endpoint and a ready-to-run React scaffold.

🚀 Features

  • Django 5 backend with a basic homepage view wired through project URLs.
  • React 19 frontend scaffold generated by Create React App.
  • Dockerfiles for backend and frontend plus development and production Docker Compose stacks.
  • PostgreSQL service wired into the Compose configurations for database-backed deployments.

🏗️ Architecture Overview

The project is split into backend and frontend services that can run locally or via Docker Compose:

  • Backend (backend/django_app): Standard Django project (core) with a homepage app that renders a welcome message. Uses SQLite by default but Docker Compose provisions PostgreSQL.
  • Frontend (frontend/react_app): Create React App scaffold with default assets and tests. Runs on Node 20.
  • Containerization: Each service has its own Dockerfile. Docker Compose files orchestrate backend, frontend, and PostgreSQL for development (docker-compose.dev.yml) and production (docker-compose.prod.yml).

🛠️ Tech Stack

  • Backend: Python 3.12, Django 5.2, Django REST Framework (installed), Gunicorn.
  • Frontend: React 19, React Scripts 5, Jest/React Testing Library.
  • Database: PostgreSQL 16 via Docker Compose (SQLite used by default in settings).
  • Tooling: Docker, Docker Compose.

📂 Project Structure

workwise/
├── backend/
│   ├── Dockerfile
│   └── django_app/
│       ├── core/
│       │   ├── settings.py
│       │   ├── urls.py
│       │   └── wsgi.py
│       ├── homepage/
│       │   ├── urls.py
│       │   └── views.py
│       ├── manage.py
│       └── requirements.txt
├── docker-compose.dev.yml
├── docker-compose.prod.yml
├── frontend/
│   ├── Dockerfile
│   └── react_app/
│       ├── package.json
│       ├── public/
│       └── src/
└── README.md

⚙️ Installation

Backend

  1. Navigate to the backend directory and create a virtual environment:
    cd backend/django_app
    python -m venv .venv
    source .venv/bin/activate
  2. Install dependencies:
    pip install -r requirements.txt
  3. Apply migrations and start the server:
    python manage.py migrate
    python manage.py runserver

Frontend

  1. Install Node.js 20+.
  2. Navigate to the React app and install dependencies:
    cd frontend/react_app
    npm install
  3. Start the development server:
    npm start

🔑 Environment Variables

The Compose files expect environment files (.env.dev, .env.prod) at the project root. Common variables you may need:

POSTGRES_DB=workwise
POSTGRES_USER=workwise
POSTGRES_PASSWORD=workwise
POSTGRES_HOST=db
POSTGRES_PORT=5432
DJANGO_DEBUG=True
DJANGO_SECRET_KEY=replace-me

When running locally without Docker, the Django settings default to SQLite and do not require database environment variables.

▶️ Running the App

  • Local (without Docker):
    • Backend: activate the virtual environment and run python manage.py runserver from backend/django_app.
    • Frontend: run npm start from frontend/react_app and open http://localhost:3000.
  • Docker Compose (development):
    docker-compose -f docker-compose.dev.yml up --build
  • Docker Compose (production-style):
    docker-compose -f docker-compose.prod.yml up --build

🧪 Testing

  • Backend:
    cd backend/django_app
    python manage.py test
  • Frontend:
    cd frontend/react_app
    npm test

🐳 Docker / Kubernetes

  • Backend Dockerfile builds a multi-stage image with dependencies baked in and runs Gunicorn (adjust WSGI module if your project module changes).
  • Frontend Dockerfile installs dependencies and runs the React development server (or npm run build in production Compose).
  • Development and production Compose files wire backend, frontend, and PostgreSQL containers.
  • Kubernetes manifests are not provided.

🔗 API Endpoints

Method Path Description
GET / Returns a simple "Welcome to WorkWise!" HTML response from the homepage view.
GET /admin/ Django admin interface (requires superuser).

📦 Deployment

  • Build and run the production stack with Docker Compose:
    docker-compose -f docker-compose.prod.yml up --build
  • The backend Docker image starts Gunicorn bound to 0.0.0.0:8000; ensure the WSGI module path matches the Django project (update CMD if needed).

🧭 Roadmap / Future Improvements

  • Configure Django settings to read database credentials from environment variables and enable PostgreSQL in non-Docker runs.
  • Replace the placeholder React UI with application-specific pages and integrate it with backend APIs.
  • Add REST endpoints using Django REST Framework and document them with an OpenAPI/Swagger spec.
  • Add CI workflows for linting, testing, and image builds.

📄 License

No explicit license provided in the repository.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors