Skip to content

Latest commit

 

History

History
234 lines (183 loc) · 5.79 KB

github-setup-guide.md

File metadata and controls

234 lines (183 loc) · 5.79 KB

GitHub Repository Setup Guide

Follow these steps to create your AccountsPro GitHub repository with all the files.

Step 1: Create GitHub Repository

  1. Go to GitHub: https://github.com

  2. Click "New repository" (green button)

  3. Repository settings:

    • Repository name: accountspro
    • Description: Professional accounting application with Django REST API and React TypeScript frontend
    • Visibility: Public (or Private if preferred)
    • ✅ Add a README file
    • ✅ Add .gitignore (choose Python template initially)
    • ✅ Choose a license (MIT recommended)
  4. Click "Create repository"

Step 2: Clone Repository Locally

git clone https://github.com/yourusername/accountspro.git
cd accountspro

Step 3: Set Up Directory Structure

# Create main directories
mkdir backend frontend

# Create backend subdirectories
cd backend
mkdir accounts_project accounts transactions users
mkdir -p accounts/management/commands
mkdir -p accounts/migrations
mkdir -p transactions/migrations
mkdir -p users/migrations
mkdir -p .github/workflows

cd ..

Step 4: Add All Files

Root Level Files

Create these files in the root directory:

  1. README.md - Replace the default one with our comprehensive version
  2. LICENSE - Our MIT license file
  3. CONTRIBUTING.md - Contribution guidelines
  4. .gitignore - Root gitignore file

Backend Files (/backend/)

Create these files in the backend directory:

  1. requirements.txt
  2. manage.py
  3. Dockerfile
  4. docker-compose.yml
  5. .env.example
  6. .gitignore (backend-specific)

Django Project (/backend/accounts_project/)

  1. init.py (empty file)
  2. settings.py
  3. urls.py
  4. wsgi.py (Django will create this)

Accounts App (/backend/accounts/)

  1. init.py (empty file)
  2. admin.py
  3. apps.py
  4. models.py
  5. serializers.py
  6. views.py
  7. migrations/init.py (empty file)
  8. management/init.py (empty file)
  9. management/commands/init.py (empty file)
  10. management/commands/create_sample_data.py

Transactions App (/backend/transactions/)

  1. init.py (empty file)
  2. admin.py
  3. apps.py
  4. models.py
  5. serializers.py
  6. views.py
  7. migrations/init.py (empty file)

Users App (/backend/users/)

  1. init.py (empty file)
  2. admin.py
  3. apps.py
  4. models.py
  5. migrations/init.py (empty file)

Frontend Files (/frontend/)

  1. package.json
  2. vite.config.ts
  3. tsconfig.json
  4. tsconfig.node.json
  5. tailwind.config.js
  6. postcss.config.js
  7. .env.example
  8. .gitignore (frontend-specific)
  9. index.html

Frontend Source (/frontend/src/)

  1. main.tsx
  2. App.tsx (copy from the React artifact)
  3. index.css
  4. types/index.ts
  5. services/api.ts

GitHub Actions (/.github/workflows/)

  1. ci.yml - CI/CD pipeline

Step 5: Initialize and Commit

# Add all files
git add .

# Initial commit
git commit -m "feat: initial project setup with Django backend and React frontend

- Add Django REST API with accounts and transactions apps
- Add React TypeScript frontend with Sage-style UI
- Include Docker configuration for easy deployment
- Add comprehensive documentation and contributing guidelines
- Set up CI/CD pipeline with GitHub Actions"

# Push to GitHub
git push origin main

Step 6: Create Development Branch

# Create and switch to develop branch
git checkout -b develop

# Push develop branch
git push -u origin develop

Step 7: Set Up Branch Protection (Optional)

In GitHub repository settings:

  1. Go to Settings → Branches
  2. Add rule for main branch:
    • ✅ Require pull request reviews before merging
    • ✅ Require status checks to pass before merging
    • ✅ Require branches to be up to date before merging
    • ✅ Include administrators

Step 8: Add Repository Topics

In your GitHub repository:

  1. Click the ⚙️ gear icon next to "About"
  2. Add topics: django, react, typescript, accounting, finance, rest-api, postgresql, vite

Step 9: Set Up Issues and Project Templates

Create these in .github/ directory:

Issue Templates

mkdir -p .github/ISSUE_TEMPLATE

Create bug report and feature request templates.

Pull Request Template

# .github/pull_request_template.md

Step 10: Final Repository Structure

Your final repository should look like this:

accountspro/
├── .github/
│   └── workflows/
│       └── ci.yml
├── backend/
│   ├── accounts_project/
│   ├── accounts/
│   ├── transactions/
│   ├── users/
│   ├── requirements.txt
│   ├── manage.py
│   ├── Dockerfile
│   ├── docker-compose.yml
│   ├── .env.example
│   └── .gitignore
├── frontend/
│   ├── src/
│   ├── package.json
│   ├── vite.config.ts
│   ├── tsconfig.json
│   ├── tailwind.config.js
│   ├── index.html
│   ├── .env.example
│   └── .gitignore
├── README.md
├── LICENSE
├── CONTRIBUTING.md
└── .gitignore

Step 11: Test the Setup

  1. Clone your repository to a new location
  2. Follow the setup instructions in README.md
  3. Verify everything works as expected
  4. Create a test issue and pull request to ensure workflows work

Additional Tips

  • Star your own repository to make it easy to find
  • Add a description and website URL in repository settings
  • Enable GitHub Pages if you want to host documentation
  • Set up repository notifications for collaborators
  • Consider adding a Code of Conduct file

Your professional AccountsPro repository is now ready for development and collaboration! 🚀