Welcome to the Code-Cell-Website developer guide! This document provides detailed information on the project architecture, setup, and contribution workflow.
The project follows a decoupled Client-Server architecture:
- Frontend (Client): A Next.js application that handles UI rendering, routing, and user interactions. It communicates with the backend via RESTful APIs.
- Backend (Server): A Django REST Framework application that manages data persistence, authentication logic, and business rules.
.
├── client/ # Next.js Frontend
│ ├── src/
│ │ ├── app/ # App Router pages
│ │ ├── components/ # Reusable UI components
│ │ └── lib/ # Utilities and constants
│ ├── public/ # Static assets
│ └── tailwind.config.ts # Styling configuration
├── server/ # Django Backend
│ ├── api/ # API endpoints and logic
│ ├── server/ # Main project settings
│ ├── requirements.txt # Python dependencies
│ └── manage.py # Django CLI
├── docker-compose.yml # Container orchestration
├── setup.sh # Linux installation script
└── Endpoints.md # API Documentation Reference
We use pre-commit and detect-secrets to ensure code quality and prevent sensitive data from being committed.
Initialize Hooks:
./setup.sh # This script installs all necessary tools and hooksManual Run:
pre-commit run --all-files- Migrations: Always run
python manage.py makemigrationsandmigrateafter changing models. - Shell: Use
python manage.py shellfor testing backend logic. - Environment: Store secrets in a
.envfile (never commit this!).
- Components: Use Shadcn UI components located in
client/src/components/ui. - Icons: Use
lucide-reactor@tabler/icons-react. - Styling: Use Tailwind utility classes. For complex animations, use Framer Motion.
For a full list of available endpoints, request/response formats, and authentication requirements, please refer to: 👉 Endpoints.md
Run Django tests:
cd server
python manage.py testRun Next.js linting:
cd client
npm run lintThe project is designed to be easily deployable using Docker.
Production Build:
docker-compose -f docker-compose.yml up --build -dManual Deployment Notes:
- Ensure
DEBUGis set toFalsein Django settings. - Use
gunicornoruwsgifor the backend server. - Use
nginxto serve the static files and act as a reverse proxy.
- Branching: Use descriptive branch names like
feature/login-ui,fix/api-error, ordocs/update-readme. - Commit Messages: Follow Conventional Commits (e.g.,
feat: add user profile page,fix: resolving jwt expiry issue). - Code Review: All pull requests must be reviewed by at least one core member.
- Formatting: Ensure your code is properly formatted before committing.
- Python: Black/Flake8
- JavaScript/TS: Prettier/ESLint
- JWT Errors: If your token is invalid, ensure the
SECRET_KEYin your.envmatches the backend's key. - Database Locks: If using SQLite and you encounter a lock, restart the Django dev server.
- CORS Issues: Ensure the frontend domain is added to
CORS_ALLOWED_ORIGINSinserver/server/settings.py.
Need help? Reach out to the maintainers at [Code Cell Discord/Mail].