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
177 changes: 170 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,174 @@
# lavender-stickynotes
# Lavender Sticky Notes

### Quick development environment
1. Create .env file in root directory.
A collaborative task management and note-taking application built with Django and React. Create teams, manage projects, organize tasks, and share notes with team members.

2. Copy content from template.env to .env
## Features

3. Build and start docker container
>sudo docker-compose up --build
- **Sticky Notes** - Create and manage notes within projects
- **Task Management** - Organize tasks with descriptions and statuses
- **Team Collaboration** - Create teams and manage team members
- **Projects** - Organize work into multiple projects
- **User Profiles** - Personalized user accounts with avatars
- **Secure Authentication** - User registration and login with JWT tokens

4. Visit 0.0.0.0:8000 in browser
## Tech Stack

- **Backend**: Django 4.2.3, Django REST Framework, PostgreSQL
- **Frontend**: React with Tailwind CSS
- **Database**: PostgreSQL 13.3
- **Containerization**: Docker & Docker Compose

## Prerequisites

- Docker & Docker Compose (recommended)
- OR: Python 3.8+, Node.js 14+, PostgreSQL 13+

---

## Quick Start (Docker - Recommended)

### 1. Clone the Repository
```bash
git clone https://github.com/Hack-Weekly/lavender-stickynotes.git
cd lavender-stickynotes
```

### 2. Set Up Environment Variables
```bash
cp template.env .env
```

### 3. Start the Application
```bash
docker compose up --build
```

### 4. Access the Application
- **Frontend**: http://localhost:3000 (React App)
- **Backend API**: http://localhost:8000 (Django)
- **API Documentation**: http://localhost:8000/api/docs/

---

## Setup Without Docker (Manual)

### 1. Backend Setup
```bash
# Install Python dependencies
pip install -r requirements.txt

# Set up environment
cp template.env .env

# Create PostgreSQL database (ensure PostgreSQL is running)
python manage.py migrate

# Create superuser (optional)
python manage.py createsuperuser

# Start Django server
python manage.py runserver
```

### 2. Frontend Setup (in a new terminal)
```bash
cd frontend
npm install
npm start
```

The frontend will open at http://localhost:3000

---

## Project Structure

```
lavender-stickynotes/
├── api/ # Django REST API
│ ├── models.py # Database models
│ ├── serializers.py # API serializers
│ ├── views.py # API views
│ ├── urls.py # API routes
│ └── migrations/ # Database migrations
├── core/ # Django project settings
├── frontend/ # React application
│ ├── src/
│ │ ├── components/ # Reusable React components
│ │ ├── pages/ # Page components
│ │ └── services/ # API service calls
│ └── package.json
├── docker/ # Docker scripts
├── nginx/ # Nginx configuration
├── docker-compose.yml # Docker Compose configuration
└── manage.py # Django management script
```

---

## API Endpoints

Key API routes:
- `POST /api/auth/login/` - User login
- `POST /api/auth/register/` - User registration
- `GET/POST /api/teams/` - List and create teams
- `GET/POST /api/projects/` - List and create projects
- `GET/POST /api/tasks/` - List and create tasks
- `GET/POST /api/notes/` - List and create notes

Full API documentation available at `/api/docs/` when running locally.

---

## Environment Variables

Key variables in `.env`:
- `DEBUG` - Enable debug mode (True for development)
- `SECRET_KEY` - Django secret key
- `POSTGRES_HOST` - Database host
- `POSTGRES_USER` - Database user
- `POSTGRES_PASSWORD` - Database password
- `POSTGRES_DATABASE` - Database name
- `ALLOWED_HOSTS` - Comma-separated list of allowed hosts

---

## Troubleshooting

### Docker Issues
```bash
# View logs
docker compose logs -f

# Stop containers
docker compose down

# Rebuild without cache
docker compose up --build --no-cache
```

### Frontend not loading
- Ensure backend is running on port 8000
- Check that npm packages are installed: `cd frontend && npm install`
- Clear browser cache and reload

### Database migration errors
```bash
python manage.py migrate --run-syncdb
```

---

## Contributing

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

---

## License

This project is part of Hack Weekly.
1 change: 1 addition & 0 deletions lavender-stickynotes
Submodule lavender-stickynotes added at 9e943c
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pyparsing==3.0.9
pytz==2021.3
sqlparse==0.4.4
psycopg2-binary==2.9.1
https://github.com/benoitc/gunicorn/archive/refs/heads/master.zip#egg=gunicorn==20.1.0
gunicorn==20.1.0
eventlet==0.33.3
dnspython==2.3.0
djangorestframework==3.14.0
Expand Down