Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 48 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,61 @@
# Workwise

Workwise is a full-stack project using Django (backend) and React (frontend) with Docker for containerization.
Workwise is a full-stack productivity platform built with a Django REST backend and a React front-end. The project is containerised with Docker so you can run the entire stack locally with a single command or work on each service independently.

## Tech Stack
- Backend: Python 3.12, Django 4.2.9, DRF
- Frontend: React 18, Node 20
- Database: PostgreSQL 16
- Containerization: Docker & Docker Compose
- **Backend:** Python 3.12, Django 5, Django REST Framework, Gunicorn
- **Frontend:** React 18 with Create React App
- **Database:** PostgreSQL 16
- **Containerisation:** Docker & Docker Compose

## Local Setup
## Local Development

### Backend
### Backend (Django)
```bash
cd backend/django_app
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver
```
The backend is available at [http://localhost:8000](http://localhost:8000) and exposes a project summary at `/`.

### Frontend (React)
```bash
cd frontend/react_app
npm install
npm start
```
The React development server runs at [http://localhost:3000](http://localhost:3000) and proxies API calls to the backend when configured.

### Docker (Full stack)
```bash
docker compose -f docker-compose.dev.yml up --build
```
This command starts the backend, frontend, and PostgreSQL database together.

## Environment Variables
Create `.env.dev` and `.env.prod` files at the repository root when using Docker. They should include values similar to the following:

| Variable | Description |
| --- | --- |
| `POSTGRES_DB` | Database name for PostgreSQL |
| `POSTGRES_USER` | Username for PostgreSQL |
| `POSTGRES_PASSWORD` | Password for PostgreSQL |
| `DJANGO_SECRET_KEY` | Secret key for Django production deployments |

## Project Structure
```
workwise/
├── backend/ # Django project
├── frontend/ # React application
├── docker-compose.* # Docker compose files for dev/prod
└── README.md
```

## Testing
- Backend: `cd backend/django_app && python manage.py test`
- Frontend: `cd frontend/react_app && npm test`

Contributions and improvements are welcome! Please open an issue or submit a pull request with your ideas.
14 changes: 13 additions & 1 deletion backend/django_app/homepage/tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
from django.test import TestCase
from django.urls import reverse

# Create your tests here.

class HomepageViewTests(TestCase):
def test_homepage_returns_project_summary(self):
response = self.client.get(reverse("home"))

self.assertEqual(response.status_code, 200)
self.assertEqual(response["content-type"], "application/json")

payload = response.json()
self.assertEqual(payload["name"], "Workwise")
self.assertIn("tagline", payload)
self.assertIn("frontend", payload["links"])
5 changes: 3 additions & 2 deletions backend/django_app/homepage/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from django.urls import path

from . import views

urlpatterns = [
path('', views.home, name='home'),
]
path("", views.home, name="home"),
]
21 changes: 18 additions & 3 deletions backend/django_app/homepage/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
from django.shortcuts import render
from django.http import HttpResponse
from django.http import JsonResponse

PROJECT_SUMMARY = {
"name": "Workwise",
"tagline": "Streamlined workforce management for modern teams.",
"description": (
"Workwise combines scheduling, collaboration, and analytics tools "
"so teams can stay aligned in one workspace."
),
"links": {
"frontend": "http://localhost:3000",
"backend": "http://localhost:8000",
"documentation": "https://example.com/docs/workwise",
},
}


def home(request):
return HttpResponse("<h1>Welcome to WorkWise!</h1>")
"""Return a structured summary of the Workwise platform."""
return JsonResponse(PROJECT_SUMMARY)
74 changes: 12 additions & 62 deletions frontend/react_app/README.md
Original file line number Diff line number Diff line change
@@ -1,70 +1,20 @@
# Getting Started with Create React App
# Workwise Frontend

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
This React application provides the Workwise web experience. It surfaces the platform overview, feature highlights, and quick-start instructions for running the full stack locally.

## Available Scripts

In the project directory, you can run:
Inside `frontend/react_app` you can run:

### `npm start`
- `npm start` – starts the development server on [http://localhost:3000](http://localhost:3000).
- `npm test` – runs the component tests with Jest and React Testing Library.
- `npm run build` – bundles the app for production deployment.

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
## Connecting to the Backend
The landing page links to the Django API, which exposes a JSON project summary at [http://localhost:8000](http://localhost:8000). Update the URLs in `src/App.js` if your backend runs elsewhere.

The page will reload when you make changes.\
You may also see any lint errors in the console.
## Styling
Component styles live in `src/App.css`. The current design focuses on a clean marketing-style layout that introduces the Workwise feature set.

### `npm test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can't go back!**

If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.

You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).

### Code Splitting

This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)

### Analyzing the Bundle Size

This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)

### Making a Progressive Web App

This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)

### Advanced Configuration

This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)

### Deployment

This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)

### `npm run build` fails to minify

This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
## Testing
Tests are located in `src/App.test.js` and verify that the key Workwise messaging and feature cards render correctly.
4 changes: 2 additions & 2 deletions frontend/react_app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react_app",
"version": "0.1.0",
"name": "workwise-frontend",
"version": "1.0.0",
"private": true,
"dependencies": {
"@testing-library/dom": "^10.4.1",
Expand Down
144 changes: 122 additions & 22 deletions frontend/react_app/src/App.css
Original file line number Diff line number Diff line change
@@ -1,38 +1,138 @@
:root {
color-scheme: light;
font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
background-color: #f4f5f8;
color: #121826;
}

.App {
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
padding: 2rem 1.5rem 3rem;
gap: 3rem;
}

.App-hero {
text-align: center;
max-width: 720px;
display: flex;
flex-direction: column;
gap: 1rem;
}

.App-logo {
height: 40vmin;
pointer-events: none;
.App-label {
font-size: 0.875rem;
text-transform: uppercase;
letter-spacing: 0.2em;
color: #4b5b9a;
font-weight: 600;
}

@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
.App-hero h1 {
font-size: clamp(2.5rem, 5vw, 3.5rem);
margin: 0;
font-weight: 700;
}

.App-header {
background-color: #282c34;
min-height: 100vh;
.App-tagline {
font-size: 1.1rem;
color: #334155;
margin: 0;
}

.App-actions {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
align-items: center;
gap: 1rem;
flex-wrap: wrap;
margin-top: 0.5rem;
}

.App-button {
background: linear-gradient(120deg, #475ad7, #6f7ef7);
color: #ffffff;
padding: 0.75rem 1.75rem;
border-radius: 999px;
text-decoration: none;
font-weight: 600;
transition: transform 0.2s ease, box-shadow 0.2s ease;
box-shadow: 0 12px 24px rgba(71, 90, 215, 0.25);
}

.App-button:hover {
transform: translateY(-1px);
box-shadow: 0 14px 28px rgba(71, 90, 215, 0.3);
}

.App-link {
color: #61dafb;
font-weight: 600;
color: #475ad7;
text-decoration: none;
}

.App-link:hover {
text-decoration: underline;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
.App-content {
width: min(960px, 100%);
display: flex;
flex-direction: column;
gap: 2.5rem;
}

.Feature-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 1.5rem;
}

.Feature-card {
background: #ffffff;
border-radius: 18px;
padding: 1.75rem;
box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
display: flex;
flex-direction: column;
gap: 0.75rem;
}

.Feature-card h2 {
margin: 0;
font-size: 1.2rem;
color: #1f2a44;
}

.Feature-card p {
margin: 0;
color: #475569;
line-height: 1.55;
}

.App-cta {
background: linear-gradient(120deg, #eef2ff, #f8fafc);
border-radius: 24px;
padding: 2rem;
box-shadow: 0 15px 30px rgba(148, 163, 209, 0.25);
}

.App-cta h2 {
margin-top: 0;
font-size: 1.6rem;
}

.App-cta ol {
margin: 1rem 0 0;
padding-left: 1.25rem;
color: #334155;
line-height: 1.6;
}

.App-footer {
font-size: 0.9rem;
color: #64748b;
text-align: center;
}
Loading