This backend project includes both the database and the API for our City Explorer App.
The database stores information about the users, city information, and the attractions the users have stored in their bucket lists for each city.
To get the database and API up and running on your local machine, follow these steps:
Ensure you have the following installed:
- Node.js (minimum version: v21.7.3)
- PostgreSQL (minimum version: v16.3)
Begin by cloning the repository to your local machine. Use the following command in your terminal, ensuring you navigate to your desired directory:
git clone https://github.com/EliR94/city-explorer-backend.git
Next, install the project dependencies using npm. Execute the following command in your terminal (ensure you're within the repository directory):
npm install
This command will fetch and install the required packages.
- You'll need to create two
.env
files:.env.test
and.env.development
within the project root directory to store the database names. - Add PGDATABASE=
<insert-database-name-here>
into each.env.
file ensuring to use the correct database name in each file.
Set up the local databases:
npm setup-dbs
Seed the development database:
npm run seed
Run the API tests:
npm run test
To see the App in action, follow these links: