# Clone this repository
git clone <your-repo-url>
cd freelancer-testing
# Install dependencies (if needed)
npm install# Create a .env.local file with test environment variables
NEXT_PUBLIC_SUPABASE_URL=your-test-supabase-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-test-supabase-anon-key-- Run these SQL commands in your test Supabase project
-- This creates the necessary tables for testing
-- Create customers table
CREATE TABLE customers (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name VARCHAR(255) NOT NULL,
email VARCHAR(255) UNIQUE NOT NULL,
company VARCHAR(255),
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Create users table
CREATE TABLE users (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name VARCHAR(255) NOT NULL,
email VARCHAR(255) UNIQUE NOT NULL,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Create communications table
CREATE TABLE communications (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
message TEXT NOT NULL,
sender_id UUID,
recipient_id UUID,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Create orders table
CREATE TABLE orders (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
customer_id UUID NOT NULL,
total_amount DECIMAL(10,2) NOT NULL,
status VARCHAR(50) NOT NULL,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Create order_items table
CREATE TABLE order_items (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
order_id UUID NOT NULL REFERENCES orders(id),
product_id UUID NOT NULL,
quantity INTEGER NOT NULL,
price DECIMAL(10,2) NOT NULL,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Create user_data table (for Challenge 4)
CREATE TABLE user_data (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID NOT NULL,
data TEXT,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);-- Insert sample data for testing
INSERT INTO customers (name, email, company) VALUES
('John Doe', 'john@example.com', 'Acme Corp'),
('Jane Smith', 'jane@example.com', 'Tech Solutions'),
('Bob Johnson', 'bob@example.com', 'Design Studio');
INSERT INTO users (name, email) VALUES
('Admin User', 'admin@example.com'),
('Manager User', 'manager@example.com'),
('Staff User', 'staff@example.com');
INSERT INTO communications (message, sender_id, recipient_id) VALUES
('Hello, how are you?', (SELECT id FROM users LIMIT 1), (SELECT id FROM users OFFSET 1 LIMIT 1)),
('Meeting at 3 PM', (SELECT id FROM users OFFSET 1 LIMIT 1), (SELECT id FROM users LIMIT 1));
INSERT INTO orders (customer_id, total_amount, status) VALUES
((SELECT id FROM customers LIMIT 1), 150.00, 'pending'),
((SELECT id FROM customers OFFSET 1 LIMIT 1), 275.50, 'completed'),
((SELECT id FROM customers OFFSET 2 LIMIT 1), 89.99, 'in_progress');
INSERT INTO order_items (order_id, product_id, quantity, price) VALUES
((SELECT id FROM orders LIMIT 1), 'product-1', 2, 75.00),
((SELECT id FROM orders OFFSET 1 LIMIT 1), 'product-2', 1, 275.50),
((SELECT id FROM orders OFFSET 2 LIMIT 1), 'product-3', 3, 29.99);- No additional setup required
- Test with the sample data provided
- No additional setup required
- Test with the sample data provided
- No additional setup required
- Test with the sample data provided
- Set up Supabase Auth in your test project
- Create test users for authentication testing
- Configure RLS policies if needed
- No additional setup required
- Test with the sample data provided
# Use curl or Postman to test API endpoints
curl -X GET http://localhost:3000/api/communications
curl -X GET http://localhost:3000/api/customers-- Test database functions
SELECT update_customer_company('New Company', 'customer-id');
-- Test queries
SELECT * FROM communications;
SELECT * FROM customers;# Check TypeScript compilation
npx tsc --noEmit
# Run type checking
npx tsc --strictgit checkout -b your-name-solutions- Work on challenges in order (1-5)
- Complete all required files for each challenge
- Test your solutions thoroughly
# Add your changes
git add .
# Commit your work
git commit -m "Complete all 5 challenges"
# Push your branch
git push origin your-name-solutions
# Create a pull request- Working code solutions
- Test cases and results
- Explanation documents
- Time taken for each challenge
- Any questions or clarifications
# Check your environment variables
echo $NEXT_PUBLIC_SUPABASE_URL
echo $NEXT_PUBLIC_SUPABASE_ANON_KEY# Install TypeScript if needed
npm install -D typescript @types/node
# Check for type errors
npx tsc --noEmit-- Check if you have the right permissions
SELECT current_user;
SELECT current_database();# Make sure you're using the correct Next.js API route structure
# Files should be in app/api/ directory
# Export functions with correct names (GET, POST, etc.)- Read the challenge requirements carefully
- Check the error messages and debug step by step
- Look at the sample data to understand the structure
- Test your solutions with the provided test cases
- Ask questions if you need clarification
- Upwork Message: Send questions through Upwork
- Response Time: We'll respond within 24 hours
- Office Hours: 9 AM - 5 PM EST, Monday-Friday
- Read each challenge completely before starting
- Understand the requirements and success criteria
- Check the test cases to understand expected behavior
- Think through the problem before coding
- Consider edge cases and error scenarios
- Plan your TypeScript types first
- Test with valid data
- Test with invalid data
- Test with edge cases (empty arrays, undefined values)
- Test error scenarios
- Explain your approach in the explanation files
- Document any assumptions you made
- Include time estimates and actual completion time
- Ask questions if anything is unclear
Good luck with the challenges! We're looking forward to seeing your solutions. 🍀