diff --git a/README.md b/README.md index e4f8397..50738b6 100644 --- a/README.md +++ b/README.md @@ -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 \ No newline at end of file +## 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. \ No newline at end of file diff --git a/lavender-stickynotes b/lavender-stickynotes new file mode 160000 index 0000000..9e943ce --- /dev/null +++ b/lavender-stickynotes @@ -0,0 +1 @@ +Subproject commit 9e943ceac8408077e6cb43282f4b7a7c4ffc7e6b diff --git a/requirements.txt b/requirements.txt index 3119fb0..d3ea0e0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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