Short answer: a good contract makes scope, money, timing and ownership unambiguous. Treat the points below as general guidance, and have a qualified professional review the final text for your jurisdiction.
Core clauses
- Parties and project. Who is contracting with whom, and a clear description of the work.
- Scope and deliverables. What you will build, what you will not, and what counts as finished. Attach a scope document.
- Timeline and milestones. Dates, and what you need from the client (content, feedback, access) to hit them.
- Fees and payment terms. Fixed price or hourly, milestone payments, a deposit, invoice due dates, late payment consequences and accepted payment methods.
- Revisions and change requests. How many revision rounds are included and how extra work is priced and approved.
- Intellectual property. Who owns the code and design, and when ownership transfers (commonly on full payment). Also how third-party libraries and licences are handled.
- Confidentiality. Treatment of the client's private information.
- Warranties and liability. A limited period for fixing defects, and a cap on liability.
- Termination. How either side can end the agreement and what is owed for work done.
- Support and hosting. Whether maintenance is included or sold separately.
- Portfolio rights. Whether you may show the work.
- Governing law and dispute resolution.
Practical tips
- Keep it readable; plain language gets signed faster.
- Get written approval of the scope before you start.
- Do not start work before the deposit and signature.
- Store signed copies and keep communication in writing.
Pitfalls
- Copying a template without adapting it.
- "Unlimited revisions".
- Vague acceptance criteria, so the client can always say it is not done.
This is general information, not legal advice. For larger projects, ask a lawyer.