https://github.com/danielc92/job-board-rest-api
Building backend for a Job Board app in Nodejs, Express.js, MongoDB and mongoose.
https://github.com/danielc92/job-board-rest-api
expressjs mongodb rest-api side-project
Last synced: 2 months ago
JSON representation
Building backend for a Job Board app in Nodejs, Express.js, MongoDB and mongoose.
- Host: GitHub
- URL: https://github.com/danielc92/job-board-rest-api
- Owner: danielc92
- Created: 2019-08-15T06:54:32.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-22T12:02:32.000Z (over 3 years ago)
- Last Synced: 2025-06-27T11:46:08.337Z (12 months ago)
- Topics: expressjs, mongodb, rest-api, side-project
- Language: Jupyter Notebook
- Homepage:
- Size: 1.02 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Job Board API
Building backend for a Job Board app in Nodejs, Express.js, MongoDB and mongoose. This application will be connected to a javascript based front-end such as React in the future.
### Security
- Appropriate rate limiting to prevent abuse, particularly to content (POST) creation routes.
- Passwords need to be slow hashed with `bcrypt/pbkf2`.
- Users should not and cannot modify documents created by others. May need to utlilize auth middleware to achieve this.
- Sensitive variables need to be hidden away in environment variables.
### Stack
- MongoDB as a database
- Mongoose ODM for modelling and validation
- Express.js for web framework
- Nodejs backend
### Available routes
- `/api/skill` (individual skills for jobs)
- `/api/job` (job postings)
- `/api/job-category` (job categories such as healthcare/retail/administration)
- `/api/benefit` (benefits relating to job posts)
- `/api/application` (applications)
- `/api/auth/login` (provided valid login details, will return a json web token)
- `/api/auth/register` (allows creation of new accounts)
- `/api/test` (for testing purposes only, not part of main application)
### Running the server
`nodemon` can be installed to hot reload the server during development phase.
```sh
npm install nodemon
nodemon server.js
```
### Running MongoDB in Docker
Required to install docker desktop, and install the `mongo` image.
The following command will run a container based on the mongo image, mapping the containers port 27017 to the hosts 27017 in detached mode (runs as background process). Volume hasn't been mounted in order to keep the environment even more portable (a script will be required to prepopulate the database within the container).
```sh
docker run --name mongo-instance -d -p 27017:27017 mongo
```
### Tests
- Testing all routes and methods using `postman`
### Deployment
Planning to deploy within Docker containers or barebone server on AWS/GCP/DO.
### Sources
- [Mongoose documentation](https://www.npmjs.com/package/mongoose)
- [Express.js documentation](https://expressjs.com/)
- [Basic rate limiting for express](https://www.npmjs.com/package/express-rate-limit)
- [Clustering in Node](https://nodejs.org/api/cluster.html)