Quick Start Guide
This guide will get you up and running with IHP in just a few minutes. You’ll create a new project, start the development server, and see your first Haskell web application in action.Before starting, make sure you’ve completed the installation guide.
Create Your First Project
Create a New Project
Use the This creates a new directory called
ihp-new command to create a new project:my-app with all the files and structure needed for an IHP application.Start the Development Server
- Start a PostgreSQL database
- Launch the web application
- Start a WebSocket server for live reloading
- Open the built-in IDE
The very first time you start the server might take a while and may require a restart. If needed, press
CTRL+C and run devenv up again.Open Your Application
By default, your application is available at:
- App: http://localhost:8000
- Development Tools: http://localhost:8001
If ports 8000 and 8001 are already in use, IHP will automatically pick the next available ports (e.g., 8002 and 8003).
Your First Code Change
Let’s experience IHP’s live reloading by making a simple change:Project Structure
Here’s whatihp-new created for you:
| File/Directory | Purpose |
|---|---|
Application/ | Your domain logic lives here |
Application/Schema.sql | Database schema and tables |
Web/Controller/ | Web application controllers |
Web/View/ | HTML template files |
Web/Types.hs | Central place for web application types |
Config/ | Framework and application configuration |
static/ | Images, CSS, and JavaScript files |
flake.nix | Declares app dependencies (like package.json for NPM) |
.ghci | Config for the Haskell interpreter |
What’s Running?
The development server automatically manages:- PostgreSQL Database: No manual setup needed
- Web Server: Serves your application
- WebSocket Server: Powers live reloading
- Development Tools: Code generators, schema designer, and logs
To stop the server, press
CTRL+CNext Steps
Now that you have IHP running, you’re ready to build something real:Build Your First Project
Follow the complete tutorial to build a blog application with posts and comments
Explore the Schema Designer
Design your database schema with a visual interface
Use Code Generators
Generate controllers, views, and actions automatically
View Application Logs
Monitor SQL queries and application logs in real-time
Tips
- Place your text editor and browser side-by-side to see live reloading in action
- The development server shows helpful error messages when things go wrong
- IHP is built by terminal hackers - everything can be done from the command line if you prefer
- Changes to Haskell files are usually reflected in less than 50ms
Getting Help
If you run into any issues:- Check the troubleshooting guide
- Join the IHP Slack community
- Ask questions in the community - we’re happy to help!