Skip to content

Frequently Asked Questions (FAQ)

This FAQ section answers common questions related to setting up, using, and troubleshooting the Craft Your Startup Boilerplate. If you encounter any issues not covered here, feel free to open an issue on GitHub.

Table of Contents

  1. Setup Issues
  2. How do I set up the project locally?
  3. What are the required dependencies?
  4. Database Questions
  5. How do I connect to the database?
  6. How do I run database migrations?
  7. Deployment Questions
  8. How do I deploy the project to DigitalOcean?
  9. What environment variables do I need in production?
  10. Troubleshooting
  11. Why is my front-end not connecting to the back-end?
  12. How do I troubleshoot Docker-related issues?

Setup Issues

How do I set up the project locally?

To set up the project locally, follow these steps:

  1. Clone the repository:

    git clone https://github.com/your-username/craftyourstartup-boilerplate.git
    cd craftyourstartup-boilerplate
    
  2. Install back-end dependencies with Poetry:

    poetry install
    
  3. Install front-end dependencies:

    Navigate to the frontend directory and install dependencies:

    cd frontend
    npm install
    
  4. Run the development servers:

    For the back-end:

    poetry run uvicorn main:app --reload
    

    For the front-end:

    npm run dev
    

What are the required dependencies?

  • Python 3.11+ (with Poetry for dependency management)
  • Node.js and npm/yarn (for the front-end)
  • PostgreSQL (as the database)
  • Docker (for running the project with Docker Compose)

Database Questions

How do I connect to the database?

You can connect to the PostgreSQL database using the credentials defined in your .env file (or prod.env for production). For local development, ensure the PostgreSQL service is running via Docker:

docker-compose up -d

Use the following credentials in your database client (e.g., DBeaver, pgAdmin):

db_username=craftyourstartup
db_password=craftyourstartup
db_host=localhost
db_port=54323
db_database=craftyourstartup

How do I run database migrations?

To run migrations, use Alembic. For local migrations, run:

task alembic-upgrade-local

For production, you can run migrations from your local machine with prod.env:

set -o allexport && source prod.env && set +o allexport && poetry run alembic upgrade head

Deployment Questions

How do I deploy the project to DigitalOcean?

The project can be deployed to DigitalOcean App Platform by following these steps:

  1. Create a new app on DigitalOcean App Platform, and link your GitHub repository.
  2. Configure environment variables to match your prod.env file.
  3. Deploy the app—DigitalOcean will automatically detect and build the project using the Dockerfile.

What environment variables do I need in production?

For production, your environment variables (stored in DigitalOcean App Platform or your production .env file) should look something like this:

db_username=craftyourstartup
db_password=craftyourstartup
db_host=<your-database-host>
db_port=<your-database-port>
db_database=craftyourstartup
db_sslmode=require
redirect_after_login=https://your-production-url.com
support_email=[email protected]
aws_access_key_id=<your-spaces-access-key>
aws_secret_access_key=<your-spaces-secret-key>
google_oauth2_client_id=xxx
google_oauth2_secret=xxx
stripe_api_key=xxx
stripe_webhook_secret=xxx
mailchimp_api_key=xxx
env=prod

Troubleshooting

Why is my front-end not connecting to the back-end?

There could be several reasons for this issue:

  • Proxy Setup: Ensure that the Vite proxy in vite.config.ts is properly configured to forward /api requests to the back-end.
  • Environment Variables: Ensure the API base URL is correctly set in the environment variables (for local development, check VITE_API_BASE_URL).
  • CORS Issues: Check if your FastAPI back-end allows CORS for the front-end domain.

If you're experiencing issues with Docker, here are a few common solutions:

  • Check if Docker is running: Make sure Docker is installed and running on your machine.
  • Check container logs: Use docker-compose logs -f to see the logs for your containers and debug any issues.
  • Rebuild the containers: If you made changes to the Dockerfile or environment, rebuild the containers using:

    docker-compose down
    docker-compose up --build
    

For additional help or to report bugs, feel free to open an issue on GitHub.