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
- Setup Issues
- How do I set up the project locally?
- What are the required dependencies?
- Database Questions
- How do I connect to the database?
- How do I run database migrations?
- Deployment Questions
- How do I deploy the project to DigitalOcean?
- What environment variables do I need in production?
- Troubleshooting
- Why is my front-end not connecting to the back-end?
- 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:
-
Clone the repository:
-
Install back-end dependencies with Poetry:
-
Install front-end dependencies:
Navigate to the
frontend
directory and install dependencies: -
Run the development servers:
For the back-end:
For the front-end:
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:
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:
For production, you can run migrations from your local machine with prod.env
:
Deployment Questions
How do I deploy the project to DigitalOcean?
The project can be deployed to DigitalOcean App Platform by following these steps:
- Create a new app on DigitalOcean App Platform, and link your GitHub repository.
- Configure environment variables to match your
prod.env
file. - 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.
How do I troubleshoot Docker-related issues?
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:
For additional help or to report bugs, feel free to open an issue on GitHub.