Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mazma1 committed Jul 4, 2020
0 parents commit 853291b
Show file tree
Hide file tree
Showing 16 changed files with 4,821 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env"]
}
1 change: 1 addition & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DB_URL_DEV=postgres://database_username:password@localhost:5432/database_name
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build/
node_modules/
.env
8 changes: 8 additions & 0 deletions .sequelizerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const path = require('path');

module.exports = {
"config": path.resolve('./src/config', 'config.js'),
"models-path": path.resolve('./src/models'),
"seeders-path": path.resolve('./src/seeders'),
"migrations-path": path.resolve('./src/migrations')
};
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# book-gallery-api
A simple authentication API for the books gallery app

## Core Technologies
1. NodeJS/Express
2. Postgres/Sequelize ORM


## To get started
1. Clone the repository:
```
git clone https://github.com/she-code-africa/WOSCA-book-gallery-api
```
2. Ensure you have installed [NodeJS](https://nodejs.org/en/) and [Postgres](https://www.postgresql.org/download/)
3. Navigate into the app's root directory:
```
cd WOSCA-book-gallery-api
```
### Database Setup
1. Create a Postgres database for your local development with any name of your choice.
2. Create a `.env` file in the root directory using the sample `.env.sample` file and update the database URL with your connection credentials
2. Globally install sequelize cli
```
npm install -g sequelize-cli
```
3. Run migrations
```
sequelize db:migrate
```
### Development
1. Install all dependencies:
```
npm install
```
2. Install all dependencies:
```
npm run start:dev
```
11 changes: 11 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "book-gallery",
"addons": [
"heroku-postgresql"
],
"buildpacks": [
{
"url": "heroku/nodejs"
}
]
}
Loading

0 comments on commit 853291b

Please sign in to comment.