Welcome to the database setup for the Budgeting App! Our app is designed to help you manage your finances by keeping track of your expenses and income. This guide will walk you through the process of setting up a CouchDB database using Docker, which our app relies on to store and manage data.
Before we begin, please make sure you have the following software installed:
- Docker - Our app uses Docker to run the database in an isolated environment, ensuring it works the same way on every machine.
Ready to get started? Great! Just follow these steps:
-
First, clone our project repository to your machine:
git clone https://github.com/resivalex/budgeting-app-couchdb.git
-
Next, navigate to the project directory:
cd budgeting-app-couchdb
-
Create an
.env
file in the project directory. This file will hold some important settings for our app. Here's an example:COUCHDB_USER=admin COUCHDB_PASSWORD=password PORT=9002
Note: Be sure to replace the values in the example with your own!
-
Have a look at the
docker-compose.yml
file. This is the recipe Docker follows to build our app. By default, it uses thecouchdb
image and exposes port9002
. Feel free to adjust these as necessary. -
Time to start the app! Just run:
docker-compose up -d
This will start the CouchDB service in the background.
-
Once the app is up and running, you can access it at http://localhost:9002. Give yourself a pat on the back - you did it!
The docker-compose.yml
file lets you tweak a few things:
image
: This is the Docker image we use for the CouchDB service. By default, it'scouchdb
.container_name
: This sets the name for our CouchDB container. By default, it'sbudgeting-app-couchdb
.env_file
: This is the path to the.env
file that holds the settings our app needs.volumes
: This tells Docker to link the./data
directory in our project to the CouchDB container, giving us persistent data storage.ports
: This maps the host port to the CouchDB container port. It uses${PORT:-5984}
by default, meaning it will use port5984
unless you set a `