Voluntier is a mobile app developed by Northcoders Students as the final project of the Software Development Bootcamp. The app connects volunteers with charity organisations that need help.
This is the backend API component of the project.
Tomasz, Lia, Tom, Joseph, Matt, Joy
Take a look at the frontend repo
Typescript, Node-postgres, Express.js, PostgreSQL.
For installation, you will need to have the following applications installed:
-
node.js
[minimum version v21.6.2] -
psql (PostgreSQL)
[minimum version v16.2]
-
Make a new directory and clone the repository by running the command:
git clone https://github.com/Joseph-Lee98/be-voluntier.git
-
Database name.
For example:
PGDATABASE=voluntier_db
-
Log level. Can take values
debug
,info
,error
.For example:
LOGL=debug
Note: If you would like to remove log messages, set the level to
error
. -
JSON Web Token (JWT) secret key
For example:
SECRET_KEY=keyboard-cat
-
Add a
.env.development
file to your root directory.For example:
PGDATABASE=voluntier_db LOGL=debug SECRET_KEY=keyboard-cat
-
Add a
.env.test
file to your root directory.For example:
PGDATABASE=voluntier_db_test LOGL=error SECRET_KEY=keyboard-cat
-
Add a
.env.production
file to your root directory if you are planning on hosting the API.For example:
PGDATABASE=voluntier_db DATABASE_URL=postgres://username:password@db-hostname:5432/voluntier_db LOGL=error SECRET_KEY=keyboard-cat
-
npm install
-
Set up the psql databases:
npm run setup-dbs
-
Compile the project:
npm run build
-
Seed the database:
npm run seed
-
Compile the project:
npm run build
-
Run the project:
npm start
Note: When testing for the first time, execute npm run prepare
to initialise husky
.
npm test