Basic API structure for a full API project with auth using better-auth with Bun and Elysia.
🔥 This project is modular, reusable, and easy to change.
To run the API locally, you need to configure your environment variables. Copy .env.example to .env and fill in your database credentials and other settings. Then run:
bun devMake sure your database is running and accessible with the credentials in
.env.
Docker is just to make it easier to start the API with everything preconfigured. It will build the API, set up the database, and run migrations automatically.
docker compose -f docker-compose.yml -f docker-compose.override.yml up -d- This builds API, spins up a PostgreSQL container, and connects API to it.
docker compose up -d- Connect your
.envDB ssettings to an external database. - The API will sstart without creating a DB container.