Note: This entire application was built by Claude 3.7 Sonnet and Cursor IDE in under 1 hour for experimental purposes.
Freelance Calculator is a comprehensive SaaS application designed to help freelancers calculate project pricing based on their working schedule and hourly rates. It simplifies project management and pricing for freelancers, enabling them to make informed financial decisions.
-
Project Management
- Create and manage all your freelance projects in one place
- Track project timelines, scope, and pricing
-
Accurate Pricing
- Calculate project costs based on working days, hours, and rates
- Visualize project timelines and profitability
-
Payment Discounts
- Offer configurable discounts for preferred payment methods
- Set up PIX payment discounts (customizable)
-
Client Management
- Store client contact information
- Maintain client project history
-
Authentication
- Secure login with email/password, Google, or Microsoft accounts
- Protected routes and session management
- Frontend: Next.js 15, TailwindCSS, ShadcnUI
- Backend: Next.js API Routes (Full-stack application)
- Database: PostgreSQL with Prisma ORM
- Authentication: NextAuth.js
- Containerization: Docker for development environment
- Node.js (v18 or higher)
- Docker and Docker Compose
- Git
- Clone the repository:
git clone https://github.com/vickttor/freelance-calculator.git
cd freelance-calculator
- Install dependencies:
npm install
- Set up environment variables:
cp .env.example .env
- Configure your environment variables in
.env
:
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/freelance_calculator?schema=public"
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your-secure-nextauth-secret-here"
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"
MICROSOFT_CLIENT_ID="your-microsoft-client-id"
MICROSOFT_CLIENT_SECRET="your-microsoft-client-secret"
- Start the development environment:
npm run dev
This will:
- Start the PostgreSQL database in Docker
- Push the schema to the database
- Start the Next.js development server
- Open http://localhost:3000 in your browser.
# Start development environment
npm run dev
# Build for production
npm run build
# Start production server
npm run start
# Run linters
npm run lint
# Format code with Prettier
npm run lint:prettier:fix
# Start database services
npm run services:up
# Stop database services
npm run services:down
# Update database schema
npm run prisma:push
# Generate Prisma client
npm run prisma:generate
freelance-calculator/
├── app/ # Next.js application routes
│ ├── (auth)/ # Authentication pages
│ ├── (dashboard)/ # Dashboard and application pages
│ ├── api/ # API routes
│ ├── globals.css # Global styles
│ └── layout.tsx # Root layout
├── components/ # React components
│ ├── auth/ # Authentication components
│ ├── layout/ # Layout components
│ ├── projects/ # Project-related components
│ └── ui/ # UI components from ShadcnUI
├── lib/ # Utility functions and libraries
├── prisma/ # Prisma schema and migrations
├── public/ # Static assets
└── infra/ # Infrastructure config (Docker)
The application can be deployed to various platforms:
npm install -g vercel
vercel
For production deployment with Neon or Supabase:
- Update the
DATABASE_URL
in your environment variables - Configure proper authentication for OAuth providers
- Deploy using your preferred platform
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Built with ❤️ by Victor H. Silva