A simple RESTful API to fetch information about starwars films
- Javascript: Programming language
- Node.js - As an asynchronous event-driven JavaScript runtime, Node.js is designed to build scalable network applications.
- Express.js - Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.
- Postgresql - PostgreSQL is a powerful, open source object-relational database system .
- Docker - Docker is a tool designed to make it easier to create, deploy, and run applications by using containers.
- Docker Compose - A tool for defining and running multi-container Docker applications
Click here for the API Documentation
- Object Oriented Programming
- ES6 imports
Follow the instructions given below to get this project up and running on your local machine.
Make sure you have the following installed:
- Clone this repository by running
git clone git@github.com:georgeben/starwars-challenge.git
cd
into the cloned repository- Create a file in the project's root named
.env
. Copy the content of.env.schema
and paste it into.env
. Fill in the appropriate values for the credentials listed. - If a database does not already exist, run
docker-compose --env-file .env run starwars-challenge-api npm run db:create
to create a database for the application. - Start the application by running
docker-compose up
. Make sure you have stable internet connection, as some docker images may need to be downloaded. - Access the application at http://localhost:[PORT]
- Clone this repository by running
git clone git@github.com:georgeben/starwars-challenge.git
cd
into the cloned repository- Create a file in the project's root named
.env
. Copy the content of.env.schema
and paste it into.env
. Fill in the appropriate values for the credentials listed. - Run
npm install
- Ensure you have your Postgresql server running
- If a database does not already exist, run
npm run db:create
to create the database. - Run
npm run migrate:up
to run all migrations. - Run
npm run start:dev
npm run build
: Compiles source code using Babelnpm run prestart
: Builds code and run migrations before the app startsnpm run start:dev
: Starts the app in development mode using nodemon. The app is restarted on any file change, which makes development a bit faster.npm run start
: Starts the app in production modenpm run test
: Run testsnpm run lint
: Lint code using ESLintnpm run docs:api
: Generates API documentationnpm run migrate:up
: Runs DB migrationsnpm run db:seed
: Seeds databasenpm run db:create
: Creates the database if it doesn't existnpm run db:drop
: Drops the database. Be careful! All data may be lost!
- CI is setup using Github Actions
Kurobara Benjamin George