REST API with DB
A powerful Hono Backend with Drizzle and Postgres for Node.js/Bun
railway-rest-api-with-db
aeither/railway-rest-api-with-db
Just deployed
Postgres
railwayapp-templates/postgres-ssl:latest
Just deployed
/var/lib/postgresql/data
REST API with DB
A powerful Hono Backend with Drizzle and Postgres for Node.js/Bun
Overview
This project demonstrates a robust REST API built with Hono, using Drizzle ORM for database operations with PostgreSQL. It's designed to run on Bun, providing a fast and efficient backend solution. The project structure allows for easy deployment on Railway, making it ideal for rapid development and scaling.
Key Features
- Fast REST API using Hono framework
- Database integration with Drizzle ORM and PostgreSQL
- Runs on Bun for improved performance
- Easy deployment to Railway
- Health check endpoint for monitoring
- User management API endpoint
- Dockerized for consistent environments
Setup
To install dependencies:
bun install
Set up your .env file with your database URL:
DATABASE_URL=your_postgres_url_here
DB
To generate database migrations, use the following command:
bun run db:generate
To apply the generated migrations to the database, run:
bun run db:push
To seed the database with sample data, execute:
bun run db:seed
Develop
To run the application locally, execute the following command in your terminal:
bun run dev
Deploy
Initialize your project:
railway init
To deploy the bot on Railway:
railway up
Remember to set the DATABASE_URL
environment variable in your Railway project settings.
Learn More
Template Content
railway-rest-api-with-db
aeither/railway-rest-api-with-db