This project is a app api for BYU Idaho CSE 341 course. You can check the project requriments here
- ExpressJS (js web server)
- TypeScript (js superset to enable types)
- Mongoose (nosql database)
- Prettier (formatting)
- ESLint (linting)
- Swagger (api doc)
- Yarn (package manager)
Because this project uses typescript you need compile from .ts
files to .js
file before running the project. When you build using any of the defined scripts: build
, start
, or start:dev
a new directory named dist/
is going to be created. That directory will contain all the compiled javascript files for node runner.
You need to install yarn globally before running the app. Run yarn install
to install all js dependencies (node_modules). Before first use, you might need to run yarn build
. You can use npm commands as well npm run <script>
. But you should mantain package-lock.json and yarn.lock file by running npm i <package_name>
and yarn add <package_name>
every time you want to install a new dependency.
You need to create a Github oauth app and save client_id and secret_id for this app. Also set the redirect url app according to the enviroment you are working on.
You need to create a new file called .env
, this file is not going to be tracked by git because security purposes. Use this example with your own values:
APP_PORT=8080
APP_HOST=localhost
APP_HTTP_SCHEMA=http
MONGODB_URI=mongodb+srv://user:buoOJyajxvZTACPp@cluster0.host.mongodb.net
OAUTH_CLIENT_ID=5f20f7pa162a1b0a9bft
OAUTH_CLIENT_SECRET=b5a8e82f712427f688fg4f8acb9afbefc4caf0f9
COOKIE_SECRET=boardgames
APP_AUTH_HOST=http://localhost:8080
Run yarn start:dev
or (npm run start:dev
when using npm), nodemoon will be watching any file change.
The dist directory contains the production files, you need to build before by using yarn build
, then you can run yarn start
. Or go to dist directory and run node index.js
.
Run yarn test
to run all test using jest.