this project is an express server serving Mini Twitter REST API
- clone the repo
- run
npm install
- run
cp .env.example .env
- copy environment variables inside the
.env
file - if doing development:
- launch the server by running
npm run start:dev
- if doing tests, run
npm run test:dev
to relaunch tests automatically after save
- launch the server by running
- if launching the server on the production:
- run
npm run build
- run
npm start
- run
- to launch tests one time:
- run
npm run test
- run
- before commiting to the repo:
- run
npm run prettier-format
to pretty the code - run
npm run lint
to look for ESLint warnings and errors
- run
you can find the swagger documentation of the REST API by launching the server and hitting the endpoint /api/v1/docs/
src/
:config/
: holds all the config files necessary to config the serverdocs/
: hold all the server documentations (swagger docs - basic system design diagrams - postman collection)exceptions/
: holds custom exceptionsmiddlewares/
: holds the middlewares that intercepts requests and responsesmodules/
: core folder that holds the features this server provideshared/
: holds interfaces, functions ... etc that are shared accross the whole projectvalidations/
: holds validations used to validate user inputsindex.ts
: file that sets up & initializes the server, and glues everything together
- set up the project boilerplate
- implement user module
- meanwhile testing the endpoints using postman
- implement auth module
- implement tests for user module (and realizing I kind of suck at tests ':-) )
- implement tweet module
- linting the project ( because I realized I had ESLint disabled until the end of the project ':-) )
- write swagger documentation
- draw basic system design diagrams
- write the readme
- Typescript
- Node.js
- Express.js
- MongoDB ( already hosted on the cloud with MongoDB Atlass )
- Mongoose
- Json Web Tokens
- Bcrypt
- Swagger
- VSCode
- Postman
- put eveything that I learned in one Node.js project
- using the RCSRM (Router - Controller - Service - Repository - Model) layered architecture
- intorduction to testing large applications
- writting Swagger documentation
- It was really fun for me to solve this challenge, in my opinion, this coding test allowed me to craft the most beautiful Express server I could ever develop, As I could glue together in one project everything that I've learned about Node.js best practices, I've also learned quite a lot by the time of the development
- next step for me would be to learn more about tests, because I didn't get a proper chance to use tests before, I know tests are really important when it comes to build robust softwares.
- built with <3 and excitement by @salimdellali