The backend for Better Blogs, a reddit-like sharing platform for blog posts. Built to learn modern full stack development. The client is here.
- Node.js for a JavaScript runtime
- Express.js for a web framework
- Jest for a testing framework
- JSON Web Tokens via jsonwebtoken for authentication
- MongoDB via mongoose for data storage
- ESLint for linting
- Prettier for formatting
Set environment variables with the shell or a .env
file. The environmental variables are MONGODB_URI
, MONGODB_URI_TEST
, JWT_SECRET
, and PORT
. Docker Compose can be used to start a local MongoDB instance for development with the file docker-compose.mongo.dev.yml
Run npm run lint
to check for linting errors and npm run lint:fix
to format all code to spec.
Run npm run dev
to start in development mode at http://localhost:3001/.
Run npm start
to start in production mode.