A full-stack project with a Django backend and a React frontend, orchestrated with Docker. This project enables efficient task management using SQLite as the database and includes containerized services for streamlined deployment.
- Project Structure
- Technologies Used
- Setup and Installation
- Running the Application
- Testing
- API Endpoints
- Environment Variables
DetalBee_HomeTask/
├── dailynotes_api/ # Django backend
│ ├── authentication/ # Authentication module
│ ├── notes/ # Notes application logic
│ ├── media/ # Uploaded media files
│ ├── DockerFile # Dockerfile for the backend
│ ├── db.sqlite3 # SQLite database
│ ├── requirements.txt # Backend dependencies
│ └── manage.py # Django project entry point
├── dailynotes-ui/ # React frontend
│ ├── src/ # React source files
│ ├── DockerFile # Dockerfile for the frontend
│ ├── package.json # Frontend dependencies
│ └── build/ # Build files (after running npm build)
├── docker-compose.yml # Docker Compose configuration
└── README.md # Project documentation
- Django: Python framework for the backend API.
- SQLite: Lightweight database for local development.
- pytest: Testing framework for the backend.
- React: JavaScript library for building the user interface.
- Tailwind CSS: Utility-first CSS framework for styling.
- Docker: Containerization for the backend and frontend.
- Docker Compose: Simplified multi-service orchestration.
- Install Docker: Get Docker
- Install Node.js: Get Node.js
git clone https://github.com/your-username/DetalBee_HomeTask.git
cd DetalBee_HomeTask
-
Build and start containers:
docker-compose up --build
-
Access the application:
- Frontend:
http://localhost:3000
- Backend:
http://localhost:8000
- Frontend:
-
Stopping containers:
docker-compose down
Run backend tests with pytest
:
cd dailynotes_api
pytest
Run frontend tests with npm
:
cd dailynotes-ui
npm test
Method | Endpoint | Description |
---|---|---|
POST | /api/auth/login |
Log in a user |
GET | /api/notes/ |
Retrieve all notes |
POST | /api/notes/ |
Create a new note |
PUT | /api/notes/<id> |
Update an existing note |
DELETE | /api/notes/<id> |
Delete a note |
Create a .env
file in the dailynotes_api
directory with the following:
SECRET_KEY=your-secret-key
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
Create a .env
file in the dailynotes-ui
directory with the following:
REACT_APP_BACKEND_URL=http://localhost:8000